diff options
Diffstat (limited to 'Source/cmSystemTools.h')
-rw-r--r-- | Source/cmSystemTools.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 5bbbb0c..5620899 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -128,10 +128,43 @@ public: static bool SimpleGlob(const std::string& glob, std::vector<std::string>& files, int type = 0); + enum class CopyWhen + { + Always, + OnlyIfDifferent, + }; + enum class CopyResult + { + Success, + Failure, + }; + + /** Copy a file. */ + static bool CopySingleFile(const std::string& oldname, + const std::string& newname); + static CopyResult CopySingleFile(std::string const& oldname, + std::string const& newname, CopyWhen when, + std::string* err = nullptr); + + enum class Replace + { + Yes, + No, + }; + enum class RenameResult + { + Success, + NoReplace, + Failure, + }; + /** Rename a file or directory within a single disk volume (atomic if possible). */ static bool RenameFile(const std::string& oldname, const std::string& newname); + static RenameResult RenameFile(std::string const& oldname, + std::string const& newname, Replace replace, + std::string* err = nullptr); //! Rename a file if contents are different, delete the source otherwise static void MoveFileIfDifferent(const std::string& source, @@ -465,6 +498,9 @@ public: const std::string& newName, std::string* errorMessage = nullptr); + /** Get the system name. */ + static cm::string_view GetSystemName(); + private: static bool s_ForceUnixPaths; static bool s_RunCommandHideConsole; |