| Mark Slee | 07a3aab | 2007-03-07 05:45:10 +0000 | [diff] [blame] | 1 | Thrift Tutorial | 
 | 2 |  | 
| Bryan Duxbury | def30a6 | 2009-04-08 00:19:37 +0000 | [diff] [blame] | 3 | License | 
 | 4 | ======= | 
 | 5 |  | 
 | 6 | Licensed to the Apache Software Foundation (ASF) under one | 
 | 7 | or more contributor license agreements. See the NOTICE file | 
 | 8 | distributed with this work for additional information | 
 | 9 | regarding copyright ownership. The ASF licenses this file | 
 | 10 | to you under the Apache License, Version 2.0 (the | 
 | 11 | "License"); you may not use this file except in compliance | 
 | 12 | with the License. You may obtain a copy of the License at | 
 | 13 |  | 
 | 14 |   http://www.apache.org/licenses/LICENSE-2.0 | 
 | 15 |  | 
 | 16 | Unless required by applicable law or agreed to in writing, | 
 | 17 | software distributed under the License is distributed on an | 
 | 18 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | 
 | 19 | KIND, either express or implied. See the License for the | 
 | 20 | specific language governing permissions and limitations | 
 | 21 | under the License. | 
| Mark Slee | 07a3aab | 2007-03-07 05:45:10 +0000 | [diff] [blame] | 22 |  | 
 | 23 | Tutorial | 
 | 24 | ======== | 
 | 25 |  | 
 | 26 | 1) First things first, you'll need to install the Thrift compiler and the | 
 | 27 |    language libraries. Do that using the instructions in the top level | 
 | 28 |    README file. | 
 | 29 |  | 
 | 30 | 2) Read tutorial.thrift to learn about the syntax of a Thrift file | 
 | 31 |  | 
| David Reiss | d1c8682 | 2009-03-25 22:15:18 +0000 | [diff] [blame] | 32 | 3) Compile the code for the language of your choice: | 
| Mark Slee | 07a3aab | 2007-03-07 05:45:10 +0000 | [diff] [blame] | 33 |  | 
| David Reiss | d1c8682 | 2009-03-25 22:15:18 +0000 | [diff] [blame] | 34 |      $ thrift | 
| David Reiss | 4438ca5 | 2009-03-26 06:14:17 +0000 | [diff] [blame] | 35 |      $ thrift -r --gen cpp tutorial.thrift | 
| Mark Slee | 07a3aab | 2007-03-07 05:45:10 +0000 | [diff] [blame] | 36 |  | 
 | 37 | 4) Take a look at the generated code. | 
 | 38 |  | 
 | 39 | 5) Look in the language directories for sample client/server code. | 
 | 40 |  | 
 | 41 | 6) That's about it for now. This tutorial is intentionally brief. It should be | 
 | 42 |    just enough to get you started and ready to build your own project. |