mochifmt
String Formatting for Erlang, inspired by Python 2.6 (PEP 3101).
String Formatting for Erlang, inspired by Python 2.6
(
Functions
bformat(Format::string(), Args) -> binary()
Format Args with Format and return a binary().
bformat(Format::string(), Args, Module) -> binary()
Format Args with Format using Module and return a binary().
convert_field(Arg, Conversion::conversion()) -> term()
Process Arg according to the given explicit conversion specifier.
f(Format::string(), Args) -> string()
Format Args with Format and return a string().
f(Format::string(), Args, Module) -> string()
Format Args with Format using Module and return a string().
format(Format::string(), Args) -> iolist()
Format Args with Format.
format(Format::string(), Args, Module) -> iolist()
Format Args with Format using Module.
format_field(Arg, Format) -> iolist()
Format Arg with Format.
format_field(Arg, Format, Module::_Module) -> iolist()
Format Arg with Format.
get_field(Key::string(), Args) -> term()
Consecutively call get_value/2 on parts of Key delimited by ".", replacing Args with the result of the previous get_value. This is used to implement formats such as {0.0}.
get_field(Key::string(), Args, Module) -> term()
Consecutively call Module:get_value/2 on parts of Key delimited by ".", replacing Args with the result of the previous get_value. This is used to implement formats such as {0.0}.
get_value(Key::string(), Args::args()) -> term()
Get the Key from Args. If Args is a tuple then convert Key to an integer and get element(1 + Key, Args). If Args is a list and Key can be parsed as an integer then use lists:nth(1 + Key, Args), otherwise try and look for Key in Args as a proplist, converting Key to an atom or binary if necessary.
tokenize(S::string()) -> tokens()
Tokenize a format string into mochifmt's internal format.