diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-07-28 15:19:32 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-07-28 15:48:59 (GMT) |
commit | ec892a572bc6fa197b8836e4f186b2fc80ff03c9 (patch) | |
tree | 04ea06b58f695d2d2867073ea6cdc4795c0208b0 /Source/cmOutputConverter.h | |
parent | 8573e20c43af4e0313a001f4fbc325ab5a899e3d (diff) | |
download | CMake-ec892a572bc6fa197b8836e4f186b2fc80ff03c9.zip CMake-ec892a572bc6fa197b8836e4f186b2fc80ff03c9.tar.gz CMake-ec892a572bc6fa197b8836e4f186b2fc80ff03c9.tar.bz2 |
cmOutputConverter: Make shell escaping methods cm::string_view based
Diffstat (limited to 'Source/cmOutputConverter.h')
-rw-r--r-- | Source/cmOutputConverter.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h index 0d24929..671efe7 100644 --- a/Source/cmOutputConverter.h +++ b/Source/cmOutputConverter.h @@ -23,7 +23,7 @@ public: WATCOMQUOTE, RESPONSE }; - std::string ConvertToOutputFormat(const std::string& source, + std::string ConvertToOutputFormat(cm::string_view source, OutputFormat output) const; std::string ConvertDirectorySeparatorsForShell(cm::string_view source) const; @@ -72,7 +72,7 @@ public: Shell_Flag_IsUnix = (1 << 8) }; - std::string EscapeForShell(const std::string& str, bool makeVars = false, + std::string EscapeForShell(cm::string_view str, bool makeVars = false, bool forEcho = false, bool useWatcomQuote = false) const; @@ -80,7 +80,7 @@ public: /** Compute an escaped version of the given argument for use in a windows shell. */ - static std::string EscapeWindowsShellArgument(const char* arg, + static std::string EscapeWindowsShellArgument(cm::string_view arg, int shell_flags); enum FortranFormat @@ -96,9 +96,10 @@ private: cmState* GetState() const; static bool Shell__CharNeedsQuotes(char c, int flags); - static const char* Shell__SkipMakeVariables(const char* c); - static bool Shell__ArgumentNeedsQuotes(const char* in, int flags); - static std::string Shell__GetArgument(const char* in, int flags); + static cm::string_view::iterator Shell__SkipMakeVariables( + cm::string_view::iterator begin, cm::string_view::iterator end); + static bool Shell__ArgumentNeedsQuotes(cm::string_view in, int flags); + static std::string Shell__GetArgument(cm::string_view in, int flags); private: cmStateSnapshot StateSnapshot; |