當前位置: 首頁>>代碼示例>>C++>>正文


C++ string_t::end方法代碼示例

本文整理匯總了C++中string_t::end方法的典型用法代碼示例。如果您正苦於以下問題:C++ string_t::end方法的具體用法?C++ string_t::end怎麽用?C++ string_t::end使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在string_t的用法示例。


在下文中一共展示了string_t::end方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: IsDashCharacter

bool Parser::IsDashCharacter(const string_t& str) {
  if (str.size() != 1)
    return false;

  auto result = std::find(kDashes.begin(), kDashes.end(), str.front());
  return result != kDashes.end();
}
開發者ID:KasaiDot,項目名稱:anitomy,代碼行數:7,代碼來源:parser_helper.cpp

示例2: GetFileName

	string_t CFileSystem::GetFileName( const string_t& fileName ) {
		string_t::size_type slash1 = fileName.find_last_of( '/' );
		string_t::size_type slash2 = fileName.find_last_of( '\\' );

		if ( slash1 == string_t::npos ) {
			if ( slash2 == string_t::npos) 
				return fileName;
			return string_t( fileName.begin() + slash2 + 1, fileName.end() );
		}

		if ( slash2 == string_t::npos) 
			return string_t( fileName.begin() + slash1 + 1, fileName.end() );

		return string_t( fileName.begin() + ( slash1 > slash2 ? slash1 : slash2 ) + 1, fileName.end() );
	}
開發者ID:romak,項目名稱:rsengine,代碼行數:15,代碼來源:filesystem.cpp

示例3: MatchPartialEpisodePattern

bool Parser::MatchPartialEpisodePattern(const string_t& word, Token& token) {
  auto it = std::find_if_not(word.begin(), word.end(), IsNumericChar);
  auto suffix_length = std::distance(it, word.end());

  auto is_valid_suffix = [](const char_t c) {
    return (c >= L'A' && c <= L'C') ||
           (c >= L'a' && c <= L'c');
  };

  if (suffix_length == 1 && is_valid_suffix(*it))
    if (SetEpisodeNumber(word, token, true))
      return true;

  return false;
}
開發者ID:KasaiDot,項目名稱:anitomy,代碼行數:15,代碼來源:parser_number.cpp

示例4: containsKeyword

    bool containsKeyword (string_t keyword, value_t& value)
    {
        typename Entry::childen_t::iterator current;
        typename Entry::childen_t::iterator next;

        current = mRoot.mChildren.find (std::tolower (*keyword.begin(), mLocale));
        if (current == mRoot.mChildren.end())
            return false;
        else if (current->second.mKeyword.size() && Misc::StringUtils::ciEqual(current->second.mKeyword, keyword))
        {
            value = current->second.mValue;
            return true;
        }

        for (Point i = ++keyword.begin(); i != keyword.end(); ++i)
        {
            next = current->second.mChildren.find(std::tolower (*i, mLocale));
            if (next == current->second.mChildren.end())
                return false;
            if (Misc::StringUtils::ciEqual(next->second.mKeyword, keyword))
            {
                value = next->second.mValue;
                return true;
            }
            current = next;
        }
        return false;
    }
開發者ID:Adrian-Revk,項目名稱:openmw,代碼行數:28,代碼來源:keywordsearch.hpp

示例5: splitComment

bool MusicDecoder::splitComment(
    const char* comment,
    unsigned int size,
    string_t& field,
    string_t& value)
{
#ifdef STRING_T_IS_SF_STRING
  sf::String str=sf::String::fromUtf8(comment, &(comment[size]));
  size_t split=str.find(sf::String("="));
  if (split==sf::String::InvalidPos){
    return false;
  } else {
    field=str.substring(0,split);
    value=str.substring(split+1);
    sf::String::Iterator it;
    for (it=field.begin(); it !=field.end(); it++)
    {
      *it=toupper(*it);
    }

    //std::cout << "field " << field.toAnsiString() << "=" << value.toAnsiString() << std::endl;
    return true;
  }
#else
  return false;
#endif
}
開發者ID:lamogui,項目名稱:libtools,代碼行數:27,代碼來源:decoder.cpp

示例6: TokenizeByDelimiters

void Tokenizer::TokenizeByDelimiters(bool enclosed, const TokenRange& range) {
  const string_t delimiters = GetDelimiters(range);

  if (delimiters.empty()) {
    AddToken(kUnknown, enclosed, range);
    return;
  }

  auto char_begin = filename_.begin() + range.offset;
  const auto char_end = char_begin + range.size;
  auto current_char = char_begin;

  while (current_char != char_end) {
    current_char = std::find_first_of(current_char, char_end,
                                      delimiters.begin(), delimiters.end());

    const TokenRange subrange(std::distance(filename_.begin(), char_begin),
                              std::distance(char_begin, current_char));

    if (subrange.size > 0)  // Found unknown token
      AddToken(kUnknown, enclosed, subrange);

    if (current_char != char_end) {  // Found delimiter
      AddToken(kDelimiter, enclosed,
               TokenRange(subrange.offset + subrange.size, 1));
      char_begin = ++current_char;
    }
  }

  ValidateDelimiterTokens();
}
開發者ID:arkenthera,項目名稱:anitomy,代碼行數:31,代碼來源:tokenizer.cpp

示例7: GetFileExtension

	string_t CFileSystem::GetFileExtension( const string_t& fileName ) {
		string_t::size_type dot = fileName.find_last_of( '.' );

		if ( dot == std::string::npos) 
			return string_t( "" );

		return string_t( fileName.begin() + dot + 1, fileName.end() );
	}
開發者ID:romak,項目名稱:rsengine,代碼行數:8,代碼來源:filesystem.cpp

示例8: string_to_real_cast

	real_t string_to_real_cast(string_t const& str)
	{
		typedef boost::spirit::qi::real_parser<real_t, boost::spirit::qi::real_policies<real_t>> real_parser_t;

		real_t value(0.);

		if (!boost::spirit::qi::parse(str.begin(), str.end(), real_parser_t(), value))
			_cast_is_failed(str);

		return value;
	}
開發者ID:AntonPoturaev,項目名稱:CalculateMathExpression,代碼行數:11,代碼來源:string_to_real_cast.cpp

示例9: dirname

string_t dirname(string_t source)
{
    if (source.size() <= 1) //Make sure it's possible to check the last character.
    {
        return source;
    }
    if (*(source.rbegin() + 1) == '/') //Remove trailing slash if it exists.
    {
		source = source.substr(0, source.size() - 1);
    }
    source.erase(std::find(source.rbegin(), source.rend(), '/').base(), source.end());
    return source;
}
開發者ID:tyrel,項目名稱:DCPUToolchain,代碼行數:13,代碼來源:Main.cpp

示例10: assemble_sheet

void assemble_sheet(const string_t&         sheet_name,
                    const sheet_assembly_t& assembly,
                    std::ostream&           out)
{
    string_t              washed_sheet_name;
    adam_node_formatter_t formatter;

    for (string_t::const_iterator first(sheet_name.begin()), last(sheet_name.end()); first != last; ++first)
        washed_sheet_name.push_back(std::isalpha(*first) ? *first : '_');

    out << "sheet " << washed_sheet_name.c_str() << "\n{";

    for_each(assembly, boost::bind(&adam_node_formatter_t::format_node,
                                   boost::ref(formatter), _1, boost::ref(out)));

    out << "}" << std::endl;
}
開發者ID:stlab,項目名稱:adobe_platform_libraries,代碼行數:17,代碼來源:property_model_formatter.cpp

示例11: IsValidString

bool Square::IsValidString(const string_t & str)
{
    if (str == Black)
        return true;

#if PUZ_UNICODE
    std::wstring::const_iterator begin = str.begin();
    std::wstring::const_iterator end   = str.end();
#else
    std::wstring unicode = to_unicode(str);
    std::wstring::const_iterator begin = unicode.begin();
    std::wstring::const_iterator end   = unicode.end();
#endif // PUZ_UNICODE

    std::wstring::const_iterator it;
    for (it = begin; it != end; ++it)
        if (! IsValidChar(*it))
            return false;
    return true;
}
開發者ID:mattprintz,項目名稱:wx-xword,代碼行數:20,代碼來源:Square.cpp

示例12: ToGrid

string_t Square::ToGrid(const string_t & str)
{
#ifdef PUZ_CHECK_STRINGS
    if (str.length() > REBUS_ENTRY_LENGTH)
        throw LongString();
#endif 
    string_t ret;
    string_t::const_iterator it;
    for (it = str.begin(); it != str.end(); ++it)
    {
        char_t ch = ToGrid(*it);
        if (ch != 0)
            ret.append(1, ch);
#ifdef PUZ_CHECK_STRINGS
        else
            throw InvalidString();
#endif
    }
    return ret;
}
開發者ID:mattprintz,項目名稱:wx-xword,代碼行數:20,代碼來源:Square.cpp

示例13: FindNumberInString

 size_t Parser::FindNumberInString(const string_t& str)
 {
     auto it = std::find_if(str.begin(), str.end(), IsNumericChar);
     return it == str.end() ? str.npos : (it - str.begin());
 }
開發者ID:Soinou,項目名稱:MeliMelo,代碼行數:5,代碼來源:parser_helper.cpp


注:本文中的string_t::end方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。