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


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

本文整理汇总了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);
        }
    }
}
开发者ID:DuncanSungWKim,项目名称:OgreAssistKit,代码行数:33,代码来源:BaseApplication.cpp

示例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;
}
开发者ID:adrielvel,项目名称:q-gears,代码行数:101,代码来源:Utilites.cpp


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