Friday, 15 January 2010

java - Protogen Vs. Protoc Compiler Options -


I have some .proto files that are used to compile classes from Java, C ++ and C # Are there. I use Protok Compiler for Java and C ++ and use Protogen for C #. Java / C ++ class script to create

  @ECHO set SRC_DIR =% ~ dp0 REM Java and C Set ++ JAVA_OUT_DIR =% SRC_DIR% \ .. Make \ bull-Sndeshon- Java \ src \ main \ java if exist% JAVA_OUT_DIR% (mkdir% JAVA_OUT_DIR%) set CPP_OUT_DIR =% SRC_DIR% \ .. \ bull-messages-CPP does not exist,% CPP_OUT_DIR% (mkdir% CPP_OUT_DIR%) protoc I =% SRC_DIR% --java_out =% JAVA_OUT_DIR% --cpp_out =% CPP_OUT_DIR %% SRC_DIR% Vrisb- mux.proto protoc I =% SRC_DIR% --java_out =% JAVA_OUT_DIR% --cpp_out =% CPP_OUT_DIR %% SRC_DIR% Vrisb- backtest .proto  

and C # class generation I

  @ECHO set WORK_DIR =% ~ dp0 set OUT_ DIR =% WORK_DIR% \ Message =% WORK_DIR% to SRC_DIR set \ .. \ .. \ .. \ Cancer \ Trunk \ bull-messages-proto \ not exist% OUT_DIR% (mkdir% OUT_DIR%) CD% SRC_DIR % protogen -p: detectMissing I: taurus- backtest.proto -o:% OUT_DIR% \ TaurusBacktest.cs protogen -p: I detectMissing: Vrisb- mux.proto -o:% OUT_DIR% \ TaurusMux.cs CDs% WORK_DIR% < / Code> 

Both script references CE. Proto file (definitually;]) I have added the above C # script to generate the -p: detectMissing properties, I have permission to check whether a field is specified or not; The option creates * specified for all areas where isRequired = false .

My question is simple, I want to make sure that C #, C ++ and Java classes have to be aligned, but for C # me, -p: detecting Is the option to use with Proton to have equal option to use Protoc?

If I have correctly considered the question , Then there really is not an "equivalent" option - they are different tools used for different purposes. If your main driver is a similar use, then you want to see protobuf-csharp-port, which maintains very similar use while going to C #. On the contrary, ProtoBuff-Net does not try to present the same API as Google - it works as a idiomatic NAT serializer that talks in Protobf format.


No comments:

Post a Comment