diff options
Diffstat (limited to 'Source/cmOutputConverter.h')
-rw-r--r-- | Source/cmOutputConverter.h | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h index deca767..671efe7 100644 --- a/Source/cmOutputConverter.h +++ b/Source/cmOutputConverter.h @@ -5,9 +5,10 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include <string> - #include "cmStateSnapshot.h" +#include "cm_string_view.hxx" + +#include <string> class cmState; @@ -22,10 +23,9 @@ public: WATCOMQUOTE, RESPONSE }; - std::string ConvertToOutputFormat(const std::string& source, + std::string ConvertToOutputFormat(cm::string_view source, OutputFormat output) const; - std::string ConvertDirectorySeparatorsForShell( - const std::string& source) const; + std::string ConvertDirectorySeparatorsForShell(cm::string_view source) const; //! for existing files convert to output path and short path if spaces std::string ConvertToOutputForExisting(const std::string& remote, @@ -72,15 +72,15 @@ 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; - static std::string EscapeForCMake(const std::string& str); + static std::string EscapeForCMake(cm::string_view str); /** 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 @@ -89,15 +89,17 @@ public: FortranFormatFixed, FortranFormatFree }; + static FortranFormat GetFortranFormat(cm::string_view value); static FortranFormat GetFortranFormat(const char* value); private: cmState* GetState() const; - static int Shell__CharNeedsQuotes(char c, int flags); - static const char* Shell__SkipMakeVariables(const char* c); - static int Shell__ArgumentNeedsQuotes(const char* in, int flags); - static std::string Shell__GetArgument(const char* in, int flags); + static bool Shell__CharNeedsQuotes(char c, 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; |