Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Publishing current coverage report

  • Loading branch information...
commit 05efe1697d5a8e7729815f2db5412303583a259b 1 parent d56929e
@ngerakines ngerakines authored
View
590 coverage/protobuffs_compile_report.html
@@ -0,0 +1,590 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
+ <head>
+ <title>protobuffs_compile - C0 code coverage information</title>
+ <style type='text/css'>body { background-color: rgb(240, 240, 245); }</style>
+ <style type='text/css'>span.marked0 {
+ background-color: rgb(185, 210, 200);
+ display: block;
+ }
+ span.marked1 {
+ background-color: rgb(190, 215, 205);
+ display: block;
+ }
+ span.inferred0 {
+ background-color: rgb(175, 200, 200);
+ display: block;
+ }
+ span.inferred1 {
+ background-color: rgb(180, 205, 205);
+ display: block;
+ }
+ span.uncovered0 {
+ background-color: rgb(225, 110, 110);
+ display: block;
+ }
+ span.uncovered1 {
+ background-color: rgb(235, 120, 120);
+ display: block;
+ }
+ span.overview {
+ border-bottom: 8px solid black;
+ }
+ div.overview {
+ border-bottom: 8px solid black;
+ }
+ body {
+ font-family: verdana, arial, helvetica;
+ }
+ div.footer {
+ font-size: 68%;
+ margin-top: 1.5em;
+ }
+ h1, h2, h3, h4, h5, h6 {
+ margin-bottom: 0.5em;
+ }
+ h5 {
+ margin-top: 0.5em;
+ }
+ .hidden {
+ display: none;
+ }
+ div.separator {
+ height: 10px;
+ }
+ table.percent_graph {
+ height: 12px;
+ border: #808080 1px solid;
+ empty-cells: show;
+ }
+ table.percent_graph td.covered {
+ height: 10px;
+ background: #00f000;
+ }
+ table.percent_graph td.uncovered {
+ height: 10px;
+ background: #e00000;
+ }
+ table.percent_graph td.NA {
+ height: 10px;
+ background: #eaeaea;
+ }
+ table.report {
+ border-collapse: collapse;
+ width: 100%;
+ }
+ table.report td.heading {
+ background: #dcecff;
+ border: #d0d0d0 1px solid;
+ font-weight: bold;
+ text-align: center;
+ }
+ table.report td.heading:hover {
+ background: #c0ffc0;
+ }
+ table.report td.text {
+ border: #d0d0d0 1px solid;
+ }
+ table.report td.value {
+ text-align: right;
+ border: #d0d0d0 1px solid;
+ }
+ table.report tr.light {
+ background-color: rgb(240, 240, 245);
+ }
+ table.report tr.dark {
+ background-color: rgb(230, 230, 235);
+ }
+ </style>
+ </head>
+ <body>
+ <h3>C0 code coverage information</h3>
+ <p>Generated on 2009-01-23 23:10:54 with <a href='http://github.com/ngerakines/etap'>etap 0.3.3</a>.
+ </p>
+ <table class='report'>
+ <thead>
+ <tr>
+ <td class='heading'>Name</td>
+ <td class='heading'>Total lines</td>
+ <td class='heading'>Lines of code</td>
+ <td class='heading'>Total coverage</td>
+ <td class='heading'>Code coverage</td>
+ </tr>
+ </thead>
+ <tbody>
+ <tr class='light'>
+
+ <td>
+ <a href='protobuffs_compile_report.html'>protobuffs_compile</a>
+ </td>
+ <td class='value'>
+ <tt>??</tt>
+ </td>
+ <td class='value'>
+ <tt>??</tt>
+ </td>
+ <td class='value'>
+ <tt>??</tt>
+ </td>
+ <td>
+ <table cellspacing='0' cellpadding='0' align='right'>
+ <tr>
+ <td><tt>63%</tt>&nbsp;</td><td>
+ <table cellspacing='0' class='percent_graph' cellpadding='0' width='100'>
+ <tr><td class='covered' width='101' /><td class='uncovered' width='60' /></tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </tbody>
+ </table><pre><span class="inferred0"><a name="line1"></a>....1 %% @doc Create modules for decoding and encoding protocolo buffers messages out of .proto files.
+</span><span class="inferred0"><a name="line2"></a>....2 -module(protobuffs_compile).
+</span><span class="inferred0"><a name="line3"></a>....3 -export([scan_file/1]).
+</span><span class="inferred0"><a name="line4"></a>....4
+</span><span class="inferred0"><a name="line5"></a>....5 %% @spec scan_file(string()) -> ok
+</span><span class="inferred0"><a name="line6"></a>....6 %% @doc Scan a .proto file and try to create a module for it. This process
+</span><span class="inferred0"><a name="line7"></a>....7 %% creates a number of encoding, decoding and validation functions for each
+</span><span class="inferred0"><a name="line8"></a>....8 %% message contained.
+</span><span class="inferred0"><a name="line9"></a>....9 scan_file(Filename) ->
+</span><span class="marked0"><a name="line10"></a>...10 {ok, Data} = file:read_file(Filename),
+</span><span class="marked0"><a name="line11"></a>...11 Raw = scan(binary_to_list(Data)),
+</span><span class="marked0"><a name="line12"></a>...12 Parsed = parse(Raw),
+</span><span class="marked0"><a name="line13"></a>...13 true = write_header(Parsed, filename:basename(Filename, ".proto") ++ "_pb.hrl"),
+</span><span class="marked0"><a name="line14"></a>...14 true = write_module(Parsed, filename:basename(Filename, ".proto") ++ "_pb.erl"),
+</span><span class="marked0"><a name="line15"></a>...15 ok.
+</span><span class="inferred0"><a name="line16"></a>...16
+</span><span class="inferred0"><a name="line17"></a>...17 %% @hidden
+</span><span class="marked0"><a name="line18"></a>...18 parse(Data) -> parse(Data, []).
+</span><span class="inferred0"><a name="line19"></a>...19
+</span><span class="inferred0"><a name="line20"></a>...20 %% @hidden
+</span><span class="marked0"><a name="line21"></a>...21 parse([], Acc) -> lists:reverse(Acc);
+</span><span class="marked0"><a name="line22"></a>...22 parse([{'}', _Line} | Tail], Acc) -> {Acc, Tail};
+</span><span class="inferred0"><a name="line23"></a>...23 parse([{enum, _Line}, {bareword, _Line, MessageName}, {'{', _Line} | Tail], Acc) ->
+</span><span class="uncovered0"><a name="line24"></a>...24 {Res, Tail2} = parse(Tail, []),
+</span><span class="uncovered0"><a name="line25"></a>...25 parse(Tail2, [{enum, MessageName, lists:reverse(Res)} | Acc]);
+</span><span class="inferred0"><a name="line26"></a>...26 parse([{message, _Line}, {bareword, _Line, MessageName}, {'{', _Line} | Tail], Acc) ->
+</span><span class="marked0"><a name="line27"></a>...27 {Res, Tail2} = parse(Tail, []),
+</span><span class="marked0"><a name="line28"></a>...28 parse(Tail2, [{message, MessageName, lists:reverse(Res)} | Acc]);
+</span><span class="inferred0"><a name="line29"></a>...29 parse([{bareword, _Line, FieldName}, {'=', _Line}, {number, _Line, Value}, {';', _Line} | Tail], Acc) ->
+</span><span class="uncovered0"><a name="line30"></a>...30 parse(Tail, [{enum, Value, FieldName} | Acc]);
+</span><span class="inferred0"><a name="line31"></a>...31 parse([{Type, _Line}, {bareword, _Line, Field}, {bareword, _Line, FieldName}, {'=', _Line}, {FieldType, _Line, Position}, {'[', _Line}, {bareword, _Line,"default"}, {'=', _Line}, {_DefaultType, _Line, Default}, {']', _Line}, {';', _Line} | Tail], Acc) ->
+</span><span class="marked0"><a name="line32"></a>...32 parse(Tail, [{Position, Type, Field, FieldName, FieldType, Default} | Acc]);
+</span><span class="inferred0"><a name="line33"></a>...33 parse([{Type, _Line}, {bareword, _Line, Field}, {bareword, _Line, FieldName}, {'=', _Line}, {FieldType, _Line, Position}, {';', _Line} | Tail], Acc) ->
+</span><span class="marked0"><a name="line34"></a>...34 parse(Tail, [{Position, Type, Field, FieldName, FieldType, none} | Acc]);
+</span><span class="inferred0"><a name="line35"></a>...35 parse([{'$end', _} | Tail], Acc) ->
+</span><span class="marked0"><a name="line36"></a>...36 parse(Tail, Acc);
+</span><span class="inferred0"><a name="line37"></a>...37 parse([Head | Tail], Acc) ->
+</span><span class="uncovered0"><a name="line38"></a>...38 parse(Tail, [Head | Acc]).
+</span><span class="inferred0"><a name="line39"></a>...39
+</span><span class="inferred0"><a name="line40"></a>...40 %% @hidden
+</span><span class="inferred0"><a name="line41"></a>...41 write_header(Data, Filename) ->
+</span><span class="marked0"><a name="line42"></a>...42 Messages = collect_messages(Data, []),
+</span><span class="marked0"><a name="line43"></a>...43 {ok, FileRef} = file:open(Filename, [write]),
+</span><span class="marked0"><a name="line44"></a>...44 lists:foreach(
+</span><span class="inferred0"><a name="line45"></a>...45 fun({Name, Fields}) ->
+</span><span class="marked0"><a name="line46"></a>...46 OutFields = [string:to_lower(B) || {_A, B} <- lists:keysort(1, Fields)],
+</span><span class="marked0"><a name="line47"></a>...47 JoinedFields = string:join(OutFields, ", "),
+</span><span class="marked0"><a name="line48"></a>...48 io:format(FileRef, "-record(~s, {~s}).~n", [string:to_lower(Name), JoinedFields])
+</span><span class="inferred0"><a name="line49"></a>...49 end,
+</span><span class="inferred0"><a name="line50"></a>...50 Messages
+</span><span class="inferred0"><a name="line51"></a>...51 ),
+</span><span class="marked0"><a name="line52"></a>...52 ok == file:close(FileRef).
+</span><span class="inferred0"><a name="line53"></a>...53
+</span><span class="inferred0"><a name="line54"></a>...54 %% @hidden
+</span><span class="inferred0"><a name="line55"></a>...55 write_module(Data, Filename) ->
+</span><span class="marked0"><a name="line56"></a>...56 Messages = collect_full_messages(Data, []),
+</span><span class="marked0"><a name="line57"></a>...57 {ok, FileRef} = file:open(Filename, [write]),
+</span><span class="marked0"><a name="line58"></a>...58 io:format(FileRef, "-module(~s).~n", [filename:basename(Filename, ".erl")]),
+</span><span class="marked0"><a name="line59"></a>...59 DecodeString = string:join(
+</span><span class="inferred0"><a name="line60"></a>...60 ["decode_" ++ string:to_lower(Name) ++ "/1" || {Name, _} <- Messages] ++
+</span><span class="inferred0"><a name="line61"></a>...61 ["encode_" ++ string:to_lower(Name) ++ "/1" || {Name, _} <- Messages]
+</span><span class="inferred0"><a name="line62"></a>...62 ,", "),
+</span><span class="marked0"><a name="line63"></a>...63 io:format(FileRef, "-export([~s]).~n", [DecodeString]),
+</span><span class="marked0"><a name="line64"></a>...64 io:format(FileRef, "-include(\"~s\").~n~n", [filename:basename(Filename, ".erl") ++ ".hrl"]),
+</span><span class="marked0"><a name="line65"></a>...65 write_decode_message(FileRef, Messages),
+</span><span class="marked0"><a name="line66"></a>...66 write_encode_message(FileRef, Messages),
+</span><span class="marked0"><a name="line67"></a>...67 ok == file:close(FileRef).
+</span><span class="inferred0"><a name="line68"></a>...68
+</span><span class="inferred0"><a name="line69"></a>...69 %% @hidden
+</span><span class="marked0"><a name="line70"></a>...70 write_encode_message(_, []) -> ok;
+</span><span class="inferred0"><a name="line71"></a>...71 write_encode_message(FileRef, [{Name, Fields} |Tail]) ->
+</span><span class="marked0"><a name="line72"></a>...72 EncodeElements = lists:foldl(
+</span><span class="inferred0"><a name="line73"></a>...73 fun(Field, Acc) ->
+</span><span class="marked0"><a name="line74"></a>...74 {Position, Rule, FieldType, FieldName, _, Default} = Field,
+</span><span class="marked0"><a name="line75"></a>...75 [io_lib:format("{~p, ~p, Rec#~s.~s, ~p, ~p}", [Position, Rule, string:to_lower(Name), FieldName, list_to_atom(string:to_lower(FieldType)), Default]) | Acc]
+</span><span class="inferred0"><a name="line76"></a>...76 end,
+</span><span class="inferred0"><a name="line77"></a>...77 [],
+</span><span class="inferred0"><a name="line78"></a>...78 lists:keysort(1, Fields)
+</span><span class="inferred0"><a name="line79"></a>...79 ),
+</span><span class="marked0"><a name="line80"></a>...80 EncodeString = string:join(lists:reverse(EncodeElements), ", "),
+</span><span class="marked0"><a name="line81"></a>...81 io:format(
+</span><span class="inferred0"><a name="line82"></a>...82 FileRef,
+</span><span class="inferred0"><a name="line83"></a>...83 "encode_~s(Rec) -> ~n"
+</span><span class="inferred0"><a name="line84"></a>...84 " EncodeData = [~s], ~n"
+</span><span class="inferred0"><a name="line85"></a>...85 " erlang:iolist_to_binary(lists:reverse(lists:foldl(fun({Pos, Rule, Data, Type, Default}, Acc) ->
+</span><span class="inferred0"><a name="line86"></a>...86 case [Rule, Data, Type] of
+</span><span class="inferred0"><a name="line87"></a>...87 [_, undefined, _] ->
+</span><span class="inferred0"><a name="line88"></a>...88 case Default of
+</span><span class="inferred0"><a name="line89"></a>...89 none -> Acc;
+</span><span class="inferred0"><a name="line90"></a>...90 _ ->
+</span><span class="inferred0"><a name="line91"></a>...91 [protobuffs:encode(Pos, Data, Type) | Acc]
+</span><span class="inferred0"><a name="line92"></a>...92 end;
+</span><span class="inferred0"><a name="line93"></a>...93 [_, Data, Type] when is_binary(Data), Type =/= bytes ->
+</span><span class="inferred0"><a name="line94"></a>...94 [protobuffs:encode(Pos, Data, bytes) | Acc];
+</span><span class="inferred0"><a name="line95"></a>...95 [_, Data, Type] when is_tuple(Data) ->
+</span><span class="inferred0"><a name="line96"></a>...96 [RecName | _] = erlang:tuple_to_list(Data),
+</span><span class="inferred0"><a name="line97"></a>...97 ToEncode = apply(?MODULE, list_to_atom(\"encode_\" ++ atom_to_list(RecName)), [Data]),
+</span><span class="inferred0"><a name="line98"></a>...98 [protobuffs:encode(Pos, ToEncode, bytes) | Acc];
+</span><span class="inferred0"><a name="line99"></a>...99 [repeated, [Head|_]=List, Type] when is_tuple(Head) ->
+</span><span class="inferred0"><a name="line100"></a>..100 [RecName | _] = erlang:tuple_to_list(Head),
+</span><span class="inferred0"><a name="line101"></a>..101 Encoded =
+</span><span class="inferred0"><a name="line102"></a>..102 list_to_binary([begin
+</span><span class="inferred0"><a name="line103"></a>..103 Method = list_to_atom(\"encode_\" ++ atom_to_list(RecName)),
+</span><span class="inferred0"><a name="line104"></a>..104 ToEncode = apply(?MODULE, Method, [Record]),
+</span><span class="inferred0"><a name="line105"></a>..105 protobuffs:encode(Pos, ToEncode, bytes)
+</span><span class="inferred0"><a name="line106"></a>..106 end || Record <- List]),
+</span><span class="inferred0"><a name="line107"></a>..107 [Encoded | Acc];
+</span><span class="inferred0"><a name="line108"></a>..108 [repeated, List, Type] ->
+</span><span class="inferred0"><a name="line109"></a>..109 Encoded = [protobuffs:encode(Pos, Item, Type) || Item <- List],
+</span><span class="inferred0"><a name="line110"></a>..110 [Encoded | Acc];
+</span><span class="inferred0"><a name="line111"></a>..111 [_, Data, Type] ->
+</span><span class="inferred0"><a name="line112"></a>..112 case atom_to_list(Type) of
+</span><span class="inferred0"><a name="line113"></a>..113 \"int\" ++ _ when is_list(Data) ->
+</span><span class="inferred0"><a name="line114"></a>..114 [protobuffs:encode(Pos, list_to_integer(Data), Type) | Acc];
+</span><span class="inferred0"><a name="line115"></a>..115 _ ->
+</span><span class="inferred0"><a name="line116"></a>..116 [protobuffs:encode(Pos, Data, Type) | Acc]
+</span><span class="inferred0"><a name="line117"></a>..117 end
+</span><span class="inferred0"><a name="line118"></a>..118 end
+</span><span class="inferred0"><a name="line119"></a>..119 end,[], EncodeData))). ~n~n",
+</span><span class="inferred0"><a name="line120"></a>..120 [string:to_lower(Name), EncodeString]
+</span><span class="inferred0"><a name="line121"></a>..121 ),
+</span><span class="marked0"><a name="line122"></a>..122 write_encode_message(FileRef, Tail).
+</span><span class="inferred0"><a name="line123"></a>..123
+</span><span class="inferred0"><a name="line124"></a>..124 %% @hidden
+</span><span class="marked0"><a name="line125"></a>..125 write_decode_message(_, []) -> ok;
+</span><span class="inferred0"><a name="line126"></a>..126 write_decode_message(FileRef, [{Name, Fields} | Tail]) ->
+</span><span class="marked0"><a name="line127"></a>..127 AllElements = lists:foldl(
+</span><span class="inferred0"><a name="line128"></a>..128 fun(Field, Acc) ->
+</span><span class="marked0"><a name="line129"></a>..129 case Field of
+</span><span class="marked0"><a name="line130"></a>..130 {_, _, _, _, _, none} -> Acc;
+</span><span class="inferred0"><a name="line131"></a>..131 {Position, _, _, _, _, Default} ->
+</span><span class="marked0"><a name="line132"></a>..132 [io_lib:format("{~p, ~p}", [Position, Default]) | Acc]
+</span><span class="inferred0"><a name="line133"></a>..133 end
+</span><span class="inferred0"><a name="line134"></a>..134 end,
+</span><span class="inferred0"><a name="line135"></a>..135 [],
+</span><span class="inferred0"><a name="line136"></a>..136 lists:keysort(1, Fields)
+</span><span class="inferred0"><a name="line137"></a>..137 ),
+</span><span class="marked0"><a name="line138"></a>..138 AllElementsString = string:join(lists:reverse(AllElements), ", "),
+</span><span class="marked0"><a name="line139"></a>..139 io:format(
+</span><span class="inferred0"><a name="line140"></a>..140 FileRef,
+</span><span class="inferred0"><a name="line141"></a>..141 "decode_~s(Data) when is_binary(Data) -> ~n"
+</span><span class="inferred0"><a name="line142"></a>..142 " DecodedData = protobuffs:decode_many(Data), ~n"
+</span><span class="inferred0"><a name="line143"></a>..143 " ~s_to_record(DecodedData ++ [~s]).~n~n",
+</span><span class="inferred0"><a name="line144"></a>..144 [string:to_lower(Name), string:to_lower(Name), AllElementsString]
+</span><span class="inferred0"><a name="line145"></a>..145 ),
+</span><span class="marked0"><a name="line146"></a>..146 CasePosString = lists:foldl(
+</span><span class="inferred0"><a name="line147"></a>..147 fun(Field, Acc) ->
+</span><span class="marked0"><a name="line148"></a>..148 case Field of
+</span><span class="inferred0"><a name="line149"></a>..149 {FPos, repeated, [C|_]=RecName, FName, _, _}
+</span><span class="inferred0"><a name="line150"></a>..150 when C >= $A, C =< $Z ->
+</span><span class="inferred0"><a name="line151"></a>..151 io_lib:format(" {~p, Data} -> ~n"
+</span><span class="inferred0"><a name="line152"></a>..152 " DecodedData = apply(?MODULE, decode_~s, [Data]), ~n"
+</span><span class="inferred0"><a name="line153"></a>..153 " case Rec#~s.~s of~n"
+</span><span class="inferred0"><a name="line154"></a>..154 " undefined -> ~n"
+</span><span class="inferred0"><a name="line155"></a>..155 " Rec#~s{ ~s = [DecodedData]};~n"
+</span><span class="inferred0"><a name="line156"></a>..156 " List -> ~n"
+</span><span class="inferred0"><a name="line157"></a>..157 " Rec#~s{ ~s = [DecodedData | List] }~n"
+</span><span class="inferred0"><a name="line158"></a>..158 " end;~n",
+</span><span class="marked0"><a name="line159"></a>..159 [FPos, string:to_lower(RecName), string:to_lower(Name), FName, string:to_lower(Name), FName, string:to_lower(Name), FName]) ++ Acc;
+</span><span class="inferred0"><a name="line160"></a>..160 {FPos, repeated, FType, FName, _, _} ->
+</span><span class="marked0"><a name="line161"></a>..161 DecodedData =
+</span><span class="inferred0"><a name="line162"></a>..162 case FType of
+</span><span class="marked0"><a name="line163"></a>..163 "string" -> "binary_to_list(Data)";
+</span><span class="uncovered0"><a name="line164"></a>..164 _ -> "Data"
+</span><span class="inferred0"><a name="line165"></a>..165 end,
+</span><span class="inferred0"><a name="line166"></a>..166 io_lib:format(" {~p, Data} -> ~n"
+</span><span class="inferred0"><a name="line167"></a>..167 " DecodedData = ~s,~n"
+</span><span class="inferred0"><a name="line168"></a>..168 " case Rec#~s.~s of~n"
+</span><span class="inferred0"><a name="line169"></a>..169 " undefined -> ~n"
+</span><span class="inferred0"><a name="line170"></a>..170 " Rec#~s{ ~s = [DecodedData]};~n"
+</span><span class="inferred0"><a name="line171"></a>..171 " List -> ~n"
+</span><span class="inferred0"><a name="line172"></a>..172 " Rec#~s{ ~s = [DecodedData | List] }~n"
+</span><span class="inferred0"><a name="line173"></a>..173 " end;~n",
+</span><span class="marked0"><a name="line174"></a>..174 [FPos, DecodedData, string:to_lower(Name), FName, string:to_lower(Name), FName, string:to_lower(Name), FName]) ++ Acc;
+</span><span class="inferred0"><a name="line175"></a>..175 {FPos, _, [C|_]=RecName, FName, _, _}
+</span><span class="inferred0"><a name="line176"></a>..176 when C >= $A, C =< $Z->
+</span><span class="inferred0"><a name="line177"></a>..177 io_lib:format(" {~p, Data} -> ~n"
+</span><span class="inferred0"><a name="line178"></a>..178 " Data1 = apply(?MODULE, decode_~s, [Data]),~n"
+</span><span class="marked0"><a name="line179"></a>..179 " Rec#~s{ ~s = Data1};~n", [FPos, string:to_lower(RecName), string:to_lower(Name), FName]) ++ Acc;
+</span><span class="inferred0"><a name="line180"></a>..180 {FPos, _, FType, FName, _, Default} ->
+</span><span class="marked0"><a name="line181"></a>..181 DecodedData =
+</span><span class="inferred0"><a name="line182"></a>..182 case FType of
+</span><span class="marked0"><a name="line183"></a>..183 "string" -> "binary_to_list(Data)";
+</span><span class="marked0"><a name="line184"></a>..184 _ -> "Data"
+</span><span class="inferred0"><a name="line185"></a>..185 end,
+</span><span class="inferred0"><a name="line186"></a>..186 io_lib:format(
+</span><span class="inferred0"><a name="line187"></a>..187 " {~p, Data} -> ~n"
+</span><span class="inferred0"><a name="line188"></a>..188 " DecodedData = ~s,~n"
+</span><span class="inferred0"><a name="line189"></a>..189 " Rec#~s{ ~s = DecodedData};~n",
+</span><span class="inferred0"><a name="line190"></a>..190 [FPos, DecodedData, string:to_lower(Name), FName]
+</span><span class="marked0"><a name="line191"></a>..191 ) ++ Acc
+</span><span class="inferred0"><a name="line192"></a>..192 end
+</span><span class="inferred0"><a name="line193"></a>..193 end, "", Fields),
+</span><span class="marked0"><a name="line194"></a>..194 io:format(
+</span><span class="inferred0"><a name="line195"></a>..195 FileRef,
+</span><span class="inferred0"><a name="line196"></a>..196 "~s_to_record(DecodedData) -> ~n"
+</span><span class="inferred0"><a name="line197"></a>..197 " ~s_to_record(DecodedData, #~s{}). ~n"
+</span><span class="inferred0"><a name="line198"></a>..198 "~s_to_record([], Acc) -> Acc; ~n"
+</span><span class="inferred0"><a name="line199"></a>..199 "~s_to_record([Head | Tail], Rec) -> ~n"
+</span><span class="inferred0"><a name="line200"></a>..200 " NewRec = case Head of ~n~s"
+</span><span class="inferred0"><a name="line201"></a>..201 " _ -> Rec %% Ruh-roh ~n"
+</span><span class="inferred0"><a name="line202"></a>..202 " end, ~n"
+</span><span class="inferred0"><a name="line203"></a>..203 " ~s_to_record(Tail, NewRec).~n~n",
+</span><span class="inferred0"><a name="line204"></a>..204 [
+</span><span class="inferred0"><a name="line205"></a>..205 string:to_lower(Name), string:to_lower(Name),
+</span><span class="inferred0"><a name="line206"></a>..206 string:to_lower(Name), string:to_lower(Name),
+</span><span class="inferred0"><a name="line207"></a>..207 string:to_lower(Name),
+</span><span class="inferred0"><a name="line208"></a>..208 CasePosString, string:to_lower(Name)
+</span><span class="inferred0"><a name="line209"></a>..209 ]
+</span><span class="inferred0"><a name="line210"></a>..210 ),
+</span><span class="marked0"><a name="line211"></a>..211 write_decode_message(FileRef, Tail).
+</span><span class="inferred0"><a name="line212"></a>..212
+</span><span class="inferred0"><a name="line213"></a>..213 %% @hidden
+</span><span class="marked0"><a name="line214"></a>..214 collect_messages([], Acc) -> Acc;
+</span><span class="inferred0"><a name="line215"></a>..215 collect_messages([{message, Name, Fields} | Tail], Acc) ->
+</span><span class="marked0"><a name="line216"></a>..216 FieldsOut = lists:foldl(
+</span><span class="inferred0"><a name="line217"></a>..217 fun ({A, _, _, B, _, _}, TmpAcc) ->
+</span><span class="marked0"><a name="line218"></a>..218 [{A, B} | TmpAcc];
+</span><span class="uncovered0"><a name="line219"></a>..219 (_, TmpAcc) -> TmpAcc
+</span><span class="inferred0"><a name="line220"></a>..220 end,
+</span><span class="inferred0"><a name="line221"></a>..221 [],
+</span><span class="inferred0"><a name="line222"></a>..222 Fields
+</span><span class="inferred0"><a name="line223"></a>..223 ),
+</span><span class="marked0"><a name="line224"></a>..224 SubMessages = lists:foldl(
+</span><span class="uncovered0"><a name="line225"></a>..225 fun ({message, C, D}, TmpAcc) -> [{message, C, D} | TmpAcc];
+</span><span class="marked0"><a name="line226"></a>..226 (_, TmpAcc) -> TmpAcc
+</span><span class="inferred0"><a name="line227"></a>..227 end,
+</span><span class="inferred0"><a name="line228"></a>..228 [],
+</span><span class="inferred0"><a name="line229"></a>..229 Fields
+</span><span class="inferred0"><a name="line230"></a>..230 ),
+</span><span class="marked0"><a name="line231"></a>..231 collect_messages(Tail ++ SubMessages, [{Name, FieldsOut} | Acc]).
+</span><span class="inferred0"><a name="line232"></a>..232
+</span><span class="inferred0"><a name="line233"></a>..233 %% @hidden
+</span><span class="marked0"><a name="line234"></a>..234 collect_full_messages([], Acc) -> Acc;
+</span><span class="inferred0"><a name="line235"></a>..235 collect_full_messages([{message, Name, Fields} | Tail], Acc) ->
+</span><span class="marked0"><a name="line236"></a>..236 FieldsOut = lists:foldl(
+</span><span class="inferred0"><a name="line237"></a>..237 fun (Input, TmpAcc) ->
+</span><span class="marked0"><a name="line238"></a>..238 case Input of
+</span><span class="marked0"><a name="line239"></a>..239 {_, _, _, _, _, _} -> [Input | TmpAcc];
+</span><span class="uncovered0"><a name="line240"></a>..240 _ -> TmpAcc
+</span><span class="inferred0"><a name="line241"></a>..241 end
+</span><span class="inferred0"><a name="line242"></a>..242 end,
+</span><span class="inferred0"><a name="line243"></a>..243 [],
+</span><span class="inferred0"><a name="line244"></a>..244 Fields
+</span><span class="inferred0"><a name="line245"></a>..245 ),
+</span><span class="marked0"><a name="line246"></a>..246 SubMessages = lists:foldl(
+</span><span class="uncovered0"><a name="line247"></a>..247 fun ({message, C, D}, TmpAcc) -> [{message, C, D} | TmpAcc];
+</span><span class="marked0"><a name="line248"></a>..248 (_, TmpAcc) -> TmpAcc
+</span><span class="inferred0"><a name="line249"></a>..249 end,
+</span><span class="inferred0"><a name="line250"></a>..250 [],
+</span><span class="inferred0"><a name="line251"></a>..251 Fields
+</span><span class="inferred0"><a name="line252"></a>..252 ),
+</span><span class="marked0"><a name="line253"></a>..253 collect_full_messages(Tail ++ SubMessages, [{Name, FieldsOut} | Acc]).
+</span><span class="inferred0"><a name="line254"></a>..254
+</span><span class="inferred0"><a name="line255"></a>..255 scan(String) ->
+</span><span class="marked0"><a name="line256"></a>..256 scan(String, [], 1).
+</span><span class="inferred0"><a name="line257"></a>..257
+</span><span class="inferred0"><a name="line258"></a>..258 %% @hidden
+</span><span class="inferred0"><a name="line259"></a>..259 scan([${|Rest], Accum, Line) ->
+</span><span class="marked0"><a name="line260"></a>..260 scan(Rest, [{'{', Line}|Accum], Line);
+</span><span class="inferred0"><a name="line261"></a>..261 scan([$}|Rest], Accum, Line) ->
+</span><span class="marked0"><a name="line262"></a>..262 scan(Rest, [{'}', Line}|Accum], Line);
+</span><span class="inferred0"><a name="line263"></a>..263 scan([$[|Rest], Accum, Line) ->
+</span><span class="marked0"><a name="line264"></a>..264 scan(Rest, [{'[', Line}|Accum], Line);
+</span><span class="inferred0"><a name="line265"></a>..265 scan([$]|Rest], Accum, Line) ->
+</span><span class="marked0"><a name="line266"></a>..266 scan(Rest, [{']', Line}|Accum], Line);
+</span><span class="inferred0"><a name="line267"></a>..267 scan([$(|Rest], Accum, Line) ->
+</span><span class="uncovered0"><a name="line268"></a>..268 scan(Rest, [{'(', Line}|Accum], Line);
+</span><span class="inferred0"><a name="line269"></a>..269 scan([$)|Rest], Accum, Line) ->
+</span><span class="uncovered0"><a name="line270"></a>..270 scan(Rest, [{')', Line}|Accum], Line);
+</span><span class="inferred0"><a name="line271"></a>..271 scan([$=|Rest], Accum, Line) ->
+</span><span class="marked0"><a name="line272"></a>..272 scan(Rest, [{'=', Line}|Accum], Line);
+</span><span class="inferred0"><a name="line273"></a>..273 scan([$;|Rest], Accum, Line) ->
+</span><span class="marked0"><a name="line274"></a>..274 scan(Rest, [{';', Line}|Accum], Line);
+</span><span class="inferred0"><a name="line275"></a>..275 scan([$,|Rest], Accum, Line) ->
+</span><span class="uncovered0"><a name="line276"></a>..276 scan(Rest, [{',', Line}|Accum], Line);
+</span><span class="inferred0"><a name="line277"></a>..277 scan([Digit|_] = String, Accum, Line)
+</span><span class="inferred0"><a name="line278"></a>..278 when Digit >= $0, Digit =< $9 ->
+</span><span class="marked0"><a name="line279"></a>..279 {Number, Rest} = scan_number(String),
+</span><span class="marked0"><a name="line280"></a>..280 scan(Rest, [{number, Line, Number}|Accum], Line);
+</span><span class="inferred0"><a name="line281"></a>..281 scan([$-, Digit|_] = String, Accum, Line)
+</span><span class="inferred0"><a name="line282"></a>..282 when Digit >= $0, Digit =< $9 ->
+</span><span class="uncovered0"><a name="line283"></a>..283 {Number, Rest} = scan_number(tl(String)),
+</span><span class="uncovered0"><a name="line284"></a>..284 scan(Rest, [{number, Line, -Number}|Accum], Line);
+</span><span class="inferred0"><a name="line285"></a>..285 scan([$\n|Rest], Accum, Line) ->
+</span><span class="marked0"><a name="line286"></a>..286 scan(Rest, Accum, Line + 1);
+</span><span class="inferred0"><a name="line287"></a>..287 scan([WS|Rest], Accum, Line)
+</span><span class="inferred0"><a name="line288"></a>..288 when WS =:= 32; WS =:= $\t ->
+</span><span class="marked0"><a name="line289"></a>..289 scan(Rest, Accum, Line);
+</span><span class="inferred0"><a name="line290"></a>..290 scan([$/, $/|Rest], Accum, Line) ->
+</span><span class="uncovered0"><a name="line291"></a>..291 scan(skip_to_newline(Rest), Accum, Line);
+</span><span class="inferred0"><a name="line292"></a>..292 scan([$/, $*|Rest], Accum, Line) ->
+</span><span class="uncovered0"><a name="line293"></a>..293 {Rest1, Line1} = skip_comment(Rest, Line),
+</span><span class="uncovered0"><a name="line294"></a>..294 scan(Rest1, Accum, Line1);
+</span><span class="inferred0"><a name="line295"></a>..295 scan([$"|_] = String, Accum, Line) ->
+</span><span class="uncovered0"><a name="line296"></a>..296 {Strval, Rest, Line1} = scan_string(String, Line),
+</span><span class="uncovered0"><a name="line297"></a>..297 scan(Rest, [{string, Line, Strval}|Accum], Line1);
+</span><span class="inferred0"><a name="line298"></a>..298 scan([C|_] = String, Accum, Line)
+</span><span class="inferred0"><a name="line299"></a>..299 when C >= $A, C =< $Z;
+</span><span class="inferred0"><a name="line300"></a>..300 C >= $a, C =< $z;
+</span><span class="inferred0"><a name="line301"></a>..301 C =:= $_ ->
+</span><span class="marked0"><a name="line302"></a>..302 {Identifier, Rest} = scan_identifier(String),
+</span><span class="marked0"><a name="line303"></a>..303 Token = case get_keyword(Identifier) of
+</span><span class="inferred0"><a name="line304"></a>..304 Keyword when is_atom(Keyword) ->
+</span><span class="marked0"><a name="line305"></a>..305 {Keyword, Line};
+</span><span class="inferred0"><a name="line306"></a>..306 {bareword, Bareword} ->
+</span><span class="marked0"><a name="line307"></a>..307 {bareword, Line, Bareword}
+</span><span class="inferred0"><a name="line308"></a>..308 end,
+</span><span class="marked0"><a name="line309"></a>..309 scan(Rest, [Token|Accum], Line);
+</span><span class="inferred0"><a name="line310"></a>..310 scan([], Accum, Line) ->
+</span><span class="marked0"><a name="line311"></a>..311 lists:reverse([{'$end', Line}|Accum]);
+</span><span class="inferred0"><a name="line312"></a>..312 scan([C|_], _Accum, Line) ->
+</span><span class="uncovered0"><a name="line313"></a>..313 erlang:error({invalid_character, [C], Line}).
+</span><span class="inferred0"><a name="line314"></a>..314
+</span><span class="inferred0"><a name="line315"></a>..315 %% @hidden
+</span><span class="inferred0"><a name="line316"></a>..316 scan_identifier(String) ->
+</span><span class="marked0"><a name="line317"></a>..317 scan_identifier(String, "").
+</span><span class="inferred0"><a name="line318"></a>..318
+</span><span class="inferred0"><a name="line319"></a>..319 %% @hidden
+</span><span class="inferred0"><a name="line320"></a>..320 scan_identifier([C|Rest], Accum)
+</span><span class="inferred0"><a name="line321"></a>..321 when C >= $A, C =< $Z;
+</span><span class="inferred0"><a name="line322"></a>..322 C >= $a, C =< $z;
+</span><span class="inferred0"><a name="line323"></a>..323 C >= $0, C =< $9;
+</span><span class="inferred0"><a name="line324"></a>..324 C =:= $_;
+</span><span class="inferred0"><a name="line325"></a>..325 C =:= $. ->
+</span><span class="marked0"><a name="line326"></a>..326 scan_identifier(Rest, [C|Accum]);
+</span><span class="inferred0"><a name="line327"></a>..327 scan_identifier(Rest, Accum) ->
+</span><span class="marked0"><a name="line328"></a>..328 {lists:reverse(Accum), Rest}.
+</span><span class="inferred0"><a name="line329"></a>..329
+</span><span class="inferred0"><a name="line330"></a>..330 %% @hidden
+</span><span class="inferred0"><a name="line331"></a>..331 scan_number(String) ->
+</span><span class="marked0"><a name="line332"></a>..332 {A, Rest1} = scan_integer(String),
+</span><span class="marked0"><a name="line333"></a>..333 case Rest1 of
+</span><span class="inferred0"><a name="line334"></a>..334 [$.|Fraction] ->
+</span><span class="uncovered0"><a name="line335"></a>..335 {B, Rest2} = scan_identifier(Fraction),
+</span><span class="uncovered0"><a name="line336"></a>..336 {A + list_to_float("0." ++ B), Rest2};
+</span><span class="inferred0"><a name="line337"></a>..337 [$e|Exp] ->
+</span><span class="uncovered0"><a name="line338"></a>..338 {B, Rest2} = scan_integer(Exp),
+</span><span class="uncovered0"><a name="line339"></a>..339 {list_to_float(integer_to_list(A) ++ ".0e" ++ integer_to_list(B)), Rest2};
+</span><span class="inferred0"><a name="line340"></a>..340 [$x|Rest] when A =:= 0 ->
+</span><span class="uncovered0"><a name="line341"></a>..341 {Hex, Rest2} = scan_identifier(Rest),
+</span><span class="uncovered0"><a name="line342"></a>..342 {erlang:list_to_integer(Hex, 16), Rest2};
+</span><span class="inferred0"><a name="line343"></a>..343 _ ->
+</span><span class="marked0"><a name="line344"></a>..344 {A, Rest1}
+</span><span class="inferred0"><a name="line345"></a>..345 end.
+</span><span class="inferred0"><a name="line346"></a>..346
+</span><span class="inferred0"><a name="line347"></a>..347 %% @hidden
+</span><span class="inferred0"><a name="line348"></a>..348 scan_integer(String) ->
+</span><span class="marked0"><a name="line349"></a>..349 scan_integer(String, 0).
+</span><span class="inferred0"><a name="line350"></a>..350
+</span><span class="inferred0"><a name="line351"></a>..351 %% @hidden
+</span><span class="inferred0"><a name="line352"></a>..352 scan_integer([D|Rest], Accum)
+</span><span class="inferred0"><a name="line353"></a>..353 when D >= $0, D =< $9 ->
+</span><span class="marked0"><a name="line354"></a>..354 scan_integer(Rest, Accum * 10 + (D - $0));
+</span><span class="inferred0"><a name="line355"></a>..355 scan_integer(Rest, Accum) ->
+</span><span class="marked0"><a name="line356"></a>..356 {Accum, Rest}.
+</span><span class="inferred0"><a name="line357"></a>..357
+</span><span class="inferred0"><a name="line358"></a>..358 %% @hidden
+</span><span class="inferred0"><a name="line359"></a>..359 scan_string([$"|String], Line) ->
+</span><span class="uncovered0"><a name="line360"></a>..360 scan_string(String, "", Line).
+</span><span class="inferred0"><a name="line361"></a>..361
+</span><span class="inferred0"><a name="line362"></a>..362 %% @hidden
+</span><span class="inferred0"><a name="line363"></a>..363 scan_string([$"|Rest], Accum, Line) ->
+</span><span class="uncovered0"><a name="line364"></a>..364 {lists:reverse(Accum), Rest, Line};
+</span><span class="inferred0"><a name="line365"></a>..365 scan_string([$\\, $a|Rest], Accum, Line) ->
+</span><span class="uncovered0"><a name="line366"></a>..366 scan_string(Rest, [7|Accum], Line);
+</span><span class="inferred0"><a name="line367"></a>..367 scan_string([$\\, $e|Rest], Accum, Line) ->
+</span><span class="uncovered0"><a name="line368"></a>..368 scan_string(Rest, [$\e|Accum], Line);
+</span><span class="inferred0"><a name="line369"></a>..369 scan_string([$\\, $f|Rest], Accum, Line) ->
+</span><span class="uncovered0"><a name="line370"></a>..370 scan_string(Rest, [$\f|Accum], Line);
+</span><span class="inferred0"><a name="line371"></a>..371 scan_string([$\\, $n|Rest], Accum, Line) ->
+</span><span class="uncovered0"><a name="line372"></a>..372 scan_string(Rest, [$\n|Accum], Line);
+</span><span class="inferred0"><a name="line373"></a>..373 scan_string([$\\, $r|Rest], Accum, Line) ->
+</span><span class="uncovered0"><a name="line374"></a>..374 scan_string(Rest, [$\r|Accum], Line);
+</span><span class="inferred0"><a name="line375"></a>..375 scan_string([$\\, $t|Rest], Accum, Line) ->
+</span><span class="uncovered0"><a name="line376"></a>..376 scan_string(Rest, [$\t|Accum], Line);
+</span><span class="inferred0"><a name="line377"></a>..377 scan_string([$\\, $v|Rest], Accum, Line) ->
+</span><span class="uncovered0"><a name="line378"></a>..378 scan_string(Rest, [$\v|Accum], Line);
+</span><span class="inferred0"><a name="line379"></a>..379 scan_string([$\\, D1, D2, D3|Rest], Accum, Line)
+</span><span class="inferred0"><a name="line380"></a>..380 when D1 >= $0, D1 =< $7, D2 >= $0, D2 =< $7, D3 >= $0, D3 =< $7 ->
+</span><span class="uncovered0"><a name="line381"></a>..381 scan_string(Rest, [erlang:list_to_integer([D1, D2, D3], 8)|Accum], Line);
+</span><span class="inferred0"><a name="line382"></a>..382 scan_string([$\\, $x, H1, H2|Rest], Accum, Line) ->
+</span><span class="uncovered0"><a name="line383"></a>..383 scan_string(Rest, [erlang:list_to_integer([H1, H2], 16)|Accum], Line);
+</span><span class="inferred0"><a name="line384"></a>..384 scan_string([$\\, Char|Rest], Accum, Line) ->
+</span><span class="uncovered0"><a name="line385"></a>..385 scan_string(Rest, [Char|Accum], Line);
+</span><span class="inferred0"><a name="line386"></a>..386 scan_string([$\n|Rest], Accum, Line) ->
+</span><span class="uncovered0"><a name="line387"></a>..387 scan_string(Rest, [$\n|Accum], Line + 1);
+</span><span class="inferred0"><a name="line388"></a>..388 scan_string([Char|Rest], Accum, Line) ->
+</span><span class="uncovered0"><a name="line389"></a>..389 scan_string(Rest, [Char|Accum], Line).
+</span><span class="inferred0"><a name="line390"></a>..390
+</span><span class="inferred0"><a name="line391"></a>..391 %% @hidden
+</span><span class="inferred0"><a name="line392"></a>..392 skip_to_newline([$\n|Rest]) ->
+</span><span class="uncovered0"><a name="line393"></a>..393 Rest;
+</span><span class="inferred0"><a name="line394"></a>..394 skip_to_newline([]) ->
+</span><span class="uncovered0"><a name="line395"></a>..395 [];
+</span><span class="inferred0"><a name="line396"></a>..396 skip_to_newline([_|Rest]) ->
+</span><span class="uncovered0"><a name="line397"></a>..397 skip_to_newline(Rest).
+</span><span class="inferred0"><a name="line398"></a>..398
+</span><span class="inferred0"><a name="line399"></a>..399 %% @hidden
+</span><span class="inferred0"><a name="line400"></a>..400 skip_comment([$*, $/|Rest], Line) ->
+</span><span class="uncovered0"><a name="line401"></a>..401 {Rest, Line};
+</span><span class="inferred0"><a name="line402"></a>..402 skip_comment([$\n|Rest], Line) ->
+</span><span class="uncovered0"><a name="line403"></a>..403 skip_comment(Rest, Line + 1);
+</span><span class="inferred0"><a name="line404"></a>..404 skip_comment([_|Rest], Line) ->
+</span><span class="uncovered0"><a name="line405"></a>..405 skip_comment(Rest, Line).
+</span><span class="inferred0"><a name="line406"></a>..406
+</span><span class="inferred0"><a name="line407"></a>..407 %% @hidden
+</span><span class="inferred0"><a name="line408"></a>..408 get_keyword("import") ->
+</span><span class="uncovered0"><a name="line409"></a>..409 import;
+</span><span class="inferred0"><a name="line410"></a>..410 get_keyword("package") ->
+</span><span class="uncovered0"><a name="line411"></a>..411 package;
+</span><span class="inferred0"><a name="line412"></a>..412 get_keyword("option") ->
+</span><span class="uncovered0"><a name="line413"></a>..413 option;
+</span><span class="inferred0"><a name="line414"></a>..414 get_keyword("message") ->
+</span><span class="marked0"><a name="line415"></a>..415 message;
+</span><span class="inferred0"><a name="line416"></a>..416 get_keyword("group") ->
+</span><span class="uncovered0"><a name="line417"></a>..417 group;
+</span><span class="inferred0"><a name="line418"></a>..418 get_keyword("enum") ->
+</span><span class="uncovered0"><a name="line419"></a>..419 enum;
+</span><span class="inferred0"><a name="line420"></a>..420 get_keyword("extend") ->
+</span><span class="uncovered0"><a name="line421"></a>..421 extend;
+</span><span class="inferred0"><a name="line422"></a>..422 get_keyword("service") ->
+</span><span class="uncovered0"><a name="line423"></a>..423 service;
+</span><span class="inferred0"><a name="line424"></a>..424 get_keyword("rpc") ->
+</span><span class="uncovered0"><a name="line425"></a>..425 rpc;
+</span><span class="inferred0"><a name="line426"></a>..426 get_keyword("required") ->
+</span><span class="marked0"><a name="line427"></a>..427 required;
+</span><span class="inferred0"><a name="line428"></a>..428 get_keyword("optional") ->
+</span><span class="marked0"><a name="line429"></a>..429 optional;
+</span><span class="inferred0"><a name="line430"></a>..430 get_keyword("repeated") ->
+</span><span class="marked0"><a name="line431"></a>..431 repeated;
+</span><span class="inferred0"><a name="line432"></a>..432 get_keyword("returns") ->
+</span><span class="uncovered0"><a name="line433"></a>..433 returns;
+</span><span class="inferred0"><a name="line434"></a>..434 get_keyword("extensions") ->
+</span><span class="uncovered0"><a name="line435"></a>..435 extensions;
+</span><span class="inferred0"><a name="line436"></a>..436 get_keyword("max") ->
+</span><span class="uncovered0"><a name="line437"></a>..437 max;
+</span><span class="inferred0"><a name="line438"></a>..438 get_keyword("to") ->
+</span><span class="uncovered0"><a name="line439"></a>..439 to;
+</span><span class="inferred0"><a name="line440"></a>..440 get_keyword("true") ->
+</span><span class="uncovered0"><a name="line441"></a>..441 true;
+</span><span class="inferred0"><a name="line442"></a>..442 get_keyword("false") ->
+</span><span class="uncovered0"><a name="line443"></a>..443 false;
+</span><span class="inferred0"><a name="line444"></a>..444 get_keyword(Bareword) ->
+</span><span class="marked0"><a name="line445"></a>..445 {bareword, Bareword}.
+</span></pre><hr /><p>Generated using <a href='http://github.com/ngerakines/etap'>etap 0.3.3</a>.</p>
+ </body>
+ </html>
+
View
329 coverage/protobuffs_report.html
@@ -0,0 +1,329 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
+ <head>
+ <title>protobuffs - C0 code coverage information</title>
+ <style type='text/css'>body { background-color: rgb(240, 240, 245); }</style>
+ <style type='text/css'>span.marked0 {
+ background-color: rgb(185, 210, 200);
+ display: block;
+ }
+ span.marked1 {
+ background-color: rgb(190, 215, 205);
+ display: block;
+ }
+ span.inferred0 {
+ background-color: rgb(175, 200, 200);
+ display: block;
+ }
+ span.inferred1 {
+ background-color: rgb(180, 205, 205);
+ display: block;
+ }
+ span.uncovered0 {
+ background-color: rgb(225, 110, 110);
+ display: block;
+ }
+ span.uncovered1 {
+ background-color: rgb(235, 120, 120);
+ display: block;
+ }
+ span.overview {
+ border-bottom: 8px solid black;
+ }
+ div.overview {
+ border-bottom: 8px solid black;
+ }
+ body {
+ font-family: verdana, arial, helvetica;
+ }
+ div.footer {
+ font-size: 68%;
+ margin-top: 1.5em;
+ }
+ h1, h2, h3, h4, h5, h6 {
+ margin-bottom: 0.5em;
+ }
+ h5 {
+ margin-top: 0.5em;
+ }
+ .hidden {
+ display: none;
+ }
+ div.separator {
+ height: 10px;
+ }
+ table.percent_graph {
+ height: 12px;
+ border: #808080 1px solid;
+ empty-cells: show;
+ }
+ table.percent_graph td.covered {
+ height: 10px;
+ background: #00f000;
+ }
+ table.percent_graph td.uncovered {
+ height: 10px;
+ background: #e00000;
+ }
+ table.percent_graph td.NA {
+ height: 10px;
+ background: #eaeaea;
+ }
+ table.report {
+ border-collapse: collapse;
+ width: 100%;
+ }
+ table.report td.heading {
+ background: #dcecff;
+ border: #d0d0d0 1px solid;
+ font-weight: bold;
+ text-align: center;
+ }
+ table.report td.heading:hover {
+ background: #c0ffc0;
+ }
+ table.report td.text {
+ border: #d0d0d0 1px solid;
+ }
+ table.report td.value {
+ text-align: right;
+ border: #d0d0d0 1px solid;
+ }
+ table.report tr.light {
+ background-color: rgb(240, 240, 245);
+ }
+ table.report tr.dark {
+ background-color: rgb(230, 230, 235);
+ }
+ </style>
+ </head>
+ <body>
+ <h3>C0 code coverage information</h3>
+ <p>Generated on 2009-01-23 23:10:54 with <a href='http://github.com/ngerakines/etap'>etap 0.3.3</a>.
+ </p>
+ <table class='report'>
+ <thead>
+ <tr>
+ <td class='heading'>Name</td>
+ <td class='heading'>Total lines</td>
+ <td class='heading'>Lines of code</td>
+ <td class='heading'>Total coverage</td>
+ <td class='heading'>Code coverage</td>
+ </tr>
+ </thead>
+ <tbody>
+ <tr class='light'>
+
+ <td>
+ <a href='protobuffs_report.html'>protobuffs</a>
+ </td>
+ <td class='value'>
+ <tt>??</tt>
+ </td>
+ <td class='value'>
+ <tt>??</tt>
+ </td>
+ <td class='value'>
+ <tt>??</tt>
+ </td>
+ <td>
+ <table cellspacing='0' cellpadding='0' align='right'>
+ <tr>
+ <td><tt>73%</tt>&nbsp;</td><td>
+ <table cellspacing='0' class='percent_graph' cellpadding='0' width='100'>
+ <tr><td class='covered' width='46' /><td class='uncovered' width='17' /></tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </tbody>
+ </table><pre><span class="inferred0"><a name="line1"></a>....1 %% @doc A protcol buffers encoding and decoding module.
+</span><span class="inferred0"><a name="line2"></a>....2 -module(protobuffs).
+</span><span class="inferred0"><a name="line3"></a>....3 -export([encode/3, decode/2, decode_many/1]).
+</span><span class="inferred0"><a name="line4"></a>....4
+</span><span class="inferred0"><a name="line5"></a>....5 -define(TYPE_VARINT, 0).
+</span><span class="inferred0"><a name="line6"></a>....6 -define(TYPE_64BIT, 1).
+</span><span class="inferred0"><a name="line7"></a>....7 -define(TYPE_STRING, 2).
+</span><span class="inferred0"><a name="line8"></a>....8 -define(TYPE_START_GROUP, 3).
+</span><span class="inferred0"><a name="line9"></a>....9 -define(TYPE_END_GROUP, 4).
+</span><span class="inferred0"><a name="line10"></a>...10 -define(TYPE_32BIT, 5).
+</span><span class="inferred0"><a name="line11"></a>...11
+</span><span class="inferred0"><a name="line12"></a>...12 %% @spec encode(FieldID, Value, Type) -> Result
+</span><span class="inferred0"><a name="line13"></a>...13 %% FieldID = integer()
+</span><span class="inferred0"><a name="line14"></a>...14 %% Value = any()
+</span><span class="inferred0"><a name="line15"></a>...15 %% Type = bool | enum | int32 | uint32 | int64 | unit64 | sint32 | sint64 | fixed32 | sfixed32 | fixed64 | sfixed64 | string | bytes | float | double
+</span><span class="inferred0"><a name="line16"></a>...16 %% Result = list()
+</span><span class="inferred0"><a name="line17"></a>...17 %% @doc Encode an Erlang data structure into a Protocol Buffers value.
+</span><span class="inferred0"><a name="line18"></a>...18 encode(FieldID, false, bool) ->
+</span><span class="marked0"><a name="line19"></a>...19 encode(FieldID, 0, int32);
+</span><span class="inferred0"><a name="line20"></a>...20 encode(FieldID, true, bool) ->
+</span><span class="marked0"><a name="line21"></a>...21 encode(FieldID, 1, int32);
+</span><span class="inferred0"><a name="line22"></a>...22 encode(FieldID, Integer, enum) ->
+</span><span class="marked0"><a name="line23"></a>...23 encode(FieldID, Integer, uint32);
+</span><span class="inferred0"><a name="line24"></a>...24 encode(FieldID, Integer, IntType) when IntType =:= int32, Integer >= -16#80000000, Integer =< 16#7fffffff ->
+</span><span class="marked0"><a name="line25"></a>...25 encode_varint_field(FieldID, Integer);
+</span><span class="inferred0"><a name="line26"></a>...26 encode(FieldID, Integer, IntType) when IntType =:= uint32, Integer band 16#ffffffff =:= Integer ->
+</span><span class="marked0"><a name="line27"></a>...27 encode_varint_field(FieldID, Integer);
+</span><span class="inferred0"><a name="line28"></a>...28 encode(FieldID, Integer, IntType) when IntType =:= int64, Integer >= -16#8000000000000000, Integer =< 16#7fffffffffffffff ->
+</span><span class="marked0"><a name="line29"></a>...29 encode_varint_field(FieldID, Integer);
+</span><span class="inferred0"><a name="line30"></a>...30 encode(FieldID, Integer, IntType) when IntType =:= uint64, Integer band 16#ffffffffffffffff =:= Integer ->
+</span><span class="uncovered0"><a name="line31"></a>...31 encode_varint_field(FieldID, Integer);
+</span><span class="inferred0"><a name="line32"></a>...32 encode(FieldID, Integer, IntType) when IntType =:= bool, Integer band 1 =:= 1 ->
+</span><span class="uncovered0"><a name="line33"></a>...33 encode_varint_field(FieldID, Integer);
+</span><span class="inferred0"><a name="line34"></a>...34 encode(FieldID, Integer, IntType) when IntType =:= sint32, Integer >= -16#80000000, Integer < 0 ->
+</span><span class="uncovered0"><a name="line35"></a>...35 encode_varint_field(FieldID, bnot (Integer bsl 1));
+</span><span class="inferred0"><a name="line36"></a>...36 encode(FieldID, Integer, IntType) when IntType =:= sint64, Integer >= -16#8000000000000000, Integer < 0 ->
+</span><span class="marked0"><a name="line37"></a>...37 encode_varint_field(FieldID, bnot (Integer bsl 1));
+</span><span class="inferred0"><a name="line38"></a>...38 encode(FieldID, Integer, IntType) when IntType =:= sint64, Integer >= 0, Integer =< 16#7fffffff ->
+</span><span class="uncovered0"><a name="line39"></a>...39 encode_varint_field(FieldID, Integer bsl 1);
+</span><span class="inferred0"><a name="line40"></a>...40 encode(FieldID, Integer, IntType) when IntType =:= sint64, Integer >= 0, Integer =< 16#7fffffffffffffff ->
+</span><span class="uncovered0"><a name="line41"></a>...41 encode_varint_field(FieldID, Integer bsl 1);
+</span><span class="inferred0"><a name="line42"></a>...42 encode(FieldID, Integer, fixed32) when Integer band 16#ffffffff =:= Integer ->
+</span><span class="marked0"><a name="line43"></a>...43 [encode_field_tag(FieldID, ?TYPE_32BIT), <<Integer:32/little-integer>>];
+</span><span class="inferred0"><a name="line44"></a>...44 encode(FieldID, Integer, sfixed32) when Integer >= -16#80000000, Integer =< 16#7fffffff ->
+</span><span class="marked0"><a name="line45"></a>...45 [encode_field_tag(FieldID, ?TYPE_32BIT), <<Integer:32/little-integer>>];
+</span><span class="inferred0"><a name="line46"></a>...46 encode(FieldID, Integer, fixed64) when Integer band 16#ffffffffffffffff =:= Integer ->
+</span><span class="marked0"><a name="line47"></a>...47 [encode_field_tag(FieldID, ?TYPE_64BIT), <<Integer:64/little-integer>>];
+</span><span class="inferred0"><a name="line48"></a>...48 encode(FieldID, Integer, sfixed64) when Integer >= -16#8000000000000000, Integer =< 16#7fffffffffffffff ->
+</span><span class="marked0"><a name="line49"></a>...49 [encode_field_tag(FieldID, ?TYPE_64BIT), <<Integer:64/little-integer>>];
+</span><span class="inferred0"><a name="line50"></a>...50 encode(FieldID, String, string) when is_list(String) ->
+</span><span class="marked0"><a name="line51"></a>...51 encode(FieldID, list_to_binary(String), string);
+</span><span class="inferred0"><a name="line52"></a>...52 encode(FieldID, String, string) when is_binary(String) ->
+</span><span class="marked0"><a name="line53"></a>...53 encode(FieldID, String, bytes);
+</span><span class="inferred0"><a name="line54"></a>...54 encode(FieldID, String, bytes) when is_list(String) ->
+</span><span class="uncovered0"><a name="line55"></a>...55 encode(FieldID, list_to_binary(String), bytes);
+</span><span class="inferred0"><a name="line56"></a>...56 encode(FieldID, Bytes, bytes) when is_binary(Bytes) ->
+</span><span class="marked0"><a name="line57"></a>...57 [encode_field_tag(FieldID, ?TYPE_STRING), encode_varint(size(Bytes)), Bytes];
+</span><span class="inferred0"><a name="line58"></a>...58 encode(FieldID, Float, float) when is_float(Float) ->
+</span><span class="marked0"><a name="line59"></a>...59 [encode_field_tag(FieldID, ?TYPE_32BIT), <<Float:32/little-float>>];
+</span><span class="inferred0"><a name="line60"></a>...60 encode(FieldID, Float, double) when is_float(Float) ->
+</span><span class="marked0"><a name="line61"></a>...61 [encode_field_tag(FieldID, ?TYPE_64BIT), <<Float:64/little-float>>].
+</span><span class="inferred0"><a name="line62"></a>...62 %% encode(FieldID, Value, _) when is_binary(Value) ->
+</span><span class="inferred0"><a name="line63"></a>...63 %% encode(FieldID, Value, bytes);
+</span><span class="inferred0"><a name="line64"></a>...64 %% encode(FieldID, Value, _) when is_atom(Value) ->
+</span><span class="inferred0"><a name="line65"></a>...65 %% encode(FieldID, erlang:atom_to_list(Value), string).
+</span><span class="inferred0"><a name="line66"></a>...66
+</span><span class="inferred0"><a name="line67"></a>...67 %% @spec decode(Bytes, ExpectedType) -> Result
+</span><span class="inferred0"><a name="line68"></a>...68 %% Bytes = binary()
+</span><span class="inferred0"><a name="line69"></a>...69 %% ExpectedType = bool | enum | int32 | uint32 | int64 | unit64 | sint32 | sint64 | fixed32 | sfixed32 | fixed64 | sfixed64 | string | bytes | float | double
+</span><span class="inferred0"><a name="line70"></a>...70 %% Result = {{integer(), any()}, binary()}
+</span><span class="inferred0"><a name="line71"></a>...71 decode(Bytes, ExpectedType) ->
+</span><span class="marked0"><a name="line72"></a>...72 {Tag, Rest1} = decode_varint(Bytes),
+</span><span class="marked0"><a name="line73"></a>...73 FieldID = Tag bsr 3,
+</span><span class="marked0"><a name="line74"></a>...74 WireType = Tag band 7,
+</span><span class="marked0"><a name="line75"></a>...75 {Value, Rest2} = decode_value(Rest1, WireType, ExpectedType),
+</span><span class="marked0"><a name="line76"></a>...76 {{FieldID, Value}, Rest2}.
+</span><span class="inferred0"><a name="line77"></a>...77
+</span><span class="inferred0"><a name="line78"></a>...78 %% @spec decode_many(Bytes) -> Results
+</span><span class="inferred0"><a name="line79"></a>...79 %% Bytes = binary()
+</span><span class="inferred0"><a name="line80"></a>...80 %% Results = [Result]
+</span><span class="inferred0"><a name="line81"></a>...81 %% Result = {integer(), any()}
+</span><span class="inferred0"><a name="line82"></a>...82 decode_many(Bytes) ->
+</span><span class="marked0"><a name="line83"></a>...83 decode_many(Bytes, []).
+</span><span class="inferred0"><a name="line84"></a>...84
+</span><span class="inferred0"><a name="line85"></a>...85 %% @hidden
+</span><span class="inferred0"><a name="line86"></a>...86 decode_value(Bytes, ?TYPE_VARINT, ExpectedType) ->
+</span><span class="marked0"><a name="line87"></a>...87 {Value, Rest} = decode_varint(Bytes),
+</span><span class="marked0"><a name="line88"></a>...88 {typecast(Value, ExpectedType), Rest};
+</span><span class="inferred0"><a name="line89"></a>...89 decode_value(<<Value:64/little-unsigned-integer, Rest/binary>>, ?TYPE_64BIT, fixed64) ->
+</span><span class="marked0"><a name="line90"></a>...90 {Value, Rest};
+</span><span class="inferred0"><a name="line91"></a>...91 decode_value(<<Value:32/little-unsigned-integer, _:32, Rest/binary>>, ?TYPE_64BIT, fixed32) ->
+</span><span class="uncovered0"><a name="line92"></a>...92 {Value, Rest};
+</span><span class="inferred0"><a name="line93"></a>...93 decode_value(<<Value:64/little-signed-integer, Rest/binary>>, ?TYPE_64BIT, sfixed64) ->
+</span><span class="marked0"><a name="line94"></a>...94 {Value, Rest};
+</span><span class="inferred0"><a name="line95"></a>...95 decode_value(<<Value:32/little-signed-integer, _:32, Rest/binary>>, ?TYPE_64BIT, sfixed32) ->
+</span><span class="uncovered0"><a name="line96"></a>...96 {Value, Rest};
+</span><span class="inferred0"><a name="line97"></a>...97 decode_value(<<Value:64/little-float, Rest/binary>>, ?TYPE_64BIT, Type) when Type =:= double; Type =:= float ->
+</span><span class="marked0"><a name="line98"></a>...98 {Value, Rest};
+</span><span class="inferred0"><a name="line99"></a>...99 decode_value(Bytes, ?TYPE_STRING, ExpectedType) when ExpectedType =:= string; ExpectedType =:= bytes ->
+</span><span class="marked0"><a name="line100"></a>..100 {Length, Rest} = decode_varint(Bytes),
+</span><span class="marked0"><a name="line101"></a>..101 split_binary(Rest, Length);
+</span><span class="inferred0"><a name="line102"></a>..102 decode_value(<<Value:32/little-unsigned-integer, Rest/binary>>, ?TYPE_32BIT, Type) when Type =:= fixed32; Type =:= fixed64 ->
+</span><span class="marked0"><a name="line103"></a>..103 {Value, Rest};
+</span><span class="inferred0"><a name="line104"></a>..104 decode_value(<<Value:32/little-signed-integer, Rest/binary>>, ?TYPE_32BIT, Type) when Type =:= sfixed32; Type =:= sfixed64 ->
+</span><span class="marked0"><a name="line105"></a>..105 {Value, Rest};
+</span><span class="inferred0"><a name="line106"></a>..106 decode_value(<<Value:32/little-float, Rest/binary>>, ?TYPE_32BIT, Type) when Type =:= double; Type =:= float ->
+</span><span class="marked0"><a name="line107"></a>..107 {Value, Rest}.
+</span><span class="inferred0"><a name="line108"></a>..108
+</span><span class="inferred0"><a name="line109"></a>..109 %% @hidden
+</span><span class="inferred0"><a name="line110"></a>..110 typecast(Value, SignedType) when SignedType =:= int32; SignedType =:= int64 ->
+</span><span class="marked0"><a name="line111"></a>..111 if
+</span><span class="uncovered0"><a name="line112"></a>..112 Value band 16#8000000000000000 =/= 0 -> Value - 16#10000000000000000;
+</span><span class="marked0"><a name="line113"></a>..113 true -> Value
+</span><span class="inferred0"><a name="line114"></a>..114 end;
+</span><span class="inferred0"><a name="line115"></a>..115 typecast(Value, SignedType) when SignedType =:= sint32; SignedType =:= sint64 ->
+</span><span class="marked0"><a name="line116"></a>..116 (Value bsr 1) bxor (-(Value band 1));
+</span><span class="inferred0"><a name="line117"></a>..117 typecast(Value, _) ->
+</span><span class="marked0"><a name="line118"></a>..118 Value.
+</span><span class="inferred0"><a name="line119"></a>..119
+</span><span class="inferred0"><a name="line120"></a>..120 %% @hidden
+</span><span class="inferred0"><a name="line121"></a>..121 encode_field_tag(FieldID, FieldType) when FieldID band 16#3fffffff =:= FieldID ->
+</span><span class="marked0"><a name="line122"></a>..122 encode_varint((FieldID bsl 3) bor FieldType).
+</span><span class="inferred0"><a name="line123"></a>..123
+</span><span class="inferred0"><a name="line124"></a>..124 %% @hidden
+</span><span class="inferred0"><a name="line125"></a>..125 encode_varint_field(FieldID, Integer) ->
+</span><span class="marked0"><a name="line126"></a>..126 [encode_field_tag(FieldID, ?TYPE_VARINT), encode_varint(Integer)].
+</span><span class="inferred0"><a name="line127"></a>..127
+</span><span class="inferred0"><a name="line128"></a>..128 %% @hidden
+</span><span class="inferred0"><a name="line129"></a>..129 encode_varint(I) when I band 16#7f =:= I ->
+</span><span class="marked0"><a name="line130"></a>..130 I;
+</span><span class="inferred0"><a name="line131"></a>..131 encode_varint(I) when I band 16#3fff =:= I ->
+</span><span class="marked0"><a name="line132"></a>..132 <<(16#80 bor (I bsr 7)), (I band 16#7f)>>;
+</span><span class="inferred0"><a name="line133"></a>..133 encode_varint(I) when I band 16#1fffff =:= I ->
+</span><span class="uncovered0"><a name="line134"></a>..134 <<(16#80 bor (I bsr 14)),
+</span><span class="inferred0"><a name="line135"></a>..135 (16#80 bor (I bsr 7) band 16#ff), (I band 16#7f)>>;
+</span><span class="inferred0"><a name="line136"></a>..136 encode_varint(I) when I band 16#fffffff =:= I ->
+</span><span class="uncovered0"><a name="line137"></a>..137 <<(16#80 bor (I bsr 21)), (16#80 bor (I bsr 14) band 16#ff),
+</span><span class="inferred0"><a name="line138"></a>..138 (16#80 bor (I bsr 7) band 16#ff), (I band 16#7f)>>;
+</span><span class="inferred0"><a name="line139"></a>..139 encode_varint(I) when I band 16#7ffffffff =:= I ->
+</span><span class="uncovered0"><a name="line140"></a>..140 <<(16#80 bor (I bsr 28)),
+</span><span class="inferred0"><a name="line141"></a>..141 (16#80 bor (I bsr 21) band 16#ff), (16#80 bor (I bsr 14) band 16#ff),
+</span><span class="inferred0"><a name="line142"></a>..142 (16#80 bor (I bsr 7) band 16#ff), (I band 16#7f)>>;
+</span><span class="inferred0"><a name="line143"></a>..143 encode_varint(I) when I band 16#3ffffffffff =:= I ->
+</span><span class="uncovered0"><a name="line144"></a>..144 <<(16#80 bor (I bsr 35)), (16#80 bor (I bsr 28) band 16#ff),
+</span><span class="inferred0"><a name="line145"></a>..145 (16#80 bor (I bsr 21) band 16#ff), (16#80 bor (I bsr 14) band 16#ff),
+</span><span class="inferred0"><a name="line146"></a>..146 (16#80 bor (I bsr 7) band 16#ff), (I band 16#7f)>>;
+</span><span class="inferred0"><a name="line147"></a>..147 encode_varint(I) when I band 16#1ffffffffffff =:= I ->
+</span><span class="uncovered0"><a name="line148"></a>..148 <<(16#80 bor (I bsr 42)),
+</span><span class="inferred0"><a name="line149"></a>..149 (16#80 bor (I bsr 35) band 16#ff), (16#80 bor (I bsr 28) band 16#ff),
+</span><span class="inferred0"><a name="line150"></a>..150 (16#80 bor (I bsr 21) band 16#ff), (16#80 bor (I bsr 14) band 16#ff),
+</span><span class="inferred0"><a name="line151"></a>..151 (16#80 bor (I bsr 7) band 16#ff), (I band 16#7f)>>;
+</span><span class="inferred0"><a name="line152"></a>..152 encode_varint(I) when I band 16#ffffffffffffff =:= I ->
+</span><span class="uncovered0"><a name="line153"></a>..153 <<(16#80 bor (I bsr 49) band 16#ff), (16#80 bor (I bsr 42) band 16#ff),
+</span><span class="inferred0"><a name="line154"></a>..154 (16#80 bor (I bsr 35) band 16#ff), (16#80 bor (I bsr 28) band 16#ff),
+</span><span class="inferred0"><a name="line155"></a>..155 (16#80 bor (I bsr 21) band 16#ff), (16#80 bor (I bsr 14) band 16#ff),
+</span><span class="inferred0"><a name="line156"></a>..156 (16#80 bor (I bsr 7) band 16#ff), (I band 16#7f)>>;
+</span><span class="inferred0"><a name="line157"></a>..157 encode_varint(I) when I band 16#7fffffffffffffff =:= I ->
+</span><span class="uncovered0"><a name="line158"></a>..158 <<(16#80 bor (I bsr 56)),
+</span><span class="inferred0"><a name="line159"></a>..159 (16#80 bor (I bsr 49) band 16#ff), (16#80 bor (I bsr 42) band 16#ff),
+</span><span class="inferred0"><a name="line160"></a>..160 (16#80 bor (I bsr 35) band 16#ff), (16#80 bor (I bsr 28) band 16#ff),
+</span><span class="inferred0"><a name="line161"></a>..161 (16#80 bor (I bsr 21) band 16#ff), (16#80 bor (I bsr 14) band 16#ff),
+</span><span class="inferred0"><a name="line162"></a>..162 (16#80 bor (I bsr 7) band 16#ff), (I band 16#7f)>>;
+</span><span class="inferred0"><a name="line163"></a>..163 encode_varint(I) when I band 16#ffffffffffffffff =:= I ->
+</span><span class="uncovered0"><a name="line164"></a>..164 <<(16#80 bor (I bsr 63) band 16#81), (16#80 bor (I bsr 56) band 16#ff),
+</span><span class="inferred0"><a name="line165"></a>..165 (16#80 bor (I bsr 49) band 16#ff), (16#80 bor (I bsr 42) band 16#ff),
+</span><span class="inferred0"><a name="line166"></a>..166 (16#80 bor (I bsr 35) band 16#ff), (16#80 bor (I bsr 28) band 16#ff),
+</span><span class="inferred0"><a name="line167"></a>..167 (16#80 bor (I bsr 21) band 16#ff), (16#80 bor (I bsr 14) band 16#ff),
+</span><span class="inferred0"><a name="line168"></a>..168 (16#80 bor (I bsr 7) band 16#ff), (I band 16#7f)>>.
+</span><span class="inferred0"><a name="line169"></a>..169
+</span><span class="inferred0"><a name="line170"></a>..170 %% @hidden
+</span><span class="inferred0"><a name="line171"></a>..171 decode_varint(Bytes) ->
+</span><span class="marked0"><a name="line172"></a>..172 decode_varint(Bytes, 0).
+</span><span class="inferred0"><a name="line173"></a>..173
+</span><span class="inferred0"><a name="line174"></a>..174 %% @hidden
+</span><span class="inferred0"><a name="line175"></a>..175 decode_varint(<<0:1, I:7, Rest/binary>>, Accum) when Accum =< 16#3ffffffffffffff ->
+</span><span class="marked0"><a name="line176"></a>..176 {Accum bsl 7 bor I, Rest};
+</span><span class="inferred0"><a name="line177"></a>..177 decode_varint(<<1:1, I:7, Rest/binary>>, Accum) ->
+</span><span class="marked0"><a name="line178"></a>..178 decode_varint(Rest, Accum bsl 7 bor I).
+</span><span class="inferred0"><a name="line179"></a>..179
+</span><span class="inferred0"><a name="line180"></a>..180 %% @hidden
+</span><span class="marked0"><a name="line181"></a>..181 decode_many(<<>>, Acc) -> lists:keysort(1, Acc);
+</span><span class="inferred0"><a name="line182"></a>..182 decode_many(Bytes, Acc) ->
+</span><span class="marked0"><a name="line183"></a>..183 {A, B} = decode(Bytes, bytes),
+</span><span class="marked0"><a name="line184"></a>..184 decode_many(B, [A | Acc]).
+</span></pre><hr /><p>Generated using <a href='http://github.com/ngerakines/etap'>etap 0.3.3</a>.</p>
+ </body>
+ </html>
+
Please sign in to comment.
Something went wrong with that request. Please try again.