diff options
Diffstat (limited to 'src/google/protobuf/compiler/java/java_helpers.h')
-rw-r--r-- | src/google/protobuf/compiler/java/java_helpers.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/google/protobuf/compiler/java/java_helpers.h b/src/google/protobuf/compiler/java/java_helpers.h index 1ab168c4..00d683db 100644 --- a/src/google/protobuf/compiler/java/java_helpers.h +++ b/src/google/protobuf/compiler/java/java_helpers.h @@ -394,6 +394,26 @@ inline string GeneratedCodeVersionSuffix() { inline bool EnableExperimentalRuntime(Context* context) { return false; } + +void WriteUInt32ToUtf16CharSequence(uint32 number, std::vector<uint16>* output); + +inline void WriteIntToUtf16CharSequence(int value, + std::vector<uint16>* output) { + WriteUInt32ToUtf16CharSequence(static_cast<uint32>(value), output); +} + +// Escape a UTF-16 character so it can be embedded in a Java string literal. +void EscapeUtf16ToString(uint16 code, string* output); + +// Only the lowest two bytes of the return value are used. The lowest byte +// is the integer value of a j/c/g/protobuf/FieldType enum. For the other +// byte: +// bit 0: whether the field is required. +// bit 1: whether the field requires UTF-8 validation. +// bit 2: whether the field needs isInitialized check. +// bit 3: whether the field is a map field with proto2 enum value. +// bits 4-7: unused +int GetExperimentalJavaFieldType(const FieldDescriptor* field); } // namespace java } // namespace compiler } // namespace protobuf |