update readme
This commit is contained in:
parent
b46aa2ba92
commit
4736cd1513
2 changed files with 12 additions and 2 deletions
12
README.md
12
README.md
|
@ -8,13 +8,25 @@ It doesn't do much yet.
|
|||
|
||||
You will need [SBT](http://scala-sbt.org). We recommend [this version](https://github.com/paulp/sbt-extras).
|
||||
|
||||
To compile:
|
||||
```
|
||||
$ sbt compile
|
||||
```
|
||||
|
||||
To read a message:
|
||||
```
|
||||
$ echo '(people = [(id = 123, name = "Alice", email = "alice@example.com", employment = (school = "MIT"))])' \
|
||||
| capnp encode examples/src/main/schema/addressbook.capnp AddressBook \
|
||||
| java -cp runtime/target/scala-2.11/classes:examples/target/scala-2.11/classes/ \
|
||||
org.capnproto.examples.AddressbookMain read
|
||||
```
|
||||
|
||||
To write a message:
|
||||
```
|
||||
$ java -cp runtime/target/scala-2.11/classes:examples/target/scala-2.11/classes/ \
|
||||
org.capnproto.examples.AddressbookMain write \
|
||||
| capnp decode examples/src/main/schema/addressbook.capnp AddressBook
|
||||
```
|
||||
|
||||
To generate IntelliJ project files, do `sbt update gen-idea`.
|
||||
|
||||
|
|
|
@ -15,8 +15,6 @@ import org.capnproto.examples.Addressbook.*;
|
|||
public class AddressbookMain {
|
||||
|
||||
public static void writeAddressBook() throws java.io.IOException {
|
||||
System.err.println("WARNING: writing is not yet fully implemented");
|
||||
|
||||
MessageBuilder message = new MessageBuilder();
|
||||
AddressBook.Builder addressbook = message.initRoot(AddressBook.Builder.factory);
|
||||
StructList.Builder<Person.Builder> people = addressbook.initPeople(2);
|
||||
|
|
Loading…
Reference in a new issue