You can now do:
MyMessage foo = MessageNano.mergeFrom(new MyMessage(), bytes);
without having to cast the message returned from mergeFrom.
Change-Id: Ibb2ad327f75855d45352ad304c7f054f20dd29c9
You can use the processor option store_unknown_fields to switch
this support on:
aprotoc --javanano_out=store_unknown_fields=true:/tmp/out
A separate option for extensions isn't required. Support
for unknown fields must be turned on to allow storing and
retrieving extensions, because they are just stored as
unknown fields. If unknown fields are switched on, extension
related code will be generated when a proto message includes
an extension range, or an extension is encountered.
By default, store_unknown_fields is false. No additional
code is generated, and the generator will error out if protos
contain extension ranges or extensions.
Change-Id: I1e034c9e8f3305612953f72438189a7da6ed2167
When the java_multiple_files option is on, enums are placed in java
class files based on the name of the original enum type. This fixes
field references to such enum values to point to the correct class
name when setting the default.
Change-Id: I51a2e251c0d0ab1e45a182ba849d314232a74bac
- All of the real work for printing the proto is actually done in
MessageNanoPrinter.
- Uses reflection to find proto-defined fields and prints those.
- Prints all fields, even defaults and nulls.
- Also added a simple test to make sure it handles all proto types well.
Tried not to make the test too brittle (but hey it's testing a toString()
so how flexible can it be)
Change-Id: I3e360ef8b0561041e010c1f3445ec45ecdcd2559
It didn't appear until API 9 and is thus incompatible with Froyo.
Instead, allocate a new array and System.arraycopy inline.
Change-Id: I2e1cd07a4a762ef8edd5ec06ceaa1d38b302823d
Like micro protobufs except:
- No setter/getter/hazzer functions.
- Has state is not available. Outputs all fields != their default.
- CodedInputStream can only take byte[] (not InputStream).
- Repeated fields are in arrays, not ArrayList or Vector.
- Unset messages/groups are null, not "defaultInstance()".
- Required fields are always serialized.
To use:
- Link libprotobuf-java-2.3.0-nano runtime.
- Use LOCAL_PROTOC_OPTIMIZE_TYPE := nano
Change-Id: I7429015b3c5f7f38b7be01eb2d4927f7a9999c80
Like micro protobufs except:
- No setter/getter/hazzer functions.
- Has state is not available. Outputs all fields != their default.
- CodedInputStream can only take byte[] (not InputStream).
- Repeated fields are in arrays, not ArrayList or Vector.
- Unset messages/groups are null, not "defaultInstance()".
- Required fields are always serialized.
To use:
- Link libprotobuf-java-2.3.0-nano runtime.
- Use LOCAL_PROTOC_OPTIMIZE_TYPE := nano
Change-Id: I7429015b3c5f7f38b7be01eb2d4927f7a9999c80
Adding new version of cpp library,
'libprotobuf-cpp-2.3.0-full-gnustl-rtti'. Previously, c++ code
compiled against gnustl couldn't link with this library - having
both gnustl and stlport in same binary leads to nasty conflicts.
Bug: 7484202
Change-Id: Ic4fbbfc2839c4ce88bf605cf3d9cca47b146f965
With gLucid protoc is installed in the base system, by renaming
our version there will be no confusion about which compiler is
being used.
Change-Id: I975e29e4444af9467c9b9600d5a2e7027f4046ae
We need this to generate code for .proto files that have
been added to external/chromium (see change I6960c18d).
Change-Id: Ic7a78273ee4f066680039d2f724e658a84869621