本文整理汇总了C++中ogre::String::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ String::push_back方法的具体用法?C++ String::push_back怎么用?C++ String::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::String
的用法示例。
在下文中一共展示了String::push_back方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setupResources
//-------------------------------------------------------------------------------------
void BaseApplication::setupResources(void)
{
// Load resource paths from config file
Ogre::ConfigFile cf;
cf.load(mResourcesCfg);
// Go through all sections & settings in the file
Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
#if (OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS)
Ogre::String bunPath = Ogre::macBundlePath() ;
bunPath.push_back( '/' ) ;
#endif
Ogre::String secName, typeName, archName;
while (seci.hasMoreElements())
{
secName = seci.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
Ogre::ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i)
{
typeName = i->first;
#if (OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS)
archName = bunPath + i->second;
#else
archName = i->second;
#endif
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
archName, typeName, secName);
}
}
}
示例2: position
//.........这里部分代码省略.........
}
else // if quote is open already
{
// check if it is the matching character to close it
if(current_quote == ch)
{
// close quote and reset the quote character
quoted = false;
current_quote = 0;
// don't add the quote-char to the token
add_char = false;
}
}
}
}
// if the delimiter isn't preserved
if(delimiters.empty() == false && escaped == false && quoted == false)
{
// if a delimiter is provided and the char isn't protected by
// quote or escape char
if(delimiters.find_first_of(ch) != std::string::npos)
{
// if ch is a delimiter and the token string isn't empty
// the token is complete
if(token.empty() == false)
{
token_complete = true;
}
// don't add the delimiter to the token
add_char = false;
}
}
// if the delimiter is preserved - add it as a token
bool add_delimiter = false;
if(delimiters_preserve.empty() == false && escaped == false && quoted == false)
{
// if a delimiter which will be preserved is provided and the
// char isn't protected by quote or escape char
if(delimiters_preserve.find_first_of(ch) != std::string::npos)
{
// if ch is a delimiter and the token string isn't empty the token is complete
if(token.empty() == false)
{
token_complete = true;
}
// don't add the delimiter to the token
add_char = false;
// add the delimiter
delimiter = ch;
add_delimiter = true;
}
}
// add the character to the token
if(add_char == true)
{
// add the current char
token.push_back(ch);
}
// add the token if it is complete
if(token_complete == true && token.empty() == false)
{
// add the token string
ret.push_back(token);
// clear the contents
token.clear();
// build the next token
token_complete = false;
}
// add the delimiter
if(add_delimiter == true)
{
// the next token is the delimiter
Ogre::String delim_token;
delim_token.push_back(delimiter);
ret.push_back(delim_token);
}
// repeat for the next character
++pos;
}
// add the final token
if(token.empty() == false)
{
ret.push_back(token);
}
return ret;
}