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


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

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


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

示例1: JSStringGetLength

bool JS4D::StringToVString( StringRef inJSString, VString& outString)
{
	bool ok;
	if (inJSString != NULL)
	{
		size_t length = JSStringGetLength( inJSString);
		UniChar *p = outString.GetCPointerForWrite( length);
		if (p != NULL)
		{
			::memcpy( p, JSStringGetCharactersPtr( inJSString), length * sizeof( UniChar));
			ok = outString.Validate( length);
		}
		else
		{
			outString.Clear();
			ok = false;
		}
	}
	else
	{
		ok = false;
		outString.Clear();
	}
	return ok;
}
开发者ID:sanyaade-webdev,项目名称:core-XToolbox,代码行数:25,代码来源:JS4D.cpp

示例2: GetData

void AXMLElement::GetData( VString &pCData)
{
	AXMLGenericElement	*elem;
	VString			vCData;

	vCData.Clear();
	pCData.Clear();
	elem = Get_FirstChild();
	while (elem) {
		elem->GetData(vCData);
		pCData.AppendString(vCData);
//		pCData.AppendChar((uBYTE)0x0D);
		elem = elem->GetNext();
	}
}
开发者ID:StephaneH,项目名称:core-XToolbox,代码行数:15,代码来源:XMLGenerator.cpp

示例3: GetString

Boolean VMacResFile::GetString(VString& outString, sLONG inID) const
{
	outString.Clear();

	if (!testAssert(fRefNum != -1))
		return false;
	
	if (!testAssert(inID >= -32768 && inID <= 32767))
		return false;

	sWORD	curres = ::CurResFile();
	if (curres != fRefNum)
		::UseResFile(fRefNum);

	Handle data = fUseResourceChain ? ::GetResource('STR ', (short) inID) : ::Get1Resource('STR ', (short) inID);

	if (curres != fRefNum)
		::UseResFile(curres);
		
	Boolean isOK = false;
	if (testAssert(data != NULL))
	{
		if (testAssert(*data != NULL))
		{
			::HLock(data);
			outString.MAC_FromMacPString((StringPtr) *data);
			::HUnlock(data);
			isOK = true;
		}
	}
	return isOK;
}
开发者ID:StephaneH,项目名称:core-XToolbox,代码行数:32,代码来源:XMacResource.cpp

示例4: GetPropertyName

void VJSPropertyIterator::GetPropertyName( VString& outName) const
{
	if (testAssert( fIndex < fCount))
		JS4D::StringToVString( JSPropertyNameArrayGetNameAtIndex( fNameArray, fIndex), outName);
	else
		outName.Clear();
}
开发者ID:sanyaade-iot,项目名称:core-XToolbox,代码行数:7,代码来源:VJSValue.cpp

示例5: GetStdFont

void XMacFontMgr::GetStdFont( StdFont inFont, VString& outName, VFontFace& outFace, GReal& outSize)
{
	// on risque de perdre des infos, il faudrait retourner une VFont
	
	CTFontUIFontType fontType = StdFontToThemeFontID( inFont);
	CTFontRef fontRef = ::CTFontCreateUIFontForLanguage( fontType, 0 /*size*/, NULL /*language*/ );

	if (testAssert( fontRef != NULL))
	{
		outSize = ::CTFontGetSize( fontRef);

		CFStringRef cfName = ::CTFontCopyFamilyName( fontRef);
		if (cfName != NULL)
		{
			outName.MAC_FromCFString( cfName);
			::CFRelease( cfName);
		}
		else
		{
			outName.Clear();
		}
		
		CTFontSymbolicTraits traits = ::CTFontGetSymbolicTraits( fontRef);
		outFace = 0;
		
		if (traits & kCTFontItalicTrait)
			outFace |= KFS_ITALIC;
		
		if (traits & kCTFontBoldTrait)
			outFace |= KFS_BOLD;
		
		if (traits & kCTFontExpandedTrait)
			outFace |= KFS_EXTENDED;
		
		if (traits & kCTFontCondensedTrait)
			outFace |= KFS_CONDENSED;

		CFRelease( fontRef); 
	}
	else
	{
		outName.Clear();
		outSize = 0;
		outFace = 0;
	}
}
开发者ID:sanyaade-iot,项目名称:core-XToolbox,代码行数:46,代码来源:XMacFontMgr.cpp

示例6: GetName

Boolean IPropertyCollector::GetName(VString& outName) const
{
	Boolean succeed = GetString(CVSTR("name"), outName);
	
	if (!succeed)
		outName.Clear();
	
	return succeed;
}
开发者ID:sanyaade-webdev,项目名称:core-XToolbox,代码行数:9,代码来源:IPropertyCollector.cpp

示例7: GetLocaleInfo

bool XWinIntlMgr::GetLocaleInfo( LCTYPE inType, VString& outInfo) const
{
	UniChar info[256];
	int r = ::GetLocaleInfoW( fDialect, inType, info, sizeof( info) / sizeof( UniChar));
	if (testAssert( r != 0))
		outInfo = info;
	else
		outInfo.Clear();
	return r != 0;
}
开发者ID:sanyaade-iot,项目名称:core-XToolbox,代码行数:10,代码来源:XWinIntlMgr.cpp

示例8: GetPropertyAsString

bool VJSObject::GetPropertyAsString(const VString& inPropertyName, JS4D::ExceptionRef *outException, VString& outResult) const
{
	bool ok = false;
	VJSValue result(GetProperty(inPropertyName, outException));
	outResult.Clear();
	if (!result.IsNull() && !result.IsUndefined())
	{
		ok = result.GetString(outResult, outException);
	}
	return ok;
}
开发者ID:sanyaade-iot,项目名称:core-XToolbox,代码行数:11,代码来源:VJSValue.cpp

示例9: GetAttribute

void AXMLElement::GetAttribute(const VString &pAttributename,VString &pValue) {
	AXMLAttribute	*attribute = NULL;
	attribute = fFirstAttribute;
	while (attribute)
	{
		if (attribute->GetName() == pAttributename) break;
		attribute = attribute->GetNext();
	}
	if (attribute) pValue.FromString(attribute->GetValue());
	else pValue.Clear();
}
开发者ID:StephaneH,项目名称:core-XToolbox,代码行数:11,代码来源:XMLGenerator.cpp

示例10: GetBuildNumber

void VProcess::GetBuildNumber( VString& outName) const
{
	// product version string should be formatted as follows: 1.0 build 2.108412
	VIndex pos = fProductVersion.Find( "build ");
	if (pos > 0)
	{
		fProductVersion.GetSubString( pos + 6, fProductVersion.GetLength() - pos - 5, outName); 
		outName.RemoveWhiteSpaces();
	}
	else
	{
		outName.Clear();
	}
}
开发者ID:sanyaade-iot,项目名称:core-XToolbox,代码行数:14,代码来源:VProcess.cpp

示例11: lNamespaceKey

	virtual	VError HandleRequest( IHTTPResponse* inResponse)
			{
				if (inResponse == NULL)
					return VE_INVALID_PARAMETER;

				VError err = VE_OK;
				bool done = false;

				// First, extract the relative path from the url
				VString path = inResponse->GetRequest().GetURLPath();
				VRegexMatcher *matcher = VRegexMatcher::Create( fPattern, &err);
				if ((matcher != NULL) && (err == VE_OK))
				{
					bool match = matcher->Find( path, 1, false, &err);
					if (match && (err == VE_OK))
					{
						// Remove the pattern from the path
						path.Remove( matcher->GetGroupStart(0), matcher->GetGroupLength(0));

						// Check whether a namespace is specified
						VString lNamespaceKey( L"namespace=");
						VString lNamespace = inResponse->GetRequest().GetURLQuery();
						if (lNamespace.BeginsWith( lNamespaceKey))
							lNamespace.Remove( 1, lNamespaceKey.GetLength());
						else
							lNamespace.Clear();

						// Now, we have a relative  module path
						VString proxy;
						err = fService->GetProxy( proxy, path, lNamespace, &inResponse->GetRequest(), inResponse);
						if (err == VE_OK)
						{
							VString contentType( L"application/javascript");
							err = SetHTTPResponseString( inResponse, proxy, &contentType);
							done = true;
						}
					}
				}
				ReleaseRefCountable( &matcher);

				if (!done)
					err = inResponse->ReplyWithStatusCode( HTTP_NOT_FOUND);

				return err;
			}
开发者ID:StephaneH,项目名称:core-Wakanda,代码行数:45,代码来源:VRPCService.cpp

示例12: GetEnvironmentVariableValue

bool VEnvironmentVariables::GetEnvironmentVariableValue(const VString &inEnvName, VString &outEnvValue, bool inAndRemoveIt)
{
	bool	gotIt = false;
	
	outEnvValue.Clear();
	if(!inEnvName.IsEmpty() && !fEnvVars.empty())
	{
		EnvVarNamesAndValuesMap::iterator	envVarIt = fEnvVars.find(inEnvName);
		if(envVarIt != fEnvVars.end())
		{
			outEnvValue = envVarIt->second;
			gotIt = true;
			if(inAndRemoveIt)
				fEnvVars.erase(envVarIt);
		}
	}
	
	return gotIt;
}
开发者ID:StephaneH,项目名称:core-XToolbox,代码行数:19,代码来源:VEnvironmentVariables.cpp

示例13: GetResourceName

VError VMacResFile::GetResourceName(const VString& inType, sLONG inID, VString& outName) const
{
	outName.Clear();
	Handle data = NULL;
	VError error = _GetResource(inType, inID, &data);
	if (error == VE_OK)
	{
		ResType type;
		sWORD	id;
		Str255 spName;
		::GetResInfo(data, &id, &type, spName);
		OSErr macError = ::ResError();
		if (testAssert(macError == noErr))
		{
			outName.MAC_FromMacPString(spName);
		} else
			error = VErrorBase::NativeErrorToVError((VNativeError)macError);
	}
	return error;
}
开发者ID:StephaneH,项目名称:core-XToolbox,代码行数:20,代码来源:XMacResource.cpp

示例14: FormatTime

void XWinIntlMgr::FormatTime( const VTime& inTime, VString& outTime, EOSFormats inFormat, bool inUseGMTTimeZoneForDisplay)
{
	// 1:system short time; 2:system medium time; 3:system long time

	DWORD timeFormat=0;
	switch(inFormat)
	{
		case eOS_SHORT_FORMAT:// No signs
		case eOS_MEDIUM_FORMAT:// No signs
			timeFormat=TIME_NOTIMEMARKER;
			break;
		case eOS_LONG_FORMAT://all
			break;
		default:
			break;
	};

	// Prepare SYSTEMTIME for windows.
	sWORD YY=0,MM=0,DD=0,hh=0,mm=0,ss=0,ms=0;
	SYSTEMTIME osTime={0};
	if (inUseGMTTimeZoneForDisplay)
		inTime.GetUTCTime (YY,MM,DD,hh,mm,ss,ms);
	else
		inTime.GetLocalTime (YY,MM,DD,hh,mm,ss,ms);
	osTime.wYear=YY;
	osTime.wMonth=MM;
	osTime.wDay=DD;
	osTime.wHour=hh;
	osTime.wMinute=mm;
	osTime.wSecond=ss;
	osTime.wMilliseconds=ms;

	// Let the OS do the stuff.
	UniChar acBuffer[256];
	if (::GetTimeFormatW( fDialect,timeFormat,&osTime,NULL,acBuffer,sizeof(acBuffer)))
		outTime=acBuffer;
	else
		outTime.Clear();
}
开发者ID:sanyaade-iot,项目名称:core-XToolbox,代码行数:39,代码来源:XWinIntlMgr.cpp

示例15: GetPath

void VFolder::GetPath( VString &outPath, FilePathStyle inPathStyle) const
{
	switch (inPathStyle)
	{
		case FPS_SYSTEM :
			fPath.GetPath( outPath );
			break;

		case FPS_POSIX :
			{
				VError err = fFolder.GetPosixPath( outPath);
				if (err != VE_OK)
					fPath.GetPosixPath( outPath);	// boff
				break;
			}
			break;

		default:
			xbox_assert( false);
			outPath.Clear();
			break;
	}
}
开发者ID:sanyaade-webdev,项目名称:core-XToolbox,代码行数:23,代码来源:VFolder.cpp


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