Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CMake
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
André Pedro
CMake
Commits
ccf7760f
Commit
ccf7760f
authored
9 years ago
by
Stephen Kelly
Browse files
Options
Downloads
Patches
Plain Diff
cmOutputConverter: Constify API.
parent
155ef535
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Source/cmOutputConverter.cxx
+9
-9
9 additions, 9 deletions
Source/cmOutputConverter.cxx
Source/cmOutputConverter.h
+9
-9
9 additions, 9 deletions
Source/cmOutputConverter.h
Source/cmState.cxx
+2
-2
2 additions, 2 deletions
Source/cmState.cxx
Source/cmState.h
+4
-2
4 additions, 2 deletions
Source/cmState.h
with
24 additions
and
22 deletions
Source/cmOutputConverter.cxx
+
9
−
9
View file @
ccf7760f
...
...
@@ -27,7 +27,7 @@ cmOutputConverter::cmOutputConverter(cmState::Snapshot snapshot)
std
::
string
cmOutputConverter
::
ConvertToOutputForExistingCommon
(
const
std
::
string
&
remote
,
std
::
string
const
&
result
,
OutputFormat
format
)
OutputFormat
format
)
const
{
// 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
...
...
@@ -50,7 +50,7 @@ cmOutputConverter::ConvertToOutputForExistingCommon(const std::string& remote,
std
::
string
cmOutputConverter
::
ConvertToOutputForExisting
(
const
std
::
string
&
remote
,
RelativeRoot
local
,
OutputFormat
format
)
OutputFormat
format
)
const
{
static_cast
<
void
>
(
local
);
...
...
@@ -65,7 +65,7 @@ cmOutputConverter::ConvertToOutputForExisting(const std::string& remote,
std
::
string
cmOutputConverter
::
ConvertToOutputForExisting
(
RelativeRoot
remote
,
const
std
::
string
&
local
,
OutputFormat
format
)
OutputFormat
format
)
const
{
// Perform standard conversion.
std
::
string
result
=
this
->
Convert
(
remote
,
local
,
format
,
true
);
...
...
@@ -76,7 +76,7 @@ cmOutputConverter::ConvertToOutputForExisting(RelativeRoot remote,
}
//----------------------------------------------------------------------------
const
char
*
cmOutputConverter
::
GetRelativeRootPath
(
RelativeRoot
relroot
)
const
char
*
cmOutputConverter
::
GetRelativeRootPath
(
RelativeRoot
relroot
)
const
{
switch
(
relroot
)
{
...
...
@@ -91,7 +91,7 @@ const char* cmOutputConverter::GetRelativeRootPath(RelativeRoot relroot)
std
::
string
cmOutputConverter
::
Convert
(
const
std
::
string
&
source
,
RelativeRoot
relative
,
OutputFormat
output
)
OutputFormat
output
)
const
{
// Convert the path to a relative path.
std
::
string
result
=
source
;
...
...
@@ -125,7 +125,7 @@ std::string cmOutputConverter::Convert(const std::string& source,
//----------------------------------------------------------------------------
std
::
string
cmOutputConverter
::
ConvertToOutputFormat
(
const
std
::
string
&
source
,
OutputFormat
output
)
OutputFormat
output
)
const
{
std
::
string
result
=
source
;
// Convert it to an output path.
...
...
@@ -163,7 +163,7 @@ std::string cmOutputConverter::ConvertToOutputFormat(const std::string& source,
std
::
string
cmOutputConverter
::
Convert
(
RelativeRoot
remote
,
const
std
::
string
&
local
,
OutputFormat
output
,
bool
optional
)
bool
optional
)
const
{
const
char
*
remotePath
=
this
->
GetRelativeRootPath
(
remote
);
...
...
@@ -192,7 +192,7 @@ static bool cmOutputConverterNotAbove(const char* a, const char* b)
std
::
string
cmOutputConverter
::
ConvertToRelativePath
(
const
std
::
vector
<
std
::
string
>&
local
,
const
std
::
string
&
in_remote
,
bool
force
)
bool
force
)
const
{
// The path should never be quoted.
assert
(
in_remote
[
0
]
!=
'\"'
);
...
...
@@ -318,7 +318,7 @@ static bool cmOutputConverterIsShellOperator(const std::string& str)
std
::
string
cmOutputConverter
::
EscapeForShell
(
const
std
::
string
&
str
,
bool
makeVars
,
bool
forEcho
,
bool
useWatcomQuote
)
bool
useWatcomQuote
)
const
{
// Do not escape shell operators.
if
(
cmOutputConverterIsShellOperator
(
str
))
...
...
This diff is collapsed.
Click to expand it.
Source/cmOutputConverter.h
+
9
−
9
View file @
ccf7760f
...
...
@@ -39,35 +39,35 @@ public:
enum
RelativeRoot
{
NONE
,
FULL
,
HOME
,
START
,
HOME_OUTPUT
,
START_OUTPUT
};
enum
OutputFormat
{
UNCHANGED
,
MAKERULE
,
SHELL
,
WATCOMQUOTE
,
RESPONSE
};
std
::
string
ConvertToOutputFormat
(
const
std
::
string
&
source
,
OutputFormat
output
);
OutputFormat
output
)
const
;
std
::
string
Convert
(
const
std
::
string
&
remote
,
RelativeRoot
local
,
OutputFormat
output
=
UNCHANGED
);
OutputFormat
output
=
UNCHANGED
)
const
;
std
::
string
Convert
(
RelativeRoot
remote
,
const
std
::
string
&
local
,
OutputFormat
output
=
UNCHANGED
,
bool
optional
=
false
);
bool
optional
=
false
)
const
;
/**
* Get path for the specified relative root.
*/
const
char
*
GetRelativeRootPath
(
RelativeRoot
relroot
);
const
char
*
GetRelativeRootPath
(
RelativeRoot
relroot
)
const
;
///! for existing files convert to output path and short path if spaces
std
::
string
ConvertToOutputForExisting
(
const
std
::
string
&
remote
,
RelativeRoot
local
=
START_OUTPUT
,
OutputFormat
format
=
SHELL
);
OutputFormat
format
=
SHELL
)
const
;
/** For existing path identified by RelativeRoot convert to output
path and short path if spaces. */
std
::
string
ConvertToOutputForExisting
(
RelativeRoot
remote
,
const
std
::
string
&
local
=
""
,
OutputFormat
format
=
SHELL
);
OutputFormat
format
=
SHELL
)
const
;
void
SetLinkScriptShell
(
bool
linkScriptShell
);
std
::
string
EscapeForShell
(
const
std
::
string
&
str
,
bool
makeVars
=
false
,
bool
forEcho
=
false
,
bool
useWatcomQuote
=
false
);
bool
useWatcomQuote
=
false
)
const
;
static
std
::
string
EscapeForCMake
(
const
std
::
string
&
str
);
...
...
@@ -88,14 +88,14 @@ public:
*/
std
::
string
ConvertToRelativePath
(
const
std
::
vector
<
std
::
string
>&
local
,
const
std
::
string
&
in_remote
,
bool
force
=
false
);
bool
force
=
false
)
const
;
private
:
cmState
*
GetState
()
const
;
std
::
string
ConvertToOutputForExistingCommon
(
const
std
::
string
&
remote
,
std
::
string
const
&
result
,
OutputFormat
format
);
OutputFormat
format
)
const
;
private
:
cmState
::
Snapshot
StateSnapshot
;
...
...
This diff is collapsed.
Click to expand it.
Source/cmState.cxx
+
2
−
2
View file @
ccf7760f
...
...
@@ -741,14 +741,14 @@ void cmState::Snapshot::SetCurrentBinaryDirectory(std::string const& dir)
}
std
::
vector
<
std
::
string
>
const
&
cmState
::
Snapshot
::
GetCurrentSourceDirectoryComponents
()
cmState
::
Snapshot
::
GetCurrentSourceDirectoryComponents
()
const
{
return
this
->
Position
->
BuildSystemDirectory
->
CurrentSourceDirectoryComponents
;
}
std
::
vector
<
std
::
string
>
const
&
cmState
::
Snapshot
::
GetCurrentBinaryDirectoryComponents
()
cmState
::
Snapshot
::
GetCurrentBinaryDirectoryComponents
()
const
{
return
this
->
Position
->
BuildSystemDirectory
->
CurrentBinaryDirectoryComponents
;
...
...
This diff is collapsed.
Click to expand it.
Source/cmState.h
+
4
−
2
View file @
ccf7760f
...
...
@@ -43,8 +43,10 @@ public:
const
char
*
GetCurrentBinaryDirectory
()
const
;
void
SetCurrentBinaryDirectory
(
std
::
string
const
&
dir
);
std
::
vector
<
std
::
string
>
const
&
GetCurrentSourceDirectoryComponents
();
std
::
vector
<
std
::
string
>
const
&
GetCurrentBinaryDirectoryComponents
();
std
::
vector
<
std
::
string
>
const
&
GetCurrentSourceDirectoryComponents
()
const
;
std
::
vector
<
std
::
string
>
const
&
GetCurrentBinaryDirectoryComponents
()
const
;
const
char
*
GetRelativePathTopSource
()
const
;
const
char
*
GetRelativePathTopBinary
()
const
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment