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
CMake
CMake
Commits
5e9bd8a2
Commit
5e9bd8a2
authored
May 31, 2017
by
Brad King
Browse files
Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys: KWSys 2017-05-31 (bd0bbad7)
parents
de16ff3e
50988f6d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Source/kwsys/SystemInformation.cxx
View file @
5e9bd8a2
...
@@ -918,7 +918,8 @@ int LoadLines(const char* fileName, std::vector<std::string>& lines)
...
@@ -918,7 +918,8 @@ int LoadLines(const char* fileName, std::vector<std::string>& lines)
// ****************************************************************************
// ****************************************************************************
template
<
typename
T
>
template
<
typename
T
>
int
NameValue
(
std
::
vector
<
std
::
string
>&
lines
,
std
::
string
name
,
T
&
value
)
int
NameValue
(
std
::
vector
<
std
::
string
>
const
&
lines
,
std
::
string
const
&
name
,
T
&
value
)
{
{
size_t
nLines
=
lines
.
size
();
size_t
nLines
=
lines
.
size
();
for
(
size_t
i
=
0
;
i
<
nLines
;
++
i
)
{
for
(
size_t
i
=
0
;
i
<
nLines
;
++
i
)
{
...
...
Source/kwsys/SystemTools.cxx
View file @
5e9bd8a2
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
#include KWSYS_HEADER(FStream.hxx)
#include KWSYS_HEADER(FStream.hxx)
#include KWSYS_HEADER(Encoding.hxx)
#include KWSYS_HEADER(Encoding.hxx)
#include <algorithm>
#include <fstream>
#include <fstream>
#include <iostream>
#include <iostream>
#include <set>
#include <set>
...
@@ -3708,6 +3709,16 @@ std::string SystemTools::JoinPath(
...
@@ -3708,6 +3709,16 @@ std::string SystemTools::JoinPath(
return
result
;
return
result
;
}
}
void
SystemTools
::
RemoveEmptyPathElements
(
std
::
vector
<
std
::
string
>&
path
)
{
if
(
path
.
empty
())
{
return
;
}
path
.
erase
(
std
::
remove
(
path
.
begin
()
+
1
,
path
.
end
(),
std
::
string
(
""
)),
path
.
end
());
}
bool
SystemTools
::
ComparePath
(
const
std
::
string
&
c1
,
const
std
::
string
&
c2
)
bool
SystemTools
::
ComparePath
(
const
std
::
string
&
c1
,
const
std
::
string
&
c2
)
{
{
#if defined(_WIN32) || defined(__APPLE__)
#if defined(_WIN32) || defined(__APPLE__)
...
...
Source/kwsys/SystemTools.hxx.in
View file @
5e9bd8a2
...
@@ -474,6 +474,10 @@ public:
...
@@ -474,6 +474,10 @@ public:
static std::string JoinPath(std::vector<std::string>::const_iterator first,
static std::string JoinPath(std::vector<std::string>::const_iterator first,
std::vector<std::string>::const_iterator last);
std::vector<std::string>::const_iterator last);
/** Removes empty components from path.
*/
static void RemoveEmptyPathElements(std::vector<std::string>& path);
/**
/**
* Compare a path or components of a path.
* Compare a path or components of a path.
*/
*/
...
...
Source/kwsys/testSystemTools.cxx
View file @
5e9bd8a2
...
@@ -54,7 +54,8 @@ static const char* toUnixPaths[][2] = {
...
@@ -54,7 +54,8 @@ static const char* toUnixPaths[][2] = {
{
0
,
0
}
{
0
,
0
}
};
};
static
bool
CheckConvertToUnixSlashes
(
std
::
string
input
,
std
::
string
output
)
static
bool
CheckConvertToUnixSlashes
(
std
::
string
const
&
input
,
std
::
string
const
&
output
)
{
{
std
::
string
result
=
input
;
std
::
string
result
=
input
;
kwsys
::
SystemTools
::
ConvertToUnixSlashes
(
result
);
kwsys
::
SystemTools
::
ConvertToUnixSlashes
(
result
);
...
@@ -71,8 +72,9 @@ static const char* checkEscapeChars[][4] = { { "1 foo 2 bar 2", "12", "\\",
...
@@ -71,8 +72,9 @@ static const char* checkEscapeChars[][4] = { { "1 foo 2 bar 2", "12", "\\",
{
" {} "
,
"{}"
,
"#"
,
" #{#} "
},
{
" {} "
,
"{}"
,
"#"
,
" #{#} "
},
{
0
,
0
,
0
,
0
}
};
{
0
,
0
,
0
,
0
}
};
static
bool
CheckEscapeChars
(
std
::
string
input
,
const
char
*
chars_to_escape
,
static
bool
CheckEscapeChars
(
std
::
string
const
&
input
,
char
escape_char
,
std
::
string
output
)
const
char
*
chars_to_escape
,
char
escape_char
,
std
::
string
const
&
output
)
{
{
std
::
string
result
=
kwsys
::
SystemTools
::
EscapeChars
(
std
::
string
result
=
kwsys
::
SystemTools
::
EscapeChars
(
input
.
c_str
(),
chars_to_escape
,
escape_char
);
input
.
c_str
(),
chars_to_escape
,
escape_char
);
...
...
Brad King
@brad.king
mentioned in commit
75850db6
·
Jun 01, 2017
mentioned in commit
75850db6
mentioned in commit 75850db66758ccdb4500ca0d580a2b97215a9357
Toggle commit list
Write
Preview
Markdown
is supported
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