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


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

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


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

示例1: cstring

include_level::include_level( cstring file_name, cstring path_separators, include_level* parent_ )
    : m_parent( parent_ )
{
    if( file_name.is_empty() )
        return;

    assign_op( m_curr_location.first, file_name, 0 );
    m_curr_location.second = 0;

    m_stream.open( m_curr_location.first.c_str() );

    if( !m_stream.is_open() && !!m_parent.get() ) {
        cstring            parent_path = m_parent->m_curr_location.first;
        cstring::iterator  it          = unit_test::find_last_of( parent_path.begin(), parent_path.end(),
                                         path_separators.begin(),
                                         path_separators.end() );

        if( it != parent_path.end() ) {
            assign_op( m_curr_location.first, cstring( parent_path.begin(), it+1 ), 0 );
            m_curr_location.first.append( file_name.begin(), file_name.end() );
            m_stream.clear();
            m_stream.open( m_curr_location.first.c_str() );
        }
    }

    BOOST_RT_PARAM_VALIDATE_LOGIC( m_stream.is_open(), BOOST_RT_PARAM_LITERAL( "couldn't open file " ) << file_name );
}
开发者ID:esoobservatory,项目名称:fitsliberator,代码行数:27,代码来源:config_file_iterator.cpp

示例2:

 basic_param( cstring name, bool is_optional, bool is_repeatable, Modifiers const& m )
 : p_name( name.begin(), name.end() )
 , p_description( nfp::opt_get( m, description, std::string() ) )
 , p_help( nfp::opt_get( m, runtime::help, std::string() ) )
 , p_env_var( nfp::opt_get( m, env_var, std::string() ) )
 , p_value_hint( nfp::opt_get( m, value_hint, std::string() ) )
 , p_optional( is_optional )
 , p_repeatable( is_repeatable )
 , p_has_optional_value( m.has( optional_value ) )
 , p_has_default_value( m.has( default_value ) || is_repeatable )
 , p_callback( nfp::opt_get( m, callback, callback_type() ) )
 {
     add_cla_id( help_prefix, name, ":" );
 }
开发者ID:betajippity,项目名称:Nuparu,代码行数:14,代码来源:parameter.hpp

示例3: while

static bool
is_valid_identifier( cstring const& source )
{
    if( source.is_empty() )
        return false;

    cstring::const_iterator it = source.begin();

    if( !std::isalpha( *it ) )
        return false;

    while( ++it < source.end() ) {
        if( !std::isalnum( *it ) && *it != BOOST_RT_PARAM_LITERAL( '_' ) && *it != BOOST_RT_PARAM_LITERAL( '-' ) )
            return false;
    }

    return true;
}
开发者ID:esoobservatory,项目名称:fitsliberator,代码行数:18,代码来源:config_file_iterator.cpp

示例4: while

inline bool
interpret_argument_value( cstring source, hexerboost::optional<std::list<T> >& res, int )
{
    BOOST_RT_PARAM_TRACE( "In interpret_argument_value<std::list<T>>" );

    res = std::list<T>();

    while( !source.is_empty() ) {
        // !! should we use token_iterator
        cstring::iterator single_value_end = std::find( source.begin(), source.end(), BOOST_RT_PARAM_LITERAL( ',' ) );

        hexerboost::optional<T> value;
        interpret_argument_value( cstring( source.begin(), single_value_end ), value, 0 );

        res->push_back( *value );

        source.trim_left( single_value_end + 1 );
    }

    return true;
}
开发者ID:gijs,项目名称:hexer,代码行数:21,代码来源:interpret_argument_value.hpp


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