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
a425dd97
Commit
a425dd97
authored
Sep 13, 2017
by
Bo Yang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename ClassNamePrefix to ConstantNamePrefix
parent
f46a01d0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
php_generator.cc
src/google/protobuf/compiler/php/php_generator.cc
+3
-4
No files found.
src/google/protobuf/compiler/php/php_generator.cc
View file @
a425dd97
...
...
@@ -166,8 +166,7 @@ std::string ClassNamePrefix(const string& classname,
return
""
;
}
std
::
string
ClassNamePrefix
(
const
string
&
classname
,
const
EnumValueDescriptor
*
desc
)
{
std
::
string
ConstantNamePrefix
(
const
string
&
classname
)
{
bool
is_reserved
=
false
;
string
lower
=
classname
;
...
...
@@ -729,7 +728,7 @@ void GenerateEnumToPool(const EnumDescriptor* en, io::Printer* printer) {
const
EnumValueDescriptor
*
value
=
en
->
value
(
i
);
printer
->
Print
(
"->value(
\"
^name^
\"
, ^number^)
\n
"
,
"name"
,
C
lassNamePrefix
(
value
->
name
(),
value
)
+
value
->
name
(),
"name"
,
C
onstantNamePrefix
(
value
->
name
()
)
+
value
->
name
(),
"number"
,
IntToString
(
value
->
number
()));
}
printer
->
Print
(
"->finalizeToPool();
\n\n
"
);
...
...
@@ -1032,7 +1031,7 @@ void GenerateEnumFile(const FileDescriptor* file, const EnumDescriptor* en,
const
EnumValueDescriptor
*
value
=
en
->
value
(
i
);
GenerateEnumValueDocComment
(
&
printer
,
value
);
printer
.
Print
(
"const ^name^ = ^number^;
\n
"
,
"name"
,
C
lassNamePrefix
(
value
->
name
(),
value
)
+
value
->
name
(),
"name"
,
C
onstantNamePrefix
(
value
->
name
()
)
+
value
->
name
(),
"number"
,
IntToString
(
value
->
number
()));
}
...
...
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