34
34
<module>megaco_codec_transform</module>
35
35
<modulesummary>Megaco message transformation utility.</modulesummary>
37
38
<p>This module implements a simple megaco message transformation utility.</p>
38
39
<p><em>Note</em> that this module is <em>not</em> included in the runtime part of
39
40
the application.</p>
42
<marker id="export_messages"></marker>
43
<name>tt() -> void()</name>
46
<p>Transform messages using pretty text as base. Transform messages from pretty
47
text encoding to compact, ber, per and erlang encoding.</p>
48
<p>This call is equivalent to the call:
49
<c><![CDATA[t(pretty, [compact, ber, per, erlang])]]></c></p>
53
<name>tb() -> void()</name>
56
<p>Transform messages using ber binary as base. Transform messages from ber
57
binary encoding to pretty, compact, ber, per and erlang encoding.</p>
58
<p>This call is equivalent to the call:
59
<c><![CDATA[t(ber, [pretty, compact, per, erlang])]]></c></p>
63
<name>t([FromCodec, ToCodecs]) -> ok | {error, Reason}</name>
47
<name>export_messages() -> void()</name>
48
<name>export_messages(MessagePackage) -> void()</name>
64
49
<fsummary></fsummary>
66
<v>FromCodec = codec_string()</v>
67
<v>ToCodecs = [codec_string()]</v>
68
<v>codec_string() = "pretty" | "compact" | "ber" | "per" | "erlang"</v>
51
<v>MessagePackage = atom()</v>
71
<p>Called from the command line (shell) to transform all messages in a given
72
codec dir to a given list of codec dirs. The dirs will <em>not</em> be created.</p>
73
<p>Example: Converts from codec ber to codecs pretty, compact and per</p>
54
<p>Export the messages in the <c>MessagePackage</c> (default is <c>time_test</c>). </p>
55
<p>The out produced by this function is a directory structure with the
56
following structure: </p>
74
57
<code type="none"><![CDATA[
75
\011 erl -noshell -sname megaco ../ebin \\
76
\011 -run megaco_codec_transform t ber "pretty compact per" \\
58
\011 <message package>/pretty/<message-files>
59
\011 compact/<message-files>
60
\011 per/<message-files>
61
\011 ber/<message-files>
62
\011 erlang/<message-files>
82
<name>t(FromCodec, ToCodecs) -> ok | {error, Reason}</name>
85
<v>FromCodec = codec()</v>
86
<v>ToCodecs = [codec()]</v>
87
<v>codec() = pretty | compact | ber | per | erlang</v>
90
<p>Transforms all messages in a given codec dir to a given list of codec dirs.
91
The dirs will <em>not</em> be created.</p>
95
<name>tmf(FromFile, FromCodec, ToCodec) -> ok | {error, Reason}</name>
98
<v>FromFile = string()</v>
99
<v>FromCodec = codec()</v>
100
<v>ToCodec = codec()</v>
103
<p>Transform a message in a file encoded with the given codec to another codec.
104
The resulting message is written to file, in the <c><![CDATA[ToCodec]]></c> dir.</p>
108
<name>tm(FromMsg, FromCodec, ToCodec) -> binary()</name>
109
<fsummary></fsummary>
111
<v>FromMsg = binary()</v>
112
<v>FromCodec = codec()</v>
113
<v>ToCodec = codec()</v>
116
<p>Tranforms a message binary encoded with the given codec to another codec.
117
The resulting message is returned (as a binary).</p>