cmOutputConverter: collapse ConvertToOutputForExisting functions
This commit is contained in:
parent
191fc3a0f3
commit
bdaadbdc2b
|
@ -27,10 +27,12 @@ cmOutputConverter::cmOutputConverter(cmState::Snapshot snapshot)
|
||||||
assert(this->StateSnapshot.IsValid());
|
assert(this->StateSnapshot.IsValid());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmOutputConverter::ConvertToOutputForExistingCommon(
|
std::string cmOutputConverter::ConvertToOutputForExisting(
|
||||||
const std::string& remote, std::string const& result,
|
const std::string& remote, OutputFormat format) const
|
||||||
OutputFormat format) const
|
|
||||||
{
|
{
|
||||||
|
// Perform standard conversion.
|
||||||
|
std::string result = this->ConvertToOutputFormat(remote, format);
|
||||||
|
|
||||||
// If this is a windows shell, the result has a space, and the path
|
// If this is a windows shell, the result has a space, and the path
|
||||||
// already exists, we can use a short-path to reference it without a
|
// already exists, we can use a short-path to reference it without a
|
||||||
// space.
|
// space.
|
||||||
|
@ -46,16 +48,6 @@ std::string cmOutputConverter::ConvertToOutputForExistingCommon(
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmOutputConverter::ConvertToOutputForExisting(
|
|
||||||
const std::string& remote, OutputFormat format) const
|
|
||||||
{
|
|
||||||
// Perform standard conversion.
|
|
||||||
std::string result = this->ConvertToOutputFormat(remote, format);
|
|
||||||
|
|
||||||
// Consider short-path.
|
|
||||||
return this->ConvertToOutputForExistingCommon(remote, result, format);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string cmOutputConverter::ConvertToOutputForExisting(
|
std::string cmOutputConverter::ConvertToOutputForExisting(
|
||||||
RelativeRoot remote, OutputFormat format) const
|
RelativeRoot remote, OutputFormat format) const
|
||||||
{
|
{
|
||||||
|
@ -66,11 +58,7 @@ std::string cmOutputConverter::ConvertToOutputForExisting(
|
||||||
const char* remotePath = this->GetRelativeRootPath(remote);
|
const char* remotePath = this->GetRelativeRootPath(remote);
|
||||||
assert(remotePath != 0);
|
assert(remotePath != 0);
|
||||||
|
|
||||||
// Perform standard conversion.
|
return this->ConvertToOutputForExisting(remotePath, format);
|
||||||
std::string result = this->ConvertToOutputFormat(remotePath, format);
|
|
||||||
|
|
||||||
// Consider short-path.
|
|
||||||
return this->ConvertToOutputForExistingCommon(remotePath, result, format);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* cmOutputConverter::GetRelativeRootPath(RelativeRoot relroot) const
|
const char* cmOutputConverter::GetRelativeRootPath(RelativeRoot relroot) const
|
||||||
|
|
|
@ -159,10 +159,6 @@ public:
|
||||||
private:
|
private:
|
||||||
cmState* GetState() const;
|
cmState* GetState() const;
|
||||||
|
|
||||||
std::string ConvertToOutputForExistingCommon(const std::string& remote,
|
|
||||||
std::string const& result,
|
|
||||||
OutputFormat format) const;
|
|
||||||
|
|
||||||
static int Shell__CharIsWhitespace(char c);
|
static int Shell__CharIsWhitespace(char c);
|
||||||
static int Shell__CharNeedsQuotesOnUnix(char c);
|
static int Shell__CharNeedsQuotesOnUnix(char c);
|
||||||
static int Shell__CharNeedsQuotesOnWindows(char c);
|
static int Shell__CharNeedsQuotesOnWindows(char c);
|
||||||
|
|
Loading…
Reference in New Issue