mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-10 07:06:26 +00:00
Protobufs: Added '--oneof-union' option. (#4647)
* Added '--oneof-union' option. Used with the .proto -> .fbs converter, will translate protobuff oneofs to flatbuffer unions. Updated proto test to check both methods of converting oneofs. * Added '--oneof-union' option. Used with the .proto -> .fbs converter, will translate protobuff oneofs to flatbuffer unions. Updated proto test to check both methods of converting oneofs. * FlatBuffers: Moved MakeCamel() into idl_parser.cpp Removes library dependency on Java/C# generator code.
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
77b458bee5
commit
fb94af8899
@@ -27,21 +27,6 @@
|
||||
|
||||
namespace flatbuffers {
|
||||
|
||||
// Convert an underscore_based_indentifier in to camelCase.
|
||||
// Also uppercases the first character if first is true.
|
||||
std::string MakeCamel(const std::string &in, bool first) {
|
||||
std::string s;
|
||||
for (size_t i = 0; i < in.length(); i++) {
|
||||
if (!i && first)
|
||||
s += static_cast<char>(toupper(in[0]));
|
||||
else if (in[i] == '_' && i + 1 < in.length())
|
||||
s += static_cast<char>(toupper(in[++i]));
|
||||
else
|
||||
s += in[i];
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
// These arrays need to correspond to the IDLOptions::k enum.
|
||||
|
||||
struct LanguageParameters {
|
||||
|
||||
Reference in New Issue
Block a user