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


C++ const_string::begin方法代码示例

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


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

示例1:

	void    log_exception( std::ostream&, log_checkpoint_data const& cpd, const_string explanation )
	{
		if( cpd.m_line_num >= 0 )
		{
			char writeBuffer[1024];
			sprintf( writeBuffer, "%d,%s,%s", cpd.m_line_num, cpd.m_file_name.begin(), explanation.begin() );
			DWORD dwWrite;
			if( WriteFile( m_WritePipe, writeBuffer, 1024, &dwWrite, NULL ) == false || dwWrite != 1024 )
				ExitProcess(-1);
		}
	}
开发者ID:rameshnadarajan,项目名称:vutpp,代码行数:11,代码来源:VUTPPBind.cpp

示例2: if

    void            setup( const const_string& stream_name )
    {
        if(stream_name.empty())
            return;

        if( stream_name == "stderr" )
            m_stream = &std::cerr;
        else if( stream_name == "stdout" )
            m_stream = &std::cout;
        else {
            m_file = boost::make_shared<std::ofstream>();
            m_file->open( std::string(stream_name.begin(), stream_name.end()).c_str() );
            m_stream = m_file.get();
        }
    }
开发者ID:AbhinavJain13,项目名称:turicreate,代码行数:15,代码来源:unit_test_parameters.hpp

示例3: ag

EXPORT_C void
exception_safety_tester::exception_point( const_string file, std::size_t line_num, const_string description )
{
    activity_guard ag( m_internal_activity );

    if( ++m_exception_point_counter == m_forced_exception_point ) {
        m_execution_path.push_back(
            execution_path_point( EPP_EXCEPT, file, line_num ) );

        m_execution_path.back().m_except.description = description.begin();

        ++m_exec_path_point;

        failure_point();
    }
}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:16,代码来源:exception_safety.cpp

示例4: to_int

IntType to_int(const const_string & input)
{
    const char * m_firstc = input.begin();
    const char * m_lastc = input.end() - 1;
    
    //TODO replace with a pow metafunction, if that's possible
    static IntType max_placeval = static_cast<IntType>(pow(10,std::numeric_limits<IntType>::digits10));
    static IntType highest_digit = std::numeric_limits<IntType>::max() / max_placeval;
    
    IntType result = 0;
    IntType placeval = 1;
    
    bool signed_ = std::numeric_limits<IntType>::is_signed;
    bool minus = signed_ && *m_firstc == '-';
    const_string::const_iterator firstc = m_firstc + minus;
    
    for(const_string::const_iterator i = m_lastc; i >= firstc; --i)
    {
        char c = i[0];
        bool last = i == firstc;
        
        if(c < '0' || c > '9') throw std::bad_cast();
        
        IntType digit = c - '0';
        if(placeval == max_placeval && digit > highest_digit) throw std::bad_cast();
        IntType tmp = placeval * digit;
        
        if( tmp > std::numeric_limits<IntType>::max() - result ) 
            throw std::bad_cast();
        result += tmp;
        
        if(placeval == max_placeval && !last) throw std::bad_cast();
        placeval *= 10;
    }
    
    if(minus) result = -result;
    
    return result;
}
开发者ID:Gleuwuzah,项目名称:server-v4,代码行数:39,代码来源:convert.hpp

示例5:

 setup_error( const_string m ) : std::runtime_error( std::string( m.begin(), m.size() ) ) {}
开发者ID:AlexS2172,项目名称:IVRM,代码行数:1,代码来源:framework.hpp

示例6: Player

 Player(const_string n, PlayerID i, std::unique_ptr<Controller> c)
     : name(n.begin(), n.end()), id(i), controller(std::move(c))
 {}
开发者ID:o11c,项目名称:epoll,代码行数:3,代码来源:conquest.hpp

示例7: normalize_test_case_name

 std::string normalize_test_case_name(const_string name) {
     return ( name[0] == '&' ? std::string(name.begin()+1, name.size()-1) : std::string(name.begin(), name.size() )); }}}}
开发者ID:MarisaKirisame,项目名称:first_order_logic_prover,代码行数:2,代码来源:main.cpp


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