Convert: Inline platform-specific methods

They don't provide real value.
This commit is contained in:
Stephen Kelly
2016-10-04 22:56:32 +02:00
parent 1ed5f6b39b
commit 1365e18b9b
2 changed files with 4 additions and 28 deletions

View File

@@ -240,9 +240,8 @@ std::string cmOutputConverter::EscapeForShell(const std::string& str,
flags |= Shell_Flag_NMake; flags |= Shell_Flag_NMake;
} }
return this->GetState()->UseWindowsShell() return Shell__GetArgument(str.c_str(), !this->GetState()->UseWindowsShell(),
? Shell_GetArgumentForWindows(str.c_str(), flags) flags);
: Shell_GetArgumentForUnix(str.c_str(), flags);
} }
std::string cmOutputConverter::EscapeForCMake(const std::string& str) std::string cmOutputConverter::EscapeForCMake(const std::string& str)
@@ -271,7 +270,7 @@ std::string cmOutputConverter::EscapeForCMake(const std::string& str)
std::string cmOutputConverter::EscapeWindowsShellArgument(const char* arg, std::string cmOutputConverter::EscapeWindowsShellArgument(const char* arg,
int shell_flags) int shell_flags)
{ {
return Shell_GetArgumentForWindows(arg, shell_flags); return Shell__GetArgument(arg, 0, shell_flags);
} }
cmOutputConverter::FortranFormat cmOutputConverter::GetFortranFormat( cmOutputConverter::FortranFormat cmOutputConverter::GetFortranFormat(
@@ -632,15 +631,3 @@ std::string cmOutputConverter::Shell__GetArgument(const char* in, int isUnix,
return out.str(); return out.str();
} }
std::string cmOutputConverter::Shell_GetArgumentForWindows(const char* in,
int flags)
{
return Shell__GetArgument(in, 0, flags);
}
std::string cmOutputConverter::Shell_GetArgumentForUnix(const char* in,
int flags)
{
return Shell__GetArgument(in, 1, flags);
}

View File

@@ -33,8 +33,7 @@ public:
void SetLinkScriptShell(bool linkScriptShell); void SetLinkScriptShell(bool linkScriptShell);
/** /**
* Flags to pass to Shell_GetArgumentForWindows or * Flags to pass to Shell_GetArgument. These modify the generated
* Shell_GetArgumentForUnix. These modify the generated
* quoting and escape sequences to work under alternative * quoting and escape sequences to work under alternative
* environments. * environments.
*/ */
@@ -70,16 +69,6 @@ public:
Shell_Flag_WatcomQuote = (1 << 7) Shell_Flag_WatcomQuote = (1 << 7)
}; };
/**
* Transform the given command line argument for use in a Windows or
* Unix shell. Returns a pointer to the end of the command line
* argument in the provided output buffer. Flags may be passed to
* modify the generated quoting and escape sequences to work under
* alternative environments.
*/
static std::string Shell_GetArgumentForWindows(const char* in, int flags);
static std::string Shell_GetArgumentForUnix(const char* in, int flags);
std::string EscapeForShell(const std::string& str, bool makeVars = false, std::string EscapeForShell(const std::string& str, bool makeVars = false,
bool forEcho = false, bool forEcho = false,
bool useWatcomQuote = false) const; bool useWatcomQuote = false) const;