diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2018-01-09 20:56:40 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2018-01-15 14:27:44 (GMT) |
commit | a9c483071eb8a5b5da38726f42be98a2392f7a7f (patch) | |
tree | a1dfc2d3a42e84f89342b5845ea6795c1ccff654 /Source/cmCacheManager.h | |
parent | e40541339ae8a780bc410f0ef8b22d01e594c1ba (diff) | |
download | CMake-a9c483071eb8a5b5da38726f42be98a2392f7a7f.zip CMake-a9c483071eb8a5b5da38726f42be98a2392f7a7f.tar.gz CMake-a9c483071eb8a5b5da38726f42be98a2392f7a7f.tar.bz2 |
cmCacheManager: Truncate values containing newlines
Fixes #16098.
Diffstat (limited to 'Source/cmCacheManager.h')
-rw-r--r-- | Source/cmCacheManager.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 28cba85..73923d1 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -15,7 +15,7 @@ #include "cmPropertyMap.h" #include "cmStateTypes.h" -class cmake; +class cmMessenger; /** \class cmCacheManager * \brief Control class for cmake's cache @@ -108,7 +108,7 @@ public: std::set<std::string>& includes); ///! Save cache for given makefile. Saves to output path/CMakeCache.txt - bool SaveCache(const std::string& path); + bool SaveCache(const std::string& path, cmMessenger* messenger); ///! Delete the cache given bool DeleteCache(const std::string& path); @@ -218,16 +218,25 @@ protected: unsigned int CacheMinorVersion; private: - cmake* CMakeInstance; typedef std::map<std::string, CacheEntry> CacheEntryMap; static void OutputHelpString(std::ostream& fout, const std::string& helpString); + static void OutputWarningComment(std::ostream& fout, + std::string const& message, + bool wrapSpaces); + static void OutputNewlineTruncationWarning(std::ostream& fout, + std::string const& key, + std::string const& value, + cmMessenger* messenger); static void OutputKey(std::ostream& fout, std::string const& key); static void OutputValue(std::ostream& fout, std::string const& value); + static void OutputValueNoNewlines(std::ostream& fout, + std::string const& value); static const char* PersistentProperties[]; bool ReadPropertyEntry(std::string const& key, CacheEntry& e); - void WritePropertyEntries(std::ostream& os, CacheIterator i); + void WritePropertyEntries(std::ostream& os, CacheIterator i, + cmMessenger* messenger); CacheEntryMap Cache; // Only cmake and cmState should be able to add cache values |