Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mathieu Westphal
KWSys
Commits
4b409aa4
Commit
4b409aa4
authored
Mar 11, 2014
by
Ben Boeckel
Committed by
Ben Boeckel
May 07, 2014
Browse files
SystemTools: Take strings in SplitPath
Change-Id: Ic80a61bd1bb23f46b2b1875e672a4dc4f93cc7ce
parent
84db9ee5
Changes
2
Show whitespace changes
Inline
Side-by-side
SystemTools.cxx
View file @
4b409aa4
...
...
@@ -3307,7 +3307,7 @@ static int GetCasePathName(const kwsys_stl::string & pathIn,
kwsys_stl
::
string
&
casePath
)
{
kwsys_stl
::
vector
<
kwsys_stl
::
string
>
path_components
;
SystemTools
::
SplitPath
(
pathIn
.
c_str
()
,
path_components
);
SystemTools
::
SplitPath
(
pathIn
,
path_components
);
if
(
path_components
[
0
].
empty
())
// First component always exists.
{
// Relative paths cannot be converted.
...
...
@@ -3389,11 +3389,11 @@ kwsys_stl::string SystemTools::GetActualCaseForPath(const char* p)
}
//----------------------------------------------------------------------------
const
char
*
SystemTools
::
SplitPathRootComponent
(
const
char
*
p
,
const
char
*
SystemTools
::
SplitPathRootComponent
(
const
std
::
string
&
p
,
kwsys_stl
::
string
*
root
)
{
// Identify the root component.
const
char
*
c
=
p
;
const
char
*
c
=
p
.
c_str
()
;
if
((
c
[
0
]
==
'/'
&&
c
[
1
]
==
'/'
)
||
(
c
[
0
]
==
'\\'
&&
c
[
1
]
==
'\\'
))
{
// Network path.
...
...
@@ -3475,17 +3475,17 @@ const char* SystemTools::SplitPathRootComponent(const char* p,
}
//----------------------------------------------------------------------------
void
SystemTools
::
SplitPath
(
const
char
*
p
,
void
SystemTools
::
SplitPath
(
const
std
::
string
&
p
,
kwsys_stl
::
vector
<
kwsys_stl
::
string
>&
components
,
bool
expand_home_dir
)
{
const
char
*
c
=
p
;
const
char
*
c
;
components
.
clear
();
// Identify the root component.
{
kwsys_stl
::
string
root
;
c
=
SystemTools
::
SplitPathRootComponent
(
c
,
&
root
);
c
=
SystemTools
::
SplitPathRootComponent
(
p
,
&
root
);
// Expand home directory references if requested.
if
(
expand_home_dir
&&
!
root
.
empty
()
&&
root
[
0
]
==
'~'
)
...
...
@@ -3520,7 +3520,7 @@ void SystemTools::SplitPath(const char* p,
{
homedir
.
resize
(
homedir
.
size
()
-
1
);
}
SystemTools
::
SplitPath
(
homedir
.
c_str
()
,
components
);
SystemTools
::
SplitPath
(
homedir
,
components
);
}
else
{
...
...
SystemTools.hxx.in
View file @
4b409aa4
...
...
@@ -383,7 +383,7 @@ public:
* returned. The root component is stored in the "root" string if
* given.
*/
static const char* SplitPathRootComponent(const
char*
p,
static const char* SplitPathRootComponent(const
std::string&
p,
kwsys_stl::string* root=0);
/**
...
...
@@ -396,7 +396,7 @@ public:
* automatically expanded if expand_home_dir is true and this
* platform supports them.
*/
static void SplitPath(const
char*
p,
static void SplitPath(const
std::string&
p,
kwsys_stl::vector<kwsys_stl::string>& components,
bool expand_home_dir = true);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment