本文整理汇总了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());
}
}
示例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 );
}
}
}
示例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;
}
示例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();
}
示例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));
}
}
示例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;
}
示例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;
}
示例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;
}