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
667f4a62
Commit
667f4a62
authored
Apr 07, 2016
by
Jon Skeet
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1393 from gvaish/master
Added support for internal_access for C#
parents
09292d57
a6e39316
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
1 deletion
+6
-1
csharp_generator.cc
src/google/protobuf/compiler/csharp/csharp_generator.cc
+2
-0
csharp_options.h
src/google/protobuf/compiler/csharp/csharp_options.h
+3
-0
csharp_source_generator_base.cc
.../protobuf/compiler/csharp/csharp_source_generator_base.cc
+1
-1
No files found.
src/google/protobuf/compiler/csharp/csharp_generator.cc
View file @
667f4a62
...
...
@@ -81,6 +81,8 @@ bool Generator::Generate(
}
else
if
(
options
[
i
].
first
==
"base_namespace"
)
{
cli_options
.
base_namespace
=
options
[
i
].
second
;
cli_options
.
base_namespace_specified
=
true
;
}
else
if
(
options
[
i
].
first
==
"internal_access"
)
{
cli_options
.
internal_access
=
true
;
}
else
{
*
error
=
"Unknown generator option: "
+
options
[
i
].
first
;
return
false
;
...
...
src/google/protobuf/compiler/csharp/csharp_options.h
View file @
667f4a62
...
...
@@ -64,6 +64,9 @@ struct Options {
// string, meaning "create a full directory hierarchy, starting from the first
// segment of the namespace."
bool
base_namespace_specified
;
// Whether the generated classes should have accessibility level of "internal".
// Defaults to false that generates "public" classes.
bool
internal_access
;
};
}
// namespace csharp
...
...
src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc
View file @
667f4a62
...
...
@@ -60,7 +60,7 @@ void SourceGeneratorBase::WriteGeneratedCodeAttributes(io::Printer* printer) {
}
std
::
string
SourceGeneratorBase
::
class_access_level
()
{
return
IsDescriptorProto
(
descriptor_
)
?
"internal"
:
"public"
;
// public_classes is always on.
return
(
IsDescriptorProto
(
descriptor_
)
||
this
->
options
()
->
internal_access
)
?
"internal"
:
"public"
;
}
const
Options
*
SourceGeneratorBase
::
options
()
{
...
...
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