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
060a2096
Commit
060a2096
authored
Dec 11, 2014
by
Krishna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reverted changes to cpp_helpers.cc and made code reviews to python_geenerator.cc
parent
7654f780
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
22 deletions
+21
-22
cpp_helpers.cc
src/google/protobuf/compiler/cpp/cpp_helpers.cc
+8
-17
python_generator.cc
src/google/protobuf/compiler/python/python_generator.cc
+12
-4
python_generator.h
src/google/protobuf/compiler/python/python_generator.h
+1
-1
No files found.
src/google/protobuf/compiler/cpp/cpp_helpers.cc
View file @
060a2096
...
...
@@ -360,31 +360,21 @@ string FilenameIdentifier(const string& filename) {
return
result
;
}
string
GlobalSymbolName
(
const
string
&
filename
,
string
prefix
)
{
return
prefix
+
FilenameIdentifier
(
filename
);
}
// Return the name of the AddDescriptors() function for a given file.
string
GlobalAddDescriptorsName
(
const
string
&
filename
)
{
return
GlobalSymbolName
(
filename
,
"protobuf_AddDesc_"
);
string
GlobalAddDescriptorsName
(
const
string
&
filename
)
{
return
"protobuf_AddDesc_"
+
FilenameIdentifier
(
filename
);
}
// Return the name of the AssignDescriptors() function for a given file.
string
GlobalAssignDescriptorsName
(
const
string
&
filename
)
{
return
GlobalSymbolName
(
filename
,
"protobuf_AssignDesc_"
);
string
GlobalAssignDescriptorsName
(
const
string
&
filename
)
{
return
"protobuf_AssignDesc_"
+
FilenameIdentifier
(
filename
);
}
// Return the name of the ShutdownFile() function for a given file.
string
GlobalShutdownFileName
(
const
string
&
filename
)
{
return
GlobalSymbolName
(
filename
,
"protobuf_ShutdownFile_"
);
string
GlobalShutdownFileName
(
const
string
&
filename
)
{
return
"protobuf_ShutdownFile_"
+
FilenameIdentifier
(
filename
);
}
// Return the qualified C++ name for a file level symbol.
string
QualifiedFileLevelSymbol
(
const
string
&
package
,
const
string
&
name
)
{
if
(
package
.
empty
())
{
...
...
@@ -521,4 +511,4 @@ bool IsStringOrMessage(const FieldDescriptor* field) {
}
// namespace cpp
}
// namespace compiler
}
// namespace protobuf
}
// namespace google
}
// namespace google
\ No newline at end of file
src/google/protobuf/compiler/python/python_generator.cc
View file @
060a2096
...
...
@@ -581,8 +581,7 @@ void Generator::PrintServiceDescriptor(
}
void
Generator
::
PrintDescriptorKeyAndModuleName
(
const
ServiceDescriptor
&
descriptor
,
const
char
*
keyandmodule
)
const
{
printer_
->
Print
(
keyandmodule
,
"class_name"
,
descriptor
.
name
());
void
Generator
::
PrintDescriptorKeyAndModuleName
(
const
ServiceDescriptor
&
descriptor
)
const
{
printer_
->
Indent
();
printer_
->
Print
(
"$descriptor_key$ = $descriptor_name$,
\n
"
,
...
...
@@ -596,11 +595,20 @@ void Generator::PrintDescriptorKeyAndModuleName(const ServiceDescriptor& descrip
}
void
Generator
::
PrintServiceClass
(
const
ServiceDescriptor
&
descriptor
)
const
{
Generator
::
PrintDescriptorKeyAndModuleName
(
descriptor
,
"$class_name$_Stub = service_reflection.GeneratedServiceStubType('$class_name$_Stub', ($class_name$,), dict(
\n
"
);
// Print the service.
printer_
->
Print
(
"$class_name$ = service_reflection.GeneratedServiceType("
"'$class_name$', (_service.Service,), dict(
\n
"
,
"class_name"
,
descriptor
.
name
());
Generator
::
PrintDescriptorKeyAndModuleName
(
descriptor
);
}
void
Generator
::
PrintServiceStub
(
const
ServiceDescriptor
&
descriptor
)
const
{
Generator
::
PrintDescriptorKeyAndModuleName
(
descriptor
,
"$class_name$ = service_reflection.GeneratedServiceType('$class_name$', (_service.Service,), dict(
\n
"
);
// Print the service stub.
printer_
->
Print
(
"$class_name$_Stub = "
"service_reflection.GeneratedServiceStubType("
"'$class_name$_Stub', ($class_name$,), dict(
\n
"
,
"class_name"
,
descriptor
.
name
());
Generator
::
PrintDescriptorKeyAndModuleName
(
descriptor
);
}
// Prints statement assigning ModuleLevelDescriptorName(message_descriptor)
...
...
src/google/protobuf/compiler/python/python_generator.h
View file @
060a2096
...
...
@@ -127,7 +127,7 @@ class LIBPROTOC_EXPORT Generator : public CodeGenerator {
void
PrintServiceDescriptor
(
const
ServiceDescriptor
&
descriptor
)
const
;
void
PrintServiceClass
(
const
ServiceDescriptor
&
descriptor
)
const
;
void
PrintServiceStub
(
const
ServiceDescriptor
&
descriptor
)
const
;
void
PrintDescriptorKeyAndModuleName
(
const
ServiceDescriptor
&
descriptor
,
const
char
*
keyandmodule
)
const
;
void
PrintDescriptorKeyAndModuleName
(
const
ServiceDescriptor
&
descriptor
)
const
;
void
PrintEnumValueDescriptor
(
const
EnumValueDescriptor
&
descriptor
)
const
;
string
OptionsValue
(
const
string
&
class_name
,
...
...
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