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


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

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


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

示例1: _save

void VJSImage::_save(XBOX::VJSParms_callStaticFunction& ioParms, VJSPictureContainer* inPict)
{
	VPictureCodecFactoryRef fact;
	const VPictureCodec* encoder = nil;
	bool ok = false;

	VPicture* pic = inPict->GetPict();
	if (pic != nil)
	{
		VFile* file = ioParms.RetainFileParam(1);
		if (file != nil)
		{
			VString mimetype;
			ioParms.GetStringParam(2, mimetype);
			if (mimetype.IsEmpty())
			{
				VString extension;
				file->GetExtension(extension);
				if (extension.IsEmpty())
					extension = L"pic";
				encoder = fact->RetainEncoderForExtension(extension);
			}
			else
				encoder = fact->RetainEncoderByIdentifier(mimetype);

			if (encoder != nil)
			{
				VError err = VE_OK;
				if (file->Exists())
					err = file->Delete();
				if (err == VE_OK)
				{
					VValueBag *pictureSettings = nil;

					VValueBag *bagMetas = (VValueBag*)inPict->RetainMetaBag();
					if (bagMetas != nil)
					{
						pictureSettings = new VValueBag();
						ImageEncoding::stWriter settingsWriter(pictureSettings);
						VValueBag *bagRetained = settingsWriter.CreateOrRetainMetadatas( bagMetas);
						if (bagRetained) 
							bagRetained->Release(); 
					}
					err=encoder->Encode(*pic, pictureSettings, *file);

					QuickReleaseRefCountable(bagMetas);
					QuickReleaseRefCountable(pictureSettings);

					if (err == VE_OK)
						ok = true;
				}
				encoder->Release();
			}
			file->Release();
		}
		else
			vThrowError(VE_JVSC_WRONG_PARAMETER_TYPE_FILE, "1");
	}
	ioParms.ReturnBool(ok);
}
开发者ID:sanyaade-mobiledev,项目名称:core-XToolbox,代码行数:60,代码来源:VJSRuntime_Image.cpp

示例2:

VNetAddress::VNetAddress(const VString& inIp, PortNumber inPort) 
{
	xbox_assert(!inIp.IsEmpty());

	if(inIp.IsEmpty())
		vThrowError(fNetAddr.FromIpAndPort(GetAnyIP(), inPort));
	else
		vThrowError(fNetAddr.FromIpAndPort(inIp, inPort));
}
开发者ID:sanyaade-iot,项目名称:core-XToolbox,代码行数:9,代码来源:VNetAddr.cpp

示例3: GetDateSeparator

VString XLinuxIntlMgr::GetDateSeparator() const
{
	VString dateSeparator;

	icu::DateFormat* dateFmt=icu::DateFormat::createDateInstance(icu::DateFormat::SHORT, fLocale);
	xbox_assert(dateFmt!=NULL);

	icu::SimpleDateFormat* simpleDateFmt=reinterpret_cast<icu::SimpleDateFormat*>(dateFmt);
	xbox_assert(simpleDateFmt!=NULL);

	if(simpleDateFmt!=NULL)
	{
		UErrorCode err=U_ZERO_ERROR;

		UnicodeString tmpPattern;
		simpleDateFmt->toLocalizedPattern(tmpPattern, err);
		xbox_assert(err==U_ZERO_ERROR);

		VString datePattern(tmpPattern.getTerminatedBuffer());
		bool isQuoted=false;

		for(int i=0 ; i<datePattern.GetLength() ; i++)
		{
			UniChar c=datePattern[i];

			if(c=='\'')
				isQuoted=!isQuoted;

			if(isQuoted)
				continue;

			//ICU works with patterns ("M/d/yy" for ex.) and doesn't have a notion of date separator.
			//As a work around, we try to get a localized date pattern and pick the first char that looks like a separator.
			if(!(c>='A' && c<='Z') && !(c>='a' && c<='z'))
			{
				dateSeparator.AppendUniChar(c);
				break;
			}
		}
	}

	if(dateFmt!=NULL)
		delete dateFmt;

	xbox_assert(!dateSeparator.IsEmpty());

	if(dateSeparator.IsEmpty())
		return VString("/");

	return dateSeparator;
}
开发者ID:sanyaade-mobiledev,项目名称:core-XToolbox,代码行数:51,代码来源:XLinuxIntlMgr.cpp

示例4: SetProjectileMesh

void RPG_Projectile::SetProjectileMesh(VString const& meshFilename)
{
  if (!meshFilename.IsEmpty())
  {
    m_projectileMeshFilename = meshFilename;
  }
}
开发者ID:Arpit007,项目名称:projectanarchy,代码行数:7,代码来源:Projectile.cpp

示例5: GetTimeSeparator

VString XLinuxIntlMgr::GetTimeSeparator() const
{
	VString timeSeparator;

	VString timePattern=GetDateOrTimePattern(SHORT_TIME);

	bool isQuoted=false;

	for(int i=0 ; i<timePattern.GetLength() ; i++)
	{
		UniChar c=timePattern[i];

		if(c=='\'')
			isQuoted=!isQuoted;

		if(isQuoted)
			continue;

		if(!(c>='A' && c<='Z') && !(c>='a' && c<='z'))
		{
			timeSeparator.AppendUniChar(c);
			break;
		}
	}

	if(timeSeparator.IsEmpty())
		return VString(":");

	return timeSeparator;
}
开发者ID:sanyaade-mobiledev,项目名称:core-XToolbox,代码行数:30,代码来源:XLinuxIntlMgr.cpp

示例6: MousePosToTextPos

bool VFontMetrics::MousePosToTextPos(const VString& inString, GReal inMousePos, sLONG& ioTextPos, GReal& ioPixPos) 
{
	if (inString.IsEmpty())
		return false;
	
	return fMetrics.MousePosToTextPos( inString, inMousePos, ioTextPos, ioPixPos);
}
开发者ID:sanyaade-iot,项目名称:core-XToolbox,代码行数:7,代码来源:VFont.cpp

示例7: RetainExecutableFile

VFile* XLinuxLibrary::RetainExecutableFile(const VFilePath &inFilePath) const
{
    //jmo - What are we supposed to retain ? First we try the exact path...

	if(inFilePath.IsFile())
		return new VFile(inFilePath);

    //jmo - If exact path doesn't work, we assume inFilePath to be part of a bundle
    //      and try to find the corresponding shared object.
    
    VFilePath bundlePath=inFilePath;

    while(!bundlePath.MatchExtension(CVSTR("bundle"), true /*case sensitive*/) && bundlePath.IsValid())
        bundlePath=bundlePath.ToParent();

    if(!bundlePath.IsValid())
        return NULL;

    VString name;
    bundlePath.GetFolderName(name, false /*no ext.*/);

    if(name.IsEmpty())
        return NULL;

    VString soSubPath=CVSTR("Contents/Linux/")+VString(name)+CVSTR(".so");

    VFilePath soPath;
    soPath.FromRelativePath(bundlePath, soSubPath, FPS_POSIX);
            
    if(soPath.IsFile())
        return new VFile(soPath);
    
    return NULL;
}
开发者ID:sanyaade-webdev,项目名称:core-XToolbox,代码行数:34,代码来源:XLinuxLibrary.cpp

示例8: AddMember

bool VJSONSingleObjectWriter::AddMember( const VString& inName, const VValueSingle &inValue, JSONOption inModifier)
{
	bool ok = false;
	VString valueString;

	if(testAssert(inValue.GetJSONString( valueString, inModifier) == VE_OK) && !inName.IsEmpty())
	{
		if (fIsClosed)
		{
			fObject.Remove( fObject.GetLength(), 1);
			fIsClosed = false;
		}

		if (fMembersCount > 0)
			fObject.AppendUniChar( ',');
		
		fObject.AppendUniChar( '"');
		fObject.AppendString( inName);
		fObject.AppendUniChar( '"');
		fObject.AppendUniChar( ':');
		fObject.AppendString( valueString);
		++fMembersCount;
		ok = true;
	}
	return ok;
}
开发者ID:sanyaade-webdev,项目名称:core-XToolbox,代码行数:26,代码来源:VJSONTools.cpp

示例9: SetAttribute

void VLocalizationGroupHandler::SetAttribute(const VString& inName, const VString& inValue)
{
	if (fGroupBag == NULL)
		fGroupBag = new VValueBag;

	if (inName.EqualToUSASCIICString( "id"))
	{
		sLONG idValue = inValue.GetLong();
		if (idValue != 0)
			fGroupID = idValue;
		//else
			//DebugMsg( "VLocalizationGroupHandler::Non-valid group id Value : %S\n", &inValue);
	}	
	else if (inName.EqualToUSASCIICString( "resname"))
	{
		if (!inValue.IsEmpty())
		{
			fGroupResnamesStack.top() = inValue;
		}
	}
	else if (inName.EqualToUSASCIICString( "restype"))
	{
		xbox_assert( fGroupRestype.IsEmpty() );	// no nested group
		fGroupRestype = inValue;
	}

	if (fGroupBag != NULL)
		fGroupBag->SetAttribute( inName, inValue);
}
开发者ID:sanyaade-iot,项目名称:core-XToolbox,代码行数:29,代码来源:VLocalizationXMLHandler.cpp

示例10: GetProcessorBrandName

// [static]
VError XMacSystem::GetProcessorBrandName( XBOX::VString& outProcessorName)
{
	VError error = VE_OK;
	
	static VString sProcessorName;
	
	if (sProcessorName.IsEmpty())
	{
		// machdep.cpu.brand_string n'est dispo que sur intel
		char buffer[512];
		size_t size = sizeof( buffer);
		int	r = ::sysctlbyname( "machdep.cpu.brand_string", buffer, &size, NULL, 0);
		if (testAssert( r == 0))
		{
			sProcessorName.FromBlock( buffer, size, VTC_UTF_8);
		}
		else
		{
			error = VE_UNKNOWN_ERROR;
		}
	}
	
	outProcessorName = sProcessorName;
	
	return error;
}
开发者ID:StephaneH,项目名称:core-XToolbox,代码行数:27,代码来源:XMacSystem.cpp

示例11: VASSERT

VRTLSupport_cl::VRTLSupport_cl(VisFont_cl * pFont, const VString & utf8Text) : m_pFont(pFont), m_ppTextLines(NULL), m_iTextLines(0) {

  VASSERT(pFont != NULL);

  //set the text to display (if present)
  if(!utf8Text.IsEmpty())
    SetText(utf8Text);
}
开发者ID:cDoru,项目名称:projectanarchy,代码行数:8,代码来源:VArabicConverter.cpp

示例12: Attach

void RPG_Attachment::Attach(VisObject3D_cl* object, const VString& boneName, const hkvVec3& positionOffset /*= hkvVec3(0.f, 0.f, 0.f)*/, const hkvVec3& orientationOffset /*= hkvVec3(0.f, 0.f, 0.f)*/)
{
  if(!m_parent ||
     !object)
  {
    return;
  }

  m_object = object;
  m_boneName = boneName;
  m_positionOffset = positionOffset;
  m_orientationOffset = orientationOffset;

  bool validBone = false;

  if(!boneName.IsEmpty())
  {
    if(m_parent->GetMesh()->GetSkeleton()->GetBoneIndexByName(m_boneName) != -1)
    {
      validBone = true;
    }
    else
    {
      Vision::Error.Warning("RPG_Attachment::Attach - Supplied bone name doesn't exist on this skeleton: %s", boneName.AsChar());
    }

  }

  if(validBone)
  {
    
    // attach the proxy to the parent bone if specified
    if (!m_proxy)
    {
      // @note: m_proxy is not deleted within this class, because the attachment parent deletes it
      m_proxy = new VSkeletalBoneProxyObject();
    }
    m_proxy->AttachToEntityBone(m_parent, m_boneName.AsChar());
    m_proxy->UpdateBoneBinding();

    // attach the new object to the proxy
    m_object->AttachToParent(m_proxy);

    VASSERT(m_proxy->GetParent() == m_parent);
    VASSERT(m_object->GetParent() == m_proxy);
  }
  else
  {
    // if no bone is specified, just attach to the parent object
    m_object->AttachToParent(m_parent);

    VASSERT(m_object->GetParent() == m_parent);
  }

  m_object->ResetLocalTransformation();
  m_object->SetLocalPosition(m_positionOffset);
  m_object->SetLocalOrientation(m_orientationOffset);
}
开发者ID:cDoru,项目名称:projectanarchy,代码行数:58,代码来源:Attachment.cpp

示例13: do_SetCurrentUser

void VJSGlobalClass::do_SetCurrentUser( VJSParms_callStaticFunction& inParms, VJSGlobalObject*)
{
	VString username;
	inParms.GetStringParam(1, username);
	if (!username.IsEmpty())
	{
		// a faire ici ou dans VJSSolution ?
	}
}
开发者ID:sanyaade-webdev,项目名称:core-XToolbox,代码行数:9,代码来源:VJSGlobalClass.cpp

示例14: RemoveEnvironmentVariable

void VEnvironmentVariables::RemoveEnvironmentVariable(const VString &inEnvName)
{
	if(!inEnvName.IsEmpty() && !fEnvVars.empty())
	{
		EnvVarNamesAndValuesMap::iterator	envVarIt = fEnvVars.find(inEnvName);
		if(envVarIt != fEnvVars.end())
			fEnvVars.erase(envVarIt);
	}
}
开发者ID:StephaneH,项目名称:core-XToolbox,代码行数:9,代码来源:VEnvironmentVariables.cpp

示例15: GetURL

bool VJSValue::GetURL( XBOX::VURL& outURL, JS4D::ExceptionRef *outException) const
{
	VString path;
	if (!GetString( path, outException) && !path.IsEmpty())
		return false;
	
	JS4D::GetURLFromPath( path, outURL);

	return true;
}
开发者ID:sanyaade-iot,项目名称:core-XToolbox,代码行数:10,代码来源:VJSValue.cpp


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