This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

converted protobuffs_compile to use erltl

  • Loading branch information...
1 parent 6a668ae commit 62d3b963698d6d6fe86c370dfab8caf8858f4dd1 Jacob Vorreuter committed Jan 7, 2009
View
@@ -0,0 +1,6 @@
+#!/usr/bin/env escript
+%% -*- erlang -*-
+%%! -pa ebin -sasl errlog_type error -boot start_sasl -noshell
+
+main([Input]) ->
+ ok = protobuffs:generate(Input).
View
@@ -1,6 +1,6 @@
%% @doc A protcol buffers encoding and decoding module.
-module(protobuffs).
--export([encode/3, decode/2, decode_many/1]).
+-export([encode/3, decode/2, decode_many/1, generate/1]).
-define(TYPE_VARINT, 0).
-define(TYPE_64BIT, 1).
@@ -9,6 +9,11 @@
-define(TYPE_END_GROUP, 4).
-define(TYPE_32BIT, 5).
+generate(Input_Path) ->
+ IOList = protobuffs_compile:render(Input_Path),
+ ok = file:write_file(filename:basename(Input_Path, ".proto") ++ "_pb.erl", iolist_to_binary(IOList)),
+ ok.
+
%% @spec encode(FieldID, Value, Type) -> Result
%% FieldID = integer()
%% Value = any()
Oops, something went wrong.

0 comments on commit 62d3b96

Please sign in to comment.