11 #include "GDCore/String.h"
12 #include "GDCore/Tools/MakeUnique.h"
35 actualValue(actualValue_),
36 expectedValue(expectedValue_),
37 objectName(objectName_) {};
40 ErrorType GetType()
const {
return type; };
41 const gd::String &GetMessage()
const {
return message; }
42 const gd::String &GetObjectName()
const {
return objectName; }
43 const gd::String &GetActualValue()
const {
return actualValue; }
44 const gd::String &GetExpectedValue()
const {
return expectedValue; }
63 projectDiagnostics.push_back(
64 gd::make_unique<gd::ProjectDiagnostic>(projectDiagnostic));
68 return *projectDiagnostics[index].get();
71 std::size_t Count()
const {
return projectDiagnostics.size(); };
73 const gd::String &GetSceneName()
const {
return sceneName; }
75 void SetSceneName(
const gd::String &sceneName_) { sceneName = sceneName_; }
77 void LogAllDiagnostics() {
78 for (
auto &diagnostic : projectDiagnostics) {
79 std::cout << diagnostic->GetMessage()
80 <<
"(object: " << diagnostic->GetObjectName()
81 <<
", actual value: " << diagnostic->GetActualValue()
82 <<
", expected value: " << diagnostic->GetExpectedValue() <<
")"
88 std::vector<std::unique_ptr<gd::ProjectDiagnostic>> projectDiagnostics;
101 return *diagnosticReports[index].get();
104 void Clear() { diagnosticReports.clear(); };
108 auto diagnosticReport = gd::make_unique<gd::DiagnosticReport>();
109 diagnosticReport->SetSceneName(sceneName);
110 diagnosticReports.push_back(std::move(diagnosticReport));
111 return *diagnosticReports[diagnosticReports.size() - 1].get();
114 std::size_t Count()
const {
return diagnosticReports.size(); };
117 for (
auto &diagnosticReport : diagnosticReports) {
118 if (diagnosticReport->Count() > 0) {
126 std::vector<std::unique_ptr<gd::DiagnosticReport>> diagnosticReports;
Definition: DiagnosticReport.h:57
Definition: DiagnosticReport.h:19
String represents an UTF8 encoded string.
Definition: String.h:33
Definition: DiagnosticReport.h:95
Definition: CommonTools.h:24