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


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

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


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

示例1: _createEntities

void VLogicModel::_createEntities()
{
    VEntityMap::iterator itr;
    for (itr = mEntities.begin(); itr != mEntities.end(); ++itr)
    {
        Ogre::Entity *entity = VNULL;
        VEntityValue &entValue = itr->second;

        VString meshName = entValue.mMeshName;
        VString materialName = entValue.mMaterialName;

        try
        {
            Ogre::DataStreamPtr stream = Ogre::ResourceGroupManager::getSingleton().openResource(meshName);
        }
        catch (const Ogre::Exception &e)
        {
            Ogre::LogManager::getSingleton().logMessage(e.getDescription());
            continue;
        }

        if (!meshName.empty())
        {
            entValue.mEntity = _createEntity(meshName);
            if (entValue.mEntity && !materialName.empty())
            {
                _setEntityMaterial(itr->first, entValue.mMaterialName);
            }
        }
    }
}
开发者ID:asnwerear,项目名称:VEngine,代码行数:31,代码来源:VLogicModel.cpp

示例2: remove

	bool VDirAdapter::remove(const VString &strFileName)
	{
		if (strFileName.empty() || strFileName == "")
			return false;

		return (remove(strFileName.c_str()) == 0);
	}
开发者ID:asnwerear,项目名称:Demo,代码行数:7,代码来源:VDirAdapter.cpp

示例3: removeDir

	bool VDirAdapter::removeDir(const VString &strDir)
	{
		if (strDir.empty() || strDir == "")
			return false;

		return (rmdir(strDir.c_str()) == 0);
	}
开发者ID:asnwerear,项目名称:Demo,代码行数:7,代码来源:VDirAdapter.cpp

示例4: changeEntity

VBOOL VLogicModel::changeEntity(const VString &name, const VString &value)
{
    VEntityMap::iterator itr = mEntities.find(name);

    if (itr == mEntities.end())
    {
        Ogre::LogManager::getSingleton().logMessage("Logic Model Entity with name '" + name + "' dosen't exists! " +
                "LogicModel::changeEntity " + mName);
        return VFALSE;
    }

    VEntityValue &tempValue = itr->second;

    if (tempValue.mEntity)
    {
        //

        //
        _destroyEntity(tempValue.mEntity);
        tempValue.mEntity = VNULL;
    }

    if (!value.empty())
    {
        tempValue.mEntity = _createEntity(value);
    }

    //
    if (VNULL == mExternalBoundingBox)
    {
        _updateBoundingBox();
    }

    return VTRUE;
}
开发者ID:asnwerear,项目名称:VEngine,代码行数:35,代码来源:VLogicModel.cpp

示例5: changeSlotAttrib

VBOOL VLogicModel::changeSlotAttrib(const VString &name, const VString &value)
{
    for (VLocatorMap::iterator itr = mLocators.begin(); itr != mLocators.end(); ++itr)
    {
        VLocatorValue &locator = itr->second;
        VSlotMap::iterator i = locator.mSlots.find(name);

        if (i != locator.mSlots.end())
        {
            VSlotValue &slot = i->second;

            if (value.empty())
            {
                if (slot.mModel != VNULL)
                {
                    VLOGIC_MODEL_MANAGER.destroyLogicModel(slot.mModel);
                }

                slot.mModel = VNULL;
                slot.mModelName = value;
                return VTRUE;
            }
            else
            {
                slot.mModelName = value;
                return _createModelInSlot(slot, locator);
            }
        }
    }

    return VFALSE;
}
开发者ID:asnwerear,项目名称:VEngine,代码行数:32,代码来源:VLogicModel.cpp

示例6: makeDir

	bool VDirAdapter_Unix::makeDir(const VString &strDir)
	{
        if (strDir.empty() || strDir == "")
            return false;
        
		return (mkdir(strDir.c_str(), S_IRWXU) == 0);
	}
开发者ID:asnwerear,项目名称:Demo,代码行数:7,代码来源:VDirAdapter_Unix.cpp

示例7: _changeAnimation

VBOOL VLogicModel::_changeAnimation(const VString &animName, const Real &delay)
{
    VBOOL result = VFALSE;

    if (animName.empty())
    {
        mCurrentAnimationName = "";
        mCurrentAnimationState = VNULL;
        result = VTRUE;
    }
    else
    {
        try
        {
            if (mSkeletonEntity != VNULL)
            {
                mCurrentAnimationState = _getAnimationState(animName);
                mSkeleton->getAnimation(animName)->setInterpolationMode(VLOGIC_MODEL_MANAGER.getAnimationInterpolationMode());
            }
            else
            {
                Ogre::LogManager::getSingleton().logMessage( "Logic Model : " + mName +
                        " Skeleton Entity is NULL, Maybe the skeleton file is lost!" +
                        "LogicModel::_changeAnimation");
            }
        }
        catch (const Ogre::Exception &e)
        {
            Ogre::LogManager::getSingleton().logMessage("Model : " + mName + '\n' + "_getAnimationState Failed!");
            mCurrentAnimationState = NULL;

            OGRE_EXCEPT(Ogre::Exception::ERR_RT_ASSERTION_FAILED,
                        "Resource was incorrectness due incaution producer. "
                        "Full error description: " + e.getFullDescription(),
                        "LogicModel::_changeAnimation");
        }

        if (mCurrentAnimationState != VNULL)
        {
            mCurrentAnimationState->setEnabled(VTRUE);
            mCurrentAnimationState->setTimePosition(0.0f);
            mCurrentAnimationState->setWeight(1);
            mCurrentAnimationName = animName;
            result = VTRUE;
        }
        else
        {
            mCurrentAnimationName = "";
            result = VFALSE;
        }
    }

    return result;
}
开发者ID:asnwerear,项目名称:VEngine,代码行数:54,代码来源:VLogicModel.cpp

示例8: findFile

    bool VDirAdapter_Unix::findFile(const VString &strPath)
	{
        if (strPath.empty() || strPath == "")
        {
            return false;
        }
        
        extractRoot(strPath, m_strRoot);
        extractExt(strPath, m_strExt);
        m_pDir = opendir(m_strRoot.c_str());
        m_bExtractName = false;
        
		return (m_pDir != NULL);
	}
开发者ID:asnwerear,项目名称:Demo,代码行数:14,代码来源:VDirAdapter_Unix.cpp

示例9: findFile

	bool VDirAdapter::findFile(const VString &strPath)
	{
		if (strPath.empty() || strPath == "")
			return false;

#ifdef UNICODE
		WCHAR wszPath[512] = {0};
		::MultiByteToWideChar(CP_UTF8, 0, strPath.c_str(), strPath.length(), wszPath, sizeof(wszPath));
		m_hFindFile = ::FindFirstFile(wszPath, &m_FindFileData);
#else
		m_hFindFile = ::FindFirstFile(strPath.c_str(), &m_FindFileData);
#endif
		
		extractRoot(strPath, m_strRoot);

		m_bExtractName = false;

		return (m_hFindFile != INVALID_HANDLE_VALUE);
	}
开发者ID:asnwerear,项目名称:Demo,代码行数:19,代码来源:VDirAdapter.cpp

示例10: _setEntityMaterial

VBOOL VLogicModel::_setEntityMaterial(const VString &entityName, const VString &matName)
{
    if (matName.empty())
    {
        return VTRUE;
    }
    else
    {
        VEntityMap::iterator itr = mEntities.find(entityName);

        if (itr == mEntities.end())
        {
            Ogre::LogManager::getSingleton().logMessage( "Logic Model Entity with name '" + entityName + "' dosen't exists! " +
                    "LogicModel::_setEntityMaterial " + mName );
            return VFALSE;
        }

        VEntityValue &entValue = itr->second;
        Ogre::Entity *entity = entValue.mEntity;
        assert(entity);

        if (matName.find(";") != VString::npos)
        {
            Ogre::StringVector matNames = Ogre::StringUtil::split(matName, ";");
            assert(matName.size() > 1);

            for (VUINT32 i = 0; i < entity->getNumSubEntities(); ++i)
            {
                Ogre::SubEntity *subEntity = entity->getSubEntity(i);
                assert(subEntity);

                VString subMatName;

                if (i < matNames.size())
                {
                    subMatName = matNames[i];
                }
                else
                {
                    subMatName = matNames[0];
                }

                const Ogre::MaterialPtr subMat = Ogre::MaterialManager::getSingleton().getByName(subMatName);
                if (!subMat.isNull())
                {
                    subEntity->setMaterialName(subMatName);
                }
            }
        }
        else
        {
            const Ogre::MaterialPtr entityMat = Ogre::MaterialManager::getSingleton().getByName(matName);
            if (!entityMat.isNull())
            {
                entity->setMaterialName(matName);
            }
        }
    }

    return VTRUE;
}
开发者ID:asnwerear,项目名称:VEngine,代码行数:61,代码来源:VLogicModel.cpp


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