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


C++ cstring::size方法代码示例

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


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

示例1: while

void
config_file_iterator::Impl::substitute_macros( cstring& where )
{
    m_post_subst_line.clear();
    cstring::size_type pos;

    while( (pos = where.find( m_macro_ref_begin )) != cstring::npos ) {
        m_post_subst_line.append( where.begin(), pos );

        where.trim_left( where.begin() + pos + m_macro_ref_begin.size() );

        pos = where.find( m_macro_ref_end );

        BOOST_RT_PARAM_VALIDATE_LOGIC( pos != cstring::npos, BOOST_RT_PARAM_LITERAL( "incomplete macro reference" ) );

        cstring value = *get_macro_value( where.substr( 0, pos ), false );
        m_post_subst_line.append( value.begin(), value.size() );

        where.trim_left( where.begin() + pos + m_macro_ref_end.size() );
    }

    if( !m_post_subst_line.empty() ) {
        m_post_subst_line.append( where.begin(), where.size() );
        where = m_post_subst_line;
    }
}
开发者ID:esoobservatory,项目名称:fitsliberator,代码行数:26,代码来源:config_file_iterator.cpp

示例2: translateRk86

string translateRk86(cstring in) {
  string out;
  out.resize(in.size());
  const char* inp = in.c_str();
  char* o = (char*)out.c_str();
  while(*inp) {
    char c = translateRk86c(*inp++);
    if(c==0) raise("Имя файла "+in+" содержит неподдерживаемый РК86 символ.");
    *o++ = c;
  }
  return out;
}
开发者ID:VWarlock,项目名称:Apogey_BK01_Rom_Disk,代码行数:12,代码来源:translaterk86.cpp

示例3: newName

cstring ReferenceMap::newName(cstring base) {
    // Maybe in the future we'll maintain information with per-scope identifiers,
    // but today we are content to generate globally-unique identifiers.

    // If base has a suffix of the form _(\d+), then we discard the suffix.
    // under the assumption that it is probably a generated suffix.
    // This will not impact correctness.
    unsigned len = base.size();
    const char digits[] = "0123456789";
    const char* s = base.c_str();
    while (len > 0 && strchr(digits, s[len-1])) len--;
    if (len > 0 && base[len - 1] == '_')
        base = base.substr(0, len - 1);

    cstring name = cstring::make_unique(usedNames, base, '_');
    usedNames.insert(name);
    return name;
}
开发者ID:ederollora,项目名称:p4c,代码行数:18,代码来源:referenceMap.cpp

示例4:

 static bool         match_back( cstring str, cstring pattern )
 {
     return str.size() >= pattern.size() && str.substr( str.size() - pattern.size() ) == pattern;
 }
开发者ID:esoobservatory,项目名称:fitsliberator,代码行数:4,代码来源:config_file_iterator.cpp

示例5: dstring

 // Constructor // !! could we eliminate shared_ptr
 explicit    logic_error( cstring msg ) : m_msg( new dstring( msg.begin(), msg.size() ) ) {}
开发者ID:edwardotis,项目名称:hivm,代码行数:2,代码来源:validation.hpp

示例6: interpret

 std::string interpret( cstring, cstring source ) const
 {
     return std::string( source.begin(), source.size() );
 }
开发者ID:betajippity,项目名称:Nuparu,代码行数:4,代码来源:argument_factory.hpp


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