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


C++ ErrorMessage::toText方法代码示例

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


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

示例1: include

 void include()
 {
     ErrorLogger::ErrorMessage errmsg;
     ErrorLogger::ErrorMessage::FileLocation loc;
     loc.file = "ab/cd/../ef.h";
     errmsg._callStack.push_back(loc);
     ASSERT_EQUALS("<error file=\"ab/ef.h\" line=\"0\" id=\"\" severity=\"\" msg=\"\"/>", errmsg.toXML());
     ASSERT_EQUALS("[ab/ef.h:0]: ", errmsg.toText());
 }
开发者ID:gscacco,项目名称:cppcheck,代码行数:9,代码来源:testcppcheck.cpp

示例2: handleRead

bool ThreadExecutor::handleRead(unsigned int &result)
{
    char type = 0;
    if (read(_pipe[0], &type, 1) <= 0)
    {
        return false;
    }

    if (type != '1' && type != '2' && type != '3')
    {
        std::cerr << "#### You found a bug from cppcheck.\nThreadExecutor::handleRead error, type was:" << type << std::endl;
        exit(0);
    }

    unsigned int len = 0;
    if (read(_pipe[0], &len, sizeof(len)) <= 0)
    {
        std::cerr << "#### You found a bug from cppcheck.\nThreadExecutor::handleRead error, type was:" << type << std::endl;
        exit(0);
    }

    char *buf = new char[len];
    if (read(_pipe[0], buf, len) <= 0)
    {
        std::cerr << "#### You found a bug from cppcheck.\nThreadExecutor::handleRead error, type was:" << type << std::endl;
        exit(0);
    }

    if (type == '1')
    {
        _errorLogger.reportOut(buf);
    }
    else if (type == '2')
    {
        ErrorLogger::ErrorMessage msg;
        msg.deserialize(buf);

        // Alert only about unique errors
        std::string errmsg = msg.toText();
        if (std::find(_errorList.begin(), _errorList.end(), errmsg) == _errorList.end())
        {
            _errorList.push_back(errmsg);
            _errorLogger.reportErr(msg);
        }
    }
    else if (type == '3')
    {
        _fileCount++;
        std::istringstream iss(buf);
        unsigned int fileResult = 0;
        iss >> fileResult;
        result += fileResult;
        _errorLogger.reportStatus(_fileCount, _filenames.size());
    }
开发者ID:RVictor,项目名称:EmbeddedLite,代码行数:54,代码来源:threadexecutor.cpp

示例3: reportErr

void CppCheckExecutor::reportErr(const ErrorLogger::ErrorMessage &msg)
{
    if (_settings._xml)
    {
        reportErr(msg.toXML());
    }
    else
    {
        reportErr(msg.toText());
    }
}
开发者ID:gscacco,项目名称:cppcheck,代码行数:11,代码来源:cppcheckexecutor.cpp

示例4: reportErr

void TestFixture::reportErr(const ErrorLogger::ErrorMessage &msg)
{
    errout << msg.toText() << std::endl;
}
开发者ID:gscacco,项目名称:cppcheck,代码行数:4,代码来源:testsuite.cpp


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