1
2
3
4
5
6 #ifndef CMAJOR_SYMBOLS_WARNING_INCLUDED
7 #define CMAJOR_SYMBOLS_WARNING_INCLUDED
8 #include <cmajor/symbols/SymbolsApi.hpp>
9 #include <soulng/util/Json.hpp>
10 #include <soulng/lexer/Span.hpp>
11 #include <boost/uuid/uuid.hpp>
12
13 namespace cmajor { namespace symbols {
14
15 using soulng::lexer::Span;
16 using soulng::util::JsonValue;
17 class Module;
18
19 class Warning
20 {
21 public:
22 Warning(const std::u32string& project_, const std::string& message_);
23 const std::u32string& Project() const { return project; }
24 const std::string& Message() const { return message; }
25 const Span& Defined() const { return defined; }
26 void SetDefined(const Span& defined_, const boost::uuids::uuid& definedModuleId_) { defined = defined_; definedModuleId = definedModuleId_; }
27 const std::std::vector<std::std::pair<Span, boost::uuids::uuid>>&References() const{returnreferences;}
28 void SetReferences(const std::std::vector<std::std::pair<Span, boost::uuids::uuid>>&references_);
29
30 private:
31 std::u32string project;
32 std::string message;
33 Span defined;
34 boost::uuids::uuid definedModuleId;
35 std::vector<std::std::pair<Span, boost::uuids::uuid>>references;
36 };
37
38 class CompileWarningCollection
39 {
40 public:
41 CompileWarningCollection();
42 void AddWarning(const Warning& warning);
43 const std::std::vector<Warning>&Warnings() const{returnwarnings;}
44 private:
45 std::vector<Warning> warnings;
46 };
47
48 } }
49
50 #endif // CMAJOR_SYMBOLS_WARNING_INCLUDED