nany
report.h
1 #pragma once
2 #include "libnanyc.h"
3 #include "fwd.h"
4 #include "message.h"
5 #include "levels.h"
6 
7 
8 
9 namespace ny {
10 namespace Logs {
11 
12 
13 class EmptyReport;
14 
15 
16 
17 class Report final {
18 public:
20 
21  explicit Report(Message& message);
22  Report(Report& report);
23  Report(Report&&);
25 
27 
28  Report ice();
31  Report error();
33  Report warning();
35  Report hint();
37  Report suggest();
39  Report success();
41  Report info();
43  Report info(AnyString prefix);
45  Report verbose();
47  Report trace();
48 
49  Report fromErrLevel(Level);
50 
52  Report subgroup();
53 
54  void appendEntry(const std::shared_ptr<Message>&);
56 
57 
59 
60  bool hasErrors() const;
62 
63  YString& text();
64  const YString& text() const;
65 
67  Message& data();
68 
69  Message::Origin& origins();
71 
72 
74 
75  template<class T> Report& operator << (const T& value);
77  Report& operator = (const Report&) = delete;
79  operator bool () const;
81 
82 
83 public:
84  Message& message;
85 
86 }; // class Report
87 
88 
89 
90 
91 
92 class EmptyReport final {
93 public:
94  bool hasErrors() const;
95 
96  template<class T> EmptyReport& operator << (const T& value);
97 };
98 
99 
100 
101 
102 } // namespace Logs
103 } // namespace ny
104 
105 #include "report.hxx"
Report & operator=(const Report &)=delete
Copy operator.
Report ice()
Create ICE.
Definition: report.cpp:22
Message & data()
Get access to the message itself (used by the C-API)
Definition: report.hxx:46
Definition: ast.cpp:6
Report warning()
Create a new warning message.
Definition: report.cpp:34
Report trace()
Create a new trace message.
Definition: report.cpp:72
Report subgroup()
Create a dummy message, for sub-grouping.
Definition: report.cpp:77
Report suggest()
Create a new suggest message.
Definition: report.cpp:45
Definition: report.h:92
Definition: message.h:52
bool hasErrors() const
Get if there are some error messages.
Definition: report.hxx:41
Report hint()
Create a new hint message.
Definition: report.cpp:40
Definition: message.h:19
Definition: report.h:17
Report verbose()
Create a new trace message.
Definition: report.cpp:67
Report info()
Create a new info message.
Definition: report.cpp:55
Report error()
Create a new error message.
Definition: report.cpp:28
Report success()
Create a new success message.
Definition: report.cpp:50