当前位置: 首页>>代码示例>>C++>>正文


C++ VString::GetLength方法代码示例

本文整理汇总了C++中VString::GetLength方法的典型用法代码示例。如果您正苦于以下问题:C++ VString::GetLength方法的具体用法?C++ VString::GetLength怎么用?C++ VString::GetLength使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在VString的用法示例。


在下文中一共展示了VString::GetLength方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ResolveAliasFolder

/*
	static
*/
VError VFolder::ResolveAliasFolder( VFolder **ioFolder, bool inDeleteInvalidAlias)
{
	VError err = VE_OK;
	if ( (*ioFolder != NULL) && (*ioFolder)->fPath.IsFolder() && !(*ioFolder)->fFolder.Exists( false /* doesn't check alias */) )
	{
		// the folder doesn't exists
		// maybe is it an alias file?
		VString path = (*ioFolder)->fPath.GetPath();
		if (testAssert( path[path.GetLength()-1] == FOLDER_SEPARATOR))
		{
			path.Truncate( path.GetLength()-1);
			#if VERSIONWIN
			path += ".lnk";
			#endif
			VFile file( path);
			if (file.IsAliasFile() && file.Exists())
			{
				VFilePath resolvedPath;
				err = file.GetImpl()->ResolveAlias( resolvedPath);	// nothrow
				if (err == VE_OK)
				{
					if (resolvedPath.IsFolder())
					{
						(*ioFolder)->Release();
						*ioFolder = new VFolder( resolvedPath);
					}
					else if (inDeleteInvalidAlias)
					{
						err = file.Delete();
					}
					else
					{
						StThrowFileError errThrow( *ioFolder, VE_FILE_CANNOT_RESOLVE_ALIAS_TO_FOLDER);
						err = errThrow.GetError();
					}
				}
				else if (inDeleteInvalidAlias)
				{
					err = file.Delete();
				}
				else
				{
					if (IS_NATIVE_VERROR( err))
					{
						StThrowFileError errThrow( &file, VE_FILE_CANNOT_RESOLVE_ALIAS, err);
						err = errThrow.GetError();
					}
				}
			}
		}
	}
	return err;
}
开发者ID:sanyaade-webdev,项目名称:core-XToolbox,代码行数:56,代码来源:VFolder.cpp

示例2: GetChangeListNumber

/*
	IMPORTANT:	the build version is created on the compilation machine. It requires that (1) perl is installed and (2) an external file contains the number.
				That's why if you compile 4D on your computer, you'll probably always get a build version of 0 (if the external file is not found, "00000" is used)
*/
sLONG VProcess::GetChangeListNumber() const
{
	sLONG changeListNumber = 0;
	VString s;
	GetBuildNumber( s);
	VIndex pos = s.FindUniChar( '.', s.GetLength(), true);
	if (pos > 0)
	{
		s.SubString( pos + 1, s.GetLength() - pos);
		changeListNumber = s.GetLong();
	}
	return changeListNumber;
}
开发者ID:sanyaade-iot,项目名称:core-XToolbox,代码行数:17,代码来源:VProcess.cpp

示例3: ConsumeName

bool ScriptDocLexer::ConsumeName( VString &outName, bool &outIsOptional, bool &outDoFurtherProcessing )
{
	outIsOptional = false;
	outDoFurtherProcessing = true;
	while (true) {
		if (!fLexerInput->HasMoreChars())	return false;
		UniChar ch = fLexerInput->MoveToNextChar();

		if (CHAR_LEFT_SQUARE_BRACKET == ch) {
			// If the name is enclosed in [], then it's considered to be an optional
			// parameter.
			if (outName.GetLength() == 0) {
				outIsOptional = true;
			} else {
				return false;
			}
		} else if (IsLineEnding( ch )) {
			// We've reached the end of the tag, and the user has not specified a comment, which
			// is fine.  We'll just break out now and not do any further processing.
			ConsumeLineEnding( ch );
			outDoFurtherProcessing = false;
			break;
		} else if (IsWhitespace( ch ) || (outIsOptional && CHAR_RIGHT_SQUARE_BRACKET == ch)) {
			break;
		} else {
			outName.AppendUniChar( ch );
		}
	}
	return true; 
}
开发者ID:sanyaade-iot,项目名称:core-Components,代码行数:30,代码来源:ScriptDoc.cpp

示例4: parseOneLineByLex

void VXMLSyntax::parseOneLineByLex(ICodeEditorDocument *&inDocument, sLONG inLineNumber,struct xmlLexStyleInfo *&inputstruct)
{
	VString xstr;
	inDocument->GetLine(inLineNumber,xstr);
	const UniChar * unistring  = xstr.GetCPointer();
	char *lexinput;
	sLONG len = xstr.GetLength();
	lexinput = new char[len+1];
	lexinput[len] = '\0';

	for(int i = 0 ; i < len ; i++)     //to change unicode to char
	{
		if ( unistring[i] == 9 )
		{
			lexinput[i] = ' ';
		}
		else if (unistring[i] > 127)
		{	
			lexinput[i] = 'X';
		}
		else
		{	
			lexinput[i] = (char)unistring[i];
		}			
	}
	inputstruct = startxmlParse(lexinput);  
	delete lexinput;
}
开发者ID:sanyaade-webdev,项目名称:core-Components,代码行数:28,代码来源:XMLSyntax.cpp

示例5: EndElement

void VSpanHandler::EndElement( const VString& inElementName)
{
	xbox_assert(inElementName == fElementName);

	VTextStyle *style = fStyles->GetData();
	if (style)
	{
		sLONG vbegin, vend;
		style->GetRange(vbegin,vend);
		vend = fText->GetLength();
		style->SetRange(vbegin,vend);

	}
	if (!fParseSpanOnly)
	{
		//HTML parsing:

		if (inElementName.EqualToString("q"))
			//end of quote
			*fText += "\"";

		//add break lines for elements which need it
		if (VTaggedTextSAXHandler::NeedBreakLine(inElementName))
			*fText += "\r";
	}
}
开发者ID:sanyaade-mobiledev,项目名称:core-XToolbox,代码行数:26,代码来源:VSpanText.cpp

示例6: _BuildArrayArguments

void XPosixProcessLauncher::_BuildArrayArguments(char **&outArrayArg)
{	
	sLONG nbArguments = (sLONG) fArrayArg.size();
	
	// Dispose the previous array of arguments if not NULL
	_Free2DCharArray(outArrayArg);
	
	if(nbArguments < 1)
		return;
	
	size_t outArrayArgLength = (nbArguments + 1 ) * sizeof(char*);
	outArrayArg = (char **) gMemory->NewPtr(outArrayArgLength, 0);
	
	if(testAssert(outArrayArg != NULL))
	{
		for(sLONG i = 0; i < nbArguments; ++i)
		{
			VString		*currentArgPtr = &fArrayArg[i];
			size_t		argFullLength = currentArgPtr->GetLength() * 2;// + 1;
			char		*newArgPtr = new char[argFullLength];
			
			if(newArgPtr != NULL)
				currentArgPtr->ToCString(newArgPtr, argFullLength);
			
			outArrayArg[i] = newArgPtr;
		}
		outArrayArg[nbArguments] = NULL;
	}
}
开发者ID:sanyaade-mobiledev,项目名称:core-XToolbox,代码行数:29,代码来源:XPosixProcessLauncher.cpp

示例7: GetKeysFromPath

/*
	static
*/
void VValueBag::GetKeysFromPath( const VString& inPath, StKeyPath& outKeys)
{
	VFromUnicodeConverter_UTF8 converter;

	char buffer[256];
	VIndex charsConsumed;
	VSize bytesProduced;
	const UniChar *begin = inPath.GetCPointer();
	const UniChar *end = begin + inPath.GetLength();
	for( const UniChar *pos = begin ; pos != end ; ++pos)
	{
		if (*pos == '/')
		{
			bool ok = converter.Convert( begin, (VIndex) (pos - begin), &charsConsumed, buffer, sizeof( buffer), &bytesProduced);
			if (ok)
			{
				outKeys.push_back( StKey( buffer, bytesProduced));
			}
			begin = pos + 1;
		}
	}
	if (begin != end)
	{
		bool ok = converter.Convert( begin, (VIndex) (end - begin), &charsConsumed, buffer, sizeof( buffer), &bytesProduced);
		if (ok)
		{
			outKeys.push_back( StKey( buffer, bytesProduced));
		}
	}
}
开发者ID:StephaneH,项目名称:core-XToolbox,代码行数:33,代码来源:VValueBag.cpp

示例8: findStopLoc

int VXMLSyntax::findStopLoc(ICodeEditorDocument* inDocument,int inLineNumber,int commenttype)
{
	VString xstr;
	inDocument->GetLine(inLineNumber,xstr);
	const UniChar * unistringtemp  = xstr.GetCPointer();
	int stoploc = 0;


	if ( commenttype == ordinarycomment)
	{
		for (int i = 0;i < xstr.GetLength()-1;i++)
		{
			if (unistringtemp[i] == '*' && unistringtemp[i+1] == '/')
			{  
				stoploc = i+1;
				break;
			}
			if (unistringtemp[i] == '/' && unistringtemp[i+1] == '*')
			{
				stoploc = i +1;
				break;
			}
		}
	}
	else if ( commenttype == htmlsytlecomment )
	{
		for (int i = 0;i < xstr.GetLength()-3;i++)
		{ 
			//		char c = unistringtemp[i];
			if (unistringtemp[i+1] == '-' && unistringtemp[i+2] == '-' && unistringtemp[i+3] == '>')
			{  
				stoploc = i+2;
				break;
			}
			if (unistringtemp[i] == '<' && unistringtemp[i+1] == '!' && unistringtemp[i+2] == '-'&& unistringtemp[i+3] == '-')
			{
				stoploc = i + 3;
				break;
			}
		}

	}

	return stoploc;
}
开发者ID:sanyaade-webdev,项目名称:core-Components,代码行数:45,代码来源:XMLSyntax.cpp

示例9: JSValueMakeNull

JS4D::ValueRef JS4D::VStringToValue( ContextRef inContext, const VString& inString)
{
	if (inString.IsNull())
		return JSValueMakeNull( inContext);

	JSStringRef jsString = JSStringCreateWithCharacters( inString.GetCPointer(), inString.GetLength());
	ValueRef value = JSValueMakeString( inContext, jsString);
	JSStringRelease( jsString);
	return value;
}
开发者ID:sanyaade-webdev,项目名称:core-XToolbox,代码行数:10,代码来源:JS4D.cpp

示例10: Parse

bool VXMLParser::Parse( const VString& inText, IXMLHandler *inHandler, XMLParsingOptions inOptions)
{
	xercesc::MemBufInputSource source( (const XMLByte *) inText.GetCPointer(), inText.GetLength() * sizeof( UniChar), "frommem");
	#if BIGENDIAN
	source.setEncoding( xercesc::XMLUni::fgUTF16BEncodingString);
	#else
	source.setEncoding( xercesc::XMLUni::fgUTF16LEncodingString);
	#endif

	return SAXParse( this, source, inHandler, inOptions);
}
开发者ID:sanyaade-mobiledev,项目名称:core-XToolbox,代码行数:11,代码来源:XMLSaxParser.cpp

示例11: SetAttribute

void VTaggedTextSAXHandler::SetAttribute(const VString& inName, const VString& inValue)
{
	if( inName == "STYLE")
	{
		if (*fStyles == NULL)
		{
			*fStyles = new VTreeTextStyle();
			VTextStyle* style = new VTextStyle();
			style->SetRange(0,fText->GetLength());
			(*fStyles)->SetData(style);
		}

		VCSSParserInlineDeclarations cssParser;

		VSpanHandler *handler = new VSpanHandler(VString("body"), *fStyles, fText, fParseSpanOnly);	
		cssParser.Start(inValue);
		VString attribut, value;
		while(cssParser.GetNextAttribute(attribut, value))
		{
			handler->TraiteCSS(attribut, value);
		}
		handler->Release();
	} else if (!fParseSpanOnly)
	{
		if (*fStyles == NULL)
		{
			*fStyles = new VTreeTextStyle();
			VTextStyle* style = new VTextStyle();
			style->SetRange(0,fText->GetLength());
			(*fStyles)->SetData(style);
		}
		VSpanHandler *handler = new VSpanHandler(VString("body"), *fStyles, fText, fParseSpanOnly);	
		handler->SetHTMLAttribute( inName, inValue);
		handler->Release();
	}
}
开发者ID:sanyaade-mobiledev,项目名称:core-XToolbox,代码行数:36,代码来源:VSpanText.cpp

示例12: GetRelativeURL

VError VFolder::GetRelativeURL(VFolder* inBaseFolder, VString& outURL, bool inEncoded)
{
	VString folderURL;
	VError err = GetURL(outURL, inEncoded);
	if (inBaseFolder != NULL)
	{
		inBaseFolder->GetURL(folderURL, inEncoded);
		if (outURL.BeginsWith(folderURL))
		{
			outURL.Remove(1, folderURL.GetLength());
		}

	}
	return err;
}
开发者ID:sanyaade-webdev,项目名称:core-XToolbox,代码行数:15,代码来源:VFolder.cpp

示例13: SwapComment

void VHTMLSyntax::SwapComment( ICodeEditorDocument* inDocument, VString& ioString, bool inComment )
{
	if ( inComment )
	{
		ioString.Insert( CVSTR( "<!--" ), 1 );
		ioString += CVSTR( "-->" );
	}
	else
	{
		if ( ioString.BeginsWith( CVSTR( "<!--" ) ) )
			ioString.Remove( 1, 4 );

		if ( ioString.EndsWith( CVSTR( "-->" ) ) )
			ioString.Truncate( ioString.GetLength() - 3 );
	}
}
开发者ID:sanyaade-webdev,项目名称:core-Components,代码行数:16,代码来源:HTMLSyntax.cpp

示例14: ColorToValue

void ColorToValue(const RGBAColor inColor, VString& outValue)
{
	outValue.FromHexLong(inColor);
	sLONG len = outValue.GetLength();
	//ignorer le canal alpha
	if(len==8 && outValue.BeginsWith("FF"))
	{
		outValue.Replace("",1,2);
	}

	for(int i=0; i < 6-len;i++)
	{
		outValue = "0" + outValue;
	}

	outValue = "#" + outValue;
}
开发者ID:sanyaade-mobiledev,项目名称:core-XToolbox,代码行数:17,代码来源:VSpanText.cpp

示例15: SetFontSize

void VSpanHandler::SetFontSize(const VString& inValue, float inDPI)
{
	Real size = 0;
	VTextStyle* TheStyle = fStyles->GetData();
	if(!TheStyle)
		return;
	if(inValue.EndsWith("pt", true))
	{
		VString textsize = inValue;
		textsize.Truncate( inValue.GetLength()-2);
		size = textsize.GetReal();
		//we need convert from format dpi to 72 dpi
#if VERSIONWIN
		TheStyle->SetFontSize(floor(size*(inDPI ? inDPI : VSpanTextParser::Get()->GetDPI())/72.0f+0.5f));
#else
		TheStyle->SetFontSize(size);
#endif
	}
}
开发者ID:sanyaade-mobiledev,项目名称:core-XToolbox,代码行数:19,代码来源:VSpanText.cpp


注:本文中的VString::GetLength方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。