diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-08-06 08:32:07 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-08-07 16:01:32 (GMT) |
commit | d02a99d9d3aa8d8f33efbd3255c78d6b87a99a22 (patch) | |
tree | 2c3bb9c58b6a83b36a1e529d2b3412d1681dd495 /Source/cmQtAutoGenInitializer.h | |
parent | bbf4a5771f8113ce5b88968c4dd3def2fbcd9354 (diff) | |
download | CMake-d02a99d9d3aa8d8f33efbd3255c78d6b87a99a22.zip CMake-d02a99d9d3aa8d8f33efbd3255c78d6b87a99a22.tar.gz CMake-d02a99d9d3aa8d8f33efbd3255c78d6b87a99a22.tar.bz2 |
Autogen: Modernize code to use cm::string_view for the info writer
Diffstat (limited to 'Source/cmQtAutoGenInitializer.h')
-rw-r--r-- | Source/cmQtAutoGenInitializer.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/cmQtAutoGenInitializer.h b/Source/cmQtAutoGenInitializer.h index eb0d35e..7d72cad 100644 --- a/Source/cmQtAutoGenInitializer.h +++ b/Source/cmQtAutoGenInitializer.h @@ -6,6 +6,7 @@ #include "cmConfigure.h" // IWYU pragma: keep #include "cmGeneratedFileStream.h" #include "cmQtAutoGen.h" +#include "cm_string_view.hxx" #include <map> #include <memory> @@ -85,24 +86,24 @@ public: /// @return True if the file is open explicit operator bool() const { return static_cast<bool>(Ofs_); } - void Write(const char* text) { Ofs_ << text; } - void Write(const char* key, std::string const& value); - void WriteUInt(const char* key, unsigned int value); + void Write(cm::string_view text) { Ofs_ << text; } + void Write(cm::string_view, std::string const& value); + void WriteUInt(cm::string_view, unsigned int value); template <class C> - void WriteStrings(const char* key, C const& container); - void WriteConfig(const char* key, + void WriteStrings(cm::string_view, C const& container); + void WriteConfig(cm::string_view, std::map<std::string, std::string> const& map); template <class C> - void WriteConfigStrings(const char* key, + void WriteConfigStrings(cm::string_view, std::map<std::string, C> const& map); - void WriteNestedLists(const char* key, + void WriteNestedLists(cm::string_view, std::vector<std::vector<std::string>> const& lists); private: template <class IT> static std::string ListJoin(IT it_begin, IT it_end); - static std::string ConfigKey(const char* key, std::string const& config); + static std::string ConfigKey(cm::string_view, std::string const& config); private: cmGeneratedFileStream Ofs_; |