Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
ce180aa3
Commit
ce180aa3
authored
Jul 15, 2019
by
Laszlo Csomor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename expand_wildcards to correct style
parent
bc813c37
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
11 deletions
+11
-11
command_line_interface.cc
src/google/protobuf/compiler/command_line_interface.cc
+1
-1
io_win32.cc
src/google/protobuf/io/io_win32.cc
+1
-1
io_win32.h
src/google/protobuf/io/io_win32.h
+1
-1
io_win32_unittest.cc
src/google/protobuf/io/io_win32_unittest.cc
+8
-8
No files found.
src/google/protobuf/compiler/command_line_interface.cc
View file @
ce180aa3
...
...
@@ -1432,7 +1432,7 @@ CommandLineInterface::InterpretArgument(const std::string& name,
#if defined(_WIN32)
// On Windows, the shell (typically cmd.exe) does not expand wildcards in
// file names (e.g. foo\*.proto), so we do it ourselves.
switch
(
google
::
protobuf
::
io
::
win32
::
expand_w
ildcards
(
switch
(
google
::
protobuf
::
io
::
win32
::
ExpandW
ildcards
(
value
,
[
this
](
const
string
&
path
)
{
this
->
input_files_
.
push_back
(
path
);
...
...
src/google/protobuf/io/io_win32.cc
View file @
ce180aa3
...
...
@@ -362,7 +362,7 @@ wstring testonly_utf8_to_winpath(const char* path) {
return
as_windows_path
(
path
,
&
wpath
)
?
wpath
:
wstring
();
}
int
expand_w
ildcards
(
int
ExpandW
ildcards
(
const
string
&
path
,
std
::
function
<
void
(
const
string
&
)
>
consume
)
{
if
(
path
.
find_first_of
(
"*?"
)
==
string
::
npos
)
{
// There are no wildcards in the path, we don't need to expand it.
...
...
src/google/protobuf/io/io_win32.h
View file @
ce180aa3
...
...
@@ -93,7 +93,7 @@ struct ExpandWildcardsResult {
// `consume`. The resulting paths may not be absolute nor normalized.
//
// The function returns a value from `ExpandWildcardsResult`.
LIBPROTOBUF_EXPORT
int
expand_w
ildcards
(
LIBPROTOBUF_EXPORT
int
ExpandW
ildcards
(
const
std
::
string
&
path
,
std
::
function
<
void
(
const
std
::
string
&
)
>
consume
);
namespace
strings
{
...
...
src/google/protobuf/io/io_win32_unittest.cc
View file @
ce180aa3
...
...
@@ -430,7 +430,7 @@ TEST_F(IoWin32Test, ExpandWildcardsInRelativePathTest) {
vector
<
string
>
found_bad
;
// Assert matching a relative path pattern. Results should also be relative.
int
result
=
expand_w
ildcards
(
ExpandW
ildcards
(
string
(
kUtf8Text
)
+
"
\\
foo*.proto"
,
[
&
found_a
,
&
found_b
,
&
found_bad
](
const
string
&
p
)
{
if
(
p
==
string
(
kUtf8Text
)
+
"
\\
foo_a.proto"
)
{
...
...
@@ -452,7 +452,7 @@ TEST_F(IoWin32Test, ExpandWildcardsInRelativePathTest) {
found_a
=
0
;
found_bad
.
clear
();
result
=
expand_w
ildcards
(
ExpandW
ildcards
(
string
(
kUtf8Text
)
+
"
\\
foo_a.proto"
,
[
&
found_a
,
&
found_bad
](
const
string
&
p
)
{
if
(
p
==
string
(
kUtf8Text
)
+
"
\\
foo_a.proto"
)
{
...
...
@@ -482,7 +482,7 @@ TEST_F(IoWin32Test, ExpandWildcardsInAbsolutePathTest) {
// Assert matching an absolute path. The results should also use absolute
// path.
int
result
=
expand_w
ildcards
(
ExpandW
ildcards
(
string
(
test_tmpdir
)
+
"
\\
"
+
kUtf8Text
+
"
\\
foo*.proto"
,
[
this
,
&
found_a
,
&
found_b
,
&
found_bad
](
const
string
&
p
)
{
if
(
p
==
string
(
this
->
test_tmpdir
)
...
...
@@ -510,7 +510,7 @@ TEST_F(IoWin32Test, ExpandWildcardsInAbsolutePathTest) {
found_a
=
0
;
found_bad
.
clear
();
result
=
expand_w
ildcards
(
ExpandW
ildcards
(
string
(
test_tmpdir
)
+
"
\\
"
+
kUtf8Text
+
"
\\
foo_a.proto"
,
[
this
,
&
found_a
,
&
found_bad
](
const
string
&
p
)
{
if
(
p
==
string
(
this
->
test_tmpdir
)
...
...
@@ -545,7 +545,7 @@ TEST_F(IoWin32Test, ExpandWildcardsIgnoresDirectoriesTest) {
// Assert that the pattern matches exactly the expected files, and using the
// absolute path as did the input pattern.
int
result
=
expand_w
ildcards
(
ExpandW
ildcards
(
string
(
kUtf8Text
)
+
"
\\
foo*.proto"
,
[
&
found_a
,
&
found_c
,
&
found_bad
](
const
string
&
p
)
{
if
(
p
==
string
(
kUtf8Text
)
+
"
\\
foo_a.proto"
)
{
...
...
@@ -573,17 +573,17 @@ TEST_F(IoWin32Test, ExpandWildcardsFailsIfNoFileMatchesTest) {
EXPECT_TRUE
(
SetCurrentDirectoryW
(
wtest_tmpdir
.
c_str
()));
// Control test: should match foo*.proto
int
result
=
expand_w
ildcards
(
int
result
=
ExpandW
ildcards
(
string
(
kUtf8Text
)
+
"
\\
foo*.proto"
,
[](
const
string
&
)
{});
EXPECT_EQ
(
result
,
ExpandWildcardsResult
::
kSuccess
);
// Control test: should match foo_a.proto
result
=
expand_w
ildcards
(
result
=
ExpandW
ildcards
(
string
(
kUtf8Text
)
+
"
\\
foo_a.proto"
,
[](
const
string
&
)
{});
EXPECT_EQ
(
result
,
ExpandWildcardsResult
::
kSuccess
);
// Actual test: should not match anything.
result
=
expand_w
ildcards
(
result
=
ExpandW
ildcards
(
string
(
kUtf8Text
)
+
"
\\
bar*.proto"
,
[](
const
string
&
)
{});
ASSERT_EQ
(
result
,
ExpandWildcardsResult
::
kErrorNoMatchingFile
);
}
...
...
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