1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
10 #include <cm/string_view>
12 #include "cmsys/FStream.hxx"
23 /** Construct with the log directory and a sorted list of enabled log
24 versions. The latest log version will be enabled regardless. */
25 cmConfigureLog(std::string logDir
, std::vector
<unsigned long> logVersions
);
28 /** Return true if at least one of the log versions in the given sorted
30 bool IsAnyLogVersionEnabled(std::vector
<unsigned long> const& v
) const;
34 void BeginEvent(std::string
const& kind
, cmMakefile
const& mf
);
37 void BeginObject(cm::string_view key
);
40 // TODO other value types
41 void WriteValue(cm::string_view key
, std::nullptr_t
);
42 void WriteValue(cm::string_view key
, bool value
);
43 void WriteValue(cm::string_view key
, int value
);
44 void WriteValue(cm::string_view key
, std::string
const& value
);
45 void WriteValue(cm::string_view key
, std::vector
<std::string
> const& list
);
46 void WriteValue(cm::string_view key
,
47 std::map
<std::string
, std::string
> const& map
);
49 void WriteTextBlock(cm::string_view key
, cm::string_view text
);
50 void WriteLiteralTextBlock(cm::string_view key
, cm::string_view text
);
52 void WriteLiteralTextBlock(cm::string_view key
, std::string
const& text
)
54 this->WriteLiteralTextBlock(key
, cm::string_view
{ text
});
59 std::vector
<unsigned long> LogVersions
;
60 cmsys::ofstream Stream
;
64 std::unique_ptr
<Json::StreamWriter
> Encoder
;
66 void WriteBacktrace(cmMakefile
const& mf
);
67 void WriteChecks(cmMakefile
const& mf
);
69 cmsys::ofstream
& BeginLine();
71 void WriteEscape(unsigned char c
);