You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by Apache Wiki <wi...@apache.org> on 2008/11/02 22:16:56 UTC
[Thrift Wiki] Update of "ThriftGeneration" by HannesBaldursson
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Thrift Wiki" for change notification.
The following page has been changed by HannesBaldursson:
http://wiki.apache.org/thrift/ThriftGeneration
------------------------------------------------------------------------------
* Run thrift with the options for your language of choice. e.g. `thrift -php myproject.thrift`
* Your files will be generated in a sub directory called e.g. `gen-php`
+ Note: Make sure you don't name variables the same as their datatype - you WILL run in to trouble.
+
+ Consider this example BAD CODE:
+ {{{
+ #!/usr/local/bin/thrift -gen cpp
+ #
+
+ namespace cpp stuff
+
+ typedef i32 somevariable
+
+ service Example {
+
+ // Function that takes somevariable called somevariable and returns datatype somevariable
+ somevariable regenerate(1:somevarable somevariable),
+ }
+ }}}
+
+ Though the Thrift compiler compiles this example successfully the generated code will NOT compile.
+
+ Also note that using terms like "new" as a function name will cause errors in the generated code.
+