summaryrefslogtreecommitdiff
path: root/Source/cmOutputConverter.h
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2016-06-15 23:41:46 +0200
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2016-06-15 23:44:37 +0200
commitd645b03e9c97856436b9fcd517b2c33b8aa3302c (patch)
tree204f0be957ed22631969969c6bebda8cb9c1e4c8 /Source/cmOutputConverter.h
parent909d51bece7d343f32a8f59351aad5c396101a2c (diff)
downloadcmake-d645b03e9c97856436b9fcd517b2c33b8aa3302c.tar.gz
cmOutputConverter: implement Shell__GetArgument using ostringstream
This removes the need to calculate the resulting string length beforehand.
Diffstat (limited to 'Source/cmOutputConverter.h')
-rw-r--r--Source/cmOutputConverter.h17
1 files changed, 3 insertions, 14 deletions
diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h
index 75d6326fe3..f138d0e897 100644
--- a/Source/cmOutputConverter.h
+++ b/Source/cmOutputConverter.h
@@ -126,17 +126,8 @@ public:
* modify the generated quoting and escape sequences to work under
* alternative environments.
*/
- static char* Shell_GetArgumentForWindows(const char* in, char* out,
- int flags);
- static char* Shell_GetArgumentForUnix(const char* in, char* out, int flags);
-
- /**
- * Compute the size of the buffer required to store the output from
- * Shell_GetArgumentForWindows or Shell_GetArgumentForUnix. The flags
- * passed must be identical between the two calls.
- */
- static int Shell_GetArgumentSizeForWindows(const char* in, int flags);
- static int Shell_GetArgumentSizeForUnix(const char* in, int flags);
+ 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,
bool forEcho = false,
@@ -182,9 +173,7 @@ private:
static int Shell__CharIsMakeVariableName(char c);
static const char* Shell__SkipMakeVariables(const char* c);
static int Shell__ArgumentNeedsQuotes(const char* in, int isUnix, int flags);
- static int Shell__GetArgumentSize(const char* in, int isUnix, int flags);
- static char* Shell__GetArgument(const char* in, char* out, int isUnix,
- int flags);
+ static std::string Shell__GetArgument(const char* in, int isUnix, int flags);
private:
cmState::Snapshot StateSnapshot;