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


C++ Errors::nbErrors方法代码示例

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


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

示例1: printErrors

void Reporter::printErrors(std::ostream& os, Errors& errors, const int verbose)
{
    StrStream strstream;    
    strstream << "Summary:";
    
    // Parsing (not really errors)
    if (unlikely(errors.commentedLines))
    {
        strstream << "\n [" << errors.commentedLines << "] commented lines";
    }
    if (unlikely(errors.blankLines))
    {
        strstream << "\n [" << errors.blankLines << "] blank lines";
    }
    
    auto nbErrors = errors.nbErrors();
    if (unlikely(nbErrors > 0))
    {
        strstream << "\nFound " << nbErrors << " error:";
        
        // Parsing
        if (unlikely(errors.corruptedMessages))
        {
            strstream << "\n [" << errors.corruptedMessages << "] corrupted messages";
        }
        if (unlikely(errors.IncompleteMessages))
        {
            strstream << "\n [" << errors.IncompleteMessages << "] incomplete messages";
        }
        if (unlikely(errors.wrongActions))
        {
            strstream << "\n [" << errors.wrongActions << "] wrong actions";
        }
        if (unlikely(errors.wrongSides))
        {
            strstream << "\n [" << errors.wrongSides << "] wrong sides";
        }
        if (unlikely(errors.negativeOrderIds))
        {
            strstream << "\n [" << errors.negativeOrderIds << "] negative orderIds";
        }
        if (unlikely(errors.negativeQuantities))
        {
            strstream << "\n [" << errors.negativeQuantities << "] negative quantities";
        }
        if (unlikely(errors.negativePrices))
        {
            strstream << "\n [" << errors.negativePrices << "] negative prices";
        }
        if (unlikely(errors.missingActions))
        {
            strstream << "\n [" << errors.missingActions << "] missing actions";
        }
        if (unlikely(errors.missingOrderIds))
        {
            strstream << "\n [" << errors.missingOrderIds << "] missing orderIds";
        }
        if (unlikely(errors.missingSides))
        {
            strstream << "\n [" << errors.missingSides << "] missing sides";
        }
        if (unlikely(errors.missingQuantities))
        {
            strstream << "\n [" << errors.missingQuantities << "] missing quantities";
        }
        if (unlikely(errors.missingPrices))
        {
            strstream << "\n [" << errors.missingPrices << "] missing prices";
        }
        if (unlikely(errors.zeroOrderIds))
        {
            strstream << "\n [" << errors.zeroOrderIds << "] zero orderIds";
        }
        if (unlikely(errors.zeroQuantities))
        {
            strstream << "\n [" << errors.zeroQuantities << "] zero quantities";
        }
        if (unlikely(errors.zeroPrices))
        {
            strstream << "\n [" << errors.zeroPrices << "] zero prices";
        }
        if (unlikely(errors.outOfBoundsOrderIds))
        {
            strstream << "\n [" << errors.outOfBoundsOrderIds << "] out of bounds orderIds";
        }
        if (unlikely(errors.outOfBoundsQuantities))
        {
            strstream << "\n [" << errors.outOfBoundsQuantities << "] out of bounds quantities";
        }
        if (unlikely(errors.outOfBoundsPrices))
        {
            strstream << "\n [" << errors.outOfBoundsPrices << "] out of bounds prices";
        }
        
        // Order Management
        if (unlikely(errors.duplicateOrderIds))
        {
            strstream << "\n [" << errors.duplicateOrderIds << "] duplicate OrderIds";
        }
        if (unlikely(errors.modifiesWithUnknownOrderId))
//.........这里部分代码省略.........
开发者ID:bgn9000,项目名称:Cpp1y-OrderBook,代码行数:101,代码来源:Reporter.cpp


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