Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
KWSys
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Shannon Booth
KWSys
Commits
ff0071c0
Commit
ff0071c0
authored
18 years ago
by
Brad King
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Added JoinPath overload that accepts an iterator range.
parent
1a9d7a67
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SystemTools.cxx
+22
-6
22 additions, 6 deletions
SystemTools.cxx
SystemTools.hxx.in
+3
-0
3 additions, 0 deletions
SystemTools.hxx.in
with
25 additions
and
6 deletions
SystemTools.cxx
+
22
−
6
View file @
ff0071c0
...
...
@@ -2813,20 +2813,36 @@ void SystemTools::SplitPath(const char* p,
kwsys_stl
::
string
SystemTools
::
JoinPath
(
const
kwsys_stl
::
vector
<
kwsys_stl
::
string
>&
components
)
{
return
SystemTools
::
JoinPath
(
components
.
begin
(),
components
.
end
());
}
//----------------------------------------------------------------------------
kwsys_stl
::
string
SystemTools
::
JoinPath
(
kwsys_stl
::
vector
<
kwsys_stl
::
string
>::
const_iterator
first
,
kwsys_stl
::
vector
<
kwsys_stl
::
string
>::
const_iterator
last
)
{
// Construct result in a single string.
kwsys_stl
::
string
result
;
if
(
components
.
size
()
>
0
)
// The first two components do not add a slash.
if
(
first
!=
last
)
{
result
+=
components
[
0
]
;
result
+=
*
first
++
;
}
if
(
components
.
size
()
>
1
)
if
(
first
!=
last
)
{
result
+=
components
[
1
]
;
result
+=
*
first
++
;
}
for
(
unsigned
int
i
=
2
;
i
<
components
.
size
();
++
i
)
// All remaining components are always separated with a slash.
while
(
first
!=
last
)
{
result
+=
"/"
;
result
+=
components
[
i
]
;
result
+=
*
first
++
;
}
// Return the concatenated result.
return
result
;
}
...
...
This diff is collapsed.
Click to expand it.
SystemTools.hxx.in
+
3
−
0
View file @
ff0071c0
...
...
@@ -364,6 +364,9 @@ public:
*/
static kwsys_stl::string JoinPath(
const kwsys_stl::vector<kwsys_stl::string>& components);
static kwsys_stl::string JoinPath(
kwsys_stl::vector<kwsys_stl::string>::const_iterator first,
kwsys_stl::vector<kwsys_stl::string>::const_iterator last);
/**
* Compare a path or components of a path.
...
...
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