nany
report.hxx
1 #pragma once
2 #include "report.h"
3 
4 
5 namespace ny {
6 namespace Logs {
7 
8 
9 inline Report::Report(Message& message)
10  : message(message) {
11 }
12 
13 
14 inline Report::Report(Report& report)
15  : message(report.message) {
16 }
17 
18 
19 inline Report::Report(Report&& report)
20  : message(report.message) {
21 }
22 
23 
24 template<class T>
25 inline Report& Report::operator << (const T& value) {
26  message.message.append(value);
27  return *this;
28 }
29 
30 
31 inline YString& Report::text() {
32  return message.message;
33 }
34 
35 
36 inline const YString& Report::text() const {
37  return message.message;
38 }
39 
40 
41 inline bool Report::hasErrors() const {
42  return message.hasErrors;
43 }
44 
45 
46 inline Message& Report::data() {
47  return message;
48 }
49 
50 
51 inline Message::Origin& Report::origins() {
52  return message.origins;
53 }
54 
55 
56 template<class T>
57 inline EmptyReport& EmptyReport::operator << (const T&) {
58  return *this;
59 }
60 
61 
62 inline bool EmptyReport::hasErrors() const {
63  return false;
64 }
65 
66 
67 inline void Report::appendEntry(const std::shared_ptr<Message>& entry) {
68  message.appendEntry(entry);
69 }
70 
71 
72 inline Report::operator bool () const {
73  return message.level >= Level::warning;
74 }
75 
76 
77 } // namespace Logs
78 } // namespace ny
Message & data()
Get access to the message itself (used by the C-API)
Definition: report.hxx:46
Definition: ast.cpp:6
Definition: report.h:92
Definition: message.h:52
bool hasErrors() const
Get if there are some error messages.
Definition: report.hxx:41
Definition: message.h:19