view extern/vera/src/plugins/Reports.h @ 680:900ca2f95838

Irccd: do not allow multiple server with same name
author David Demelier <markand@malikania.fr>
date Thu, 12 Apr 2018 20:45:02 +0200
parents a7c0eb100760
children
line wrap: on
line source

//
// Copyright (C) 2006-2007 Maciej Sobczak
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef REPORTS_H_INCLUDED
#define REPORTS_H_INCLUDED

#include "Reports.h"
#include <string>
#include <ostream>


namespace Vera
{
namespace Plugins
{


class Reports
{
public:
    typedef std::string FileName;
    typedef std::string Message;

    static void setShowRules(bool show);
    static void setVCFormat(bool vc);
    static void setXMLReport(bool xmlReport);
    static void setPrefix(std::string prefix);

    static int count();

    static void add(const FileName & name, int lineNumber, const Message & msg);
    static void internal(const FileName & name, int lineNumber,
      const Message & msg);

    static void dumpAll(std::ostream & os, bool omitDuplicates);

    static void writeStd(std::ostream & os, bool omitDuplicates);
    static void writeVc(std::ostream & os, bool omitDuplicates);
    static void writeXml(std::ostream & os, bool omitDuplicates);
    static void writeCheckStyle(std::ostream & os, bool omitDuplicates);

private:
    static void dumpAllNormal(std::ostream & os, bool omitDuplicates);
    static void dumpAllXML(std::ostream & os, bool omitDuplicates);
    static std::string xmlEscape(const std::string & msg);
};

} // namespace Plugins

} // namespace Vera

#endif // REPORTS_H_INCLUDED