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


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

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


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

示例1: executeScriptFile

void CLuaManager::executeScriptFile(const CEGUI::String& filename, const CEGUI::String& resourceGroup)
{
    // load file
    CEGUI::RawDataContainer raw;
    CEGUI::System::getSingleton().getResourceProvider()->loadRawDataContainer(filename,
          raw, resourceGroup.empty() ? d_defaultResourceGroup : resourceGroup);

    // load code into lua
    int loaderr = luaL_loadbuffer(m_luaVM, (char*)raw.getDataPtr(), raw.getSize(), filename.c_str());
    CEGUI::System::getSingleton().getResourceProvider()->unloadRawDataContainer(raw);

    // call it
    if (loaderr==0) { // run the file
        int result = lua_pcall(m_luaVM,0,0,0);
        switch (result) {
            case LUA_ERRRUN:
                CLog::getInstance()->error("Runtime error in %s", filename.c_str());
                break;
            case LUA_ERRMEM:
                CLog::getInstance()->error("Memory alocation error in %s", filename.c_str());
                break;
            case LUA_ERRERR:
                CLog::getInstance()->error("Error handler error in %s", filename.c_str());
                break;
            default:
                break;
        }
    } else {
        CLog::getInstance()->error("Unable to load %s", filename.c_str());
    }
}
开发者ID:dividio,项目名称:projectfootball,代码行数:31,代码来源:CLuaManager.cpp

示例2: memBuffer

void
VfsResourceProvider::loadRawDataContainer( const CEGUI::String& filename      , 
                                           CEGUI::RawDataContainer& output    , 
                                           const CEGUI::String& resourceGroup )
{GUCEF_TRACE;
    
    // everything in CEGUI works based on resource groups
    // make sure we dont use an empty one
    const CEGUI::String* rscGroup = &resourceGroup;
    if ( resourceGroup.empty() )
    {
        rscGroup = &m_defaultResourceGroup;
    }

    CORE::CString filePath;
    CORE::CString fileName = filename;
    TCEStringMap::iterator i = m_groupMap.find( *rscGroup );
    if ( i != m_groupMap.end() )
    {
        filePath = (*i).second;
    }

    filePath = CORE::CombinePath( filePath, fileName );

    VFS::CVFS& vfs = VFS::CVfsGlobal::Instance()->GetVfs();

    VFS::CVFS::CVFSHandlePtr file = vfs.GetFile( filePath, "rb", false );
    if ( !file.IsNULL() )
    {
        CORE::CIOAccess* fileAccess = file->GetAccess();
        if ( NULL != fileAccess )
        {
            CORE::CDynamicBuffer memBuffer( *fileAccess );
             
            void* buffer = NULL;
            UInt32 dataSize = 0; 
            memBuffer.RelinquishDataOwnership( buffer, dataSize );

            output.setData( (CEGUI::uint8*) buffer );
            output.setSize( dataSize );

            DataContainerInfoPtr info = new TDataContainerInfo;
            info->fileHandle = file;
            info->requestFilename = fileName;
            info->requestresourceGroup = resourceGroup;
            info->ceContainer = output;

            m_containerMap[ buffer ] = info;
        }
        else
        {
            GUCEF_ERROR_LOG( CORE::LOGLEVEL_NORMAL, "VfsResourceProvider:loadRawDataContainer: Unable to load resource from path: " + filePath );
        } 
    }
}
开发者ID:LiberatorUSA,项目名称:GUCEF,代码行数:55,代码来源:guidriverCEGUI_VFSResourceProvider.cpp

示例3: callbackProperty

bool CUIWindowItem::callbackProperty(CEGUI::Window* window, CEGUI::String& propname, CEGUI::String& propvalue, void* userdata)
{
	if(propname == (CEGUI::utf8*)"Text" && !propvalue.empty())
	{
		//字符串转化
		CEGUI::String32 strUtf32;

		STRING strMbcs;
		CUIStringSystem::utf8_to_mbcs(STRING(propvalue.c_str()), strMbcs);
		CUIStringSystem::GetMe()->ParserString_Runtime(strMbcs, strUtf32);
		propvalue = strUtf32.c_str();
	}

	return true;
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:15,代码来源:UIWindowMng.cpp

示例4: getDefaultResourceGroupRelativePath

//-----------------------------------------------------------------------
wxString EditorDocument::getDefaultResourceGroupRelativePath( const wxString& filename ) const
{
    wxString resourcePath( wxT( "./" ) );
    wxFileName filespec( filename );

    CEGUI::DefaultResourceProvider* rp =
        static_cast<CEGUI::DefaultResourceProvider*>(
            CEGUI::System::getSingleton().getResourceProvider() );

    CEGUI::String defResGrp = rp->getDefaultResourceGroup();

    if ( !defResGrp.empty() )
        resourcePath = CEGUIHelper::ToWXString(
            rp->getResourceGroupDirectory( defResGrp ) );

    filespec.MakeRelativeTo( resourcePath );
    return filespec.GetFullPath();
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:19,代码来源:EditorDocument.cpp

示例5: _TransWindowText

VOID CUIWindowItem::_TransWindowText(CEGUI::Window* pWindow)
{
	CEGUI::String str = pWindow->getTextOriginal();
	if(!str.empty())
	{
		STRING strMBCS_ToTrans;
		CUIStringSystem::utf8_to_mbcs(str.c_str(), strMBCS_ToTrans);

		// 经过special转化的string,已经是utf32格式。
		CEGUI::String strMBCS_Transed_Done;

		CUIStringSystem::GetMe()->ParserString_Runtime(strMBCS_ToTrans, strMBCS_Transed_Done);

		pWindow->setText(strMBCS_Transed_Done);
	}
	//Register Child
	for(INT i=0; i<(INT)pWindow->getChildCount(); i++)
	{
		_TransWindowText(pWindow->getChildAtIdx(i));
	}
}
开发者ID:viticm,项目名称:pap_wclinet,代码行数:21,代码来源:UIWindowMng.cpp

示例6: textAccepted

bool Dan::textAccepted(const CEGUI::EventArgs&) 
{
	CEGUI::String text = CEGUI::WindowManager::getSingleton().getWindow("Dan/Bg/Text/Putin")->getText();
	
	std::cout<<CEGUI::WindowManager::getSingleton().getWindow("Dan/Bg/Text/Putin")->getText()<<std::endl;
	std::cout<<CEGUI::WindowManager::getSingleton().getWindow("Dan/Bg/Text/Putin")->getText().size()<<std::endl;
	if(text.empty())
		return true;
	if(text.size() != 9)
	{
		_time = 1.0f;
		CEGUI::WindowManager::getSingleton().getWindow("Dan/Bg/Text/W")->setProperty("Image","set:UI4 image:w1");
		
	}else
	{	
		if(_callback)
			_callback->uploadPassword(Ogre::StringConverter::parseInt(text.c_str()));
	}
	CEGUI::WindowManager::getSingleton().getWindow("Dan/Bg/Text/Putin")->setText("");
	return true;
}
开发者ID:dbabox,项目名称:aomi,代码行数:21,代码来源:Dan.cpp

示例7: while

const CEGUI::String&
ImageCodecAdapter::getSupportedFormat() const
{GUCEF_TRACE;

    IMAGE::CImageCodecRegistry& codecRegistry = IMAGE::CImageGlobal::Instance()->GetImageCodecRegistry();
    
    IMAGE::CImageCodecRegistry::TStringList codecList;
    codecRegistry.GetList( codecList );
    
    static CEGUI::String formatStr;

    formatStr.clear();
    IMAGE::CImageCodecRegistry::TStringList::iterator i = codecList.begin();
    while ( i != codecList.end() )
    {
        if ( !formatStr.empty() )
            formatStr += " ";
        formatStr += (*i).STL_String();
        ++i;
    }
    return formatStr;
}
开发者ID:LiberatorUSA,项目名称:GUCEF,代码行数:22,代码来源:guidriverCEGUI_ImageCodecAdapter.cpp

示例8: textAccepted

bool Dan::textAccepted(const CEGUI::EventArgs&) 
{
	if(!check())
		return false;
	
	CodingFormatInterface * format = _coding->queryInterface<CodingFormatInterface>();
	CEGUI::String text = CEGUI::WindowManager::getSingleton().getWindow("Dan/Bg/Text/Putin")->getText();

	if(text.empty())
		return true;
	if(text.size() <= 9)
	{
		this->warning(L"输入未满9位");

	}else
	{	
		format->clear();
		LockInterface * lock = _dataServer->queryInterface<LockInterface>();
		DataServerInterface * data = _dataServer->queryInterface<DataServerInterface>();

		std::string code = lock->getLockCode2();
		format->decode10(code, 60);
		unsigned int oCheck = format->getCheck8(60);


		if(data->loadCodingData())
		{

			CodingFormatInterface * lockData = _dataServer->queryInterface<CodingFormatInterface>();
			unsigned int oId = lockData->getLockID();
			if(format->decode10(std::string(text.c_str()),28))
			{
				if(format->getBackCheck() != oCheck ||format->getBackID() != (oId%128))
				{
					warning(L"开机码和报账码不匹配,请重新报账");
				}else
				{
					lockData->setLockLeavings(format->getBackLeavingsIndex());
					data->saveCodingData();
					unsigned int index = format->getBackLeavingsIndex();
					unsigned int profits = format->index2Profits(index);
					unsigned int levings = data->getLevingsProfits();

					data->setLevingsProfits(levings + profits);
					data->cleanCostBackTimeCode2();
					data->save();
					if(check())
					{
						warning(L"报账成功");
					}
				}

			}
			else
			{
				warning(L"无效开机码");
			}
		}else
			{
				warning(L"内部数据错误,请联系开发商!");
			}
	
	}
	CEGUI::WindowManager::getSingleton().getWindow("Dan/Bg/Text/Putin")->setText("");
	return true;
}
开发者ID:dbabox,项目名称:aomi,代码行数:66,代码来源:Dan.cpp


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