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
d90d615f
Commit
d90d615f
authored
Apr 12, 2016
by
Jon Skeet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Attempt to fix AppVeyor build by exporting GetEnumValueName
parent
790f4c8e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
csharp_helpers.cc
src/google/protobuf/compiler/csharp/csharp_helpers.cc
+5
-0
csharp_helpers.h
src/google/protobuf/compiler/csharp/csharp_helpers.h
+4
-1
No files found.
src/google/protobuf/compiler/csharp/csharp_helpers.cc
View file @
d90d615f
...
...
@@ -260,6 +260,11 @@ std::string TryRemovePrefix(const std::string& prefix, const std::string& value)
return
value
.
substr
(
value_index
);
}
// Format the enum value name in a pleasant way for C#:
// - Strip the enum name as a prefix if possible
// - Convert to PascalCase.
// For example, an enum called Color with a value of COLOR_BLUE should
// result in an enum value in C# called just Blue
std
::
string
GetEnumValueName
(
const
std
::
string
&
enum_name
,
const
std
::
string
&
enum_value_name
)
{
std
::
string
stripped
=
TryRemovePrefix
(
enum_name
,
enum_value_name
);
std
::
string
result
=
ShoutyToPascalCase
(
stripped
);
...
...
src/google/protobuf/compiler/csharp/csharp_helpers.h
View file @
d90d615f
...
...
@@ -36,6 +36,7 @@
#define GOOGLE_PROTOBUF_COMPILER_CSHARP_HELPERS_H__
#include <string>
#include <google/protobuf/stubs/port.h>
#include <google/protobuf/descriptor.pb.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/compiler/code_generator.h>
...
...
@@ -93,7 +94,9 @@ inline std::string UnderscoresToCamelCase(const std::string& input, bool cap_nex
std
::
string
UnderscoresToPascalCase
(
const
std
::
string
&
input
);
std
::
string
GetEnumValueName
(
const
std
::
string
&
enum_name
,
const
std
::
string
&
enum_value_name
);
// Note that we wouldn't normally want to export this (we're not expecting
// it to be used outside libprotoc itself) but this exposes it for testing.
std
::
string
LIBPROTOBUF_EXPORT
GetEnumValueName
(
const
std
::
string
&
enum_name
,
const
std
::
string
&
enum_value_name
);
// TODO(jtattermusch): perhaps we could move this to strutil
std
::
string
StringToBase64
(
const
std
::
string
&
input
);
...
...
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