Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Latest commit

 

History

History
74 lines (59 loc) · 867 Bytes

README.md

File metadata and controls

74 lines (59 loc) · 867 Bytes

pfile

Yet another config parser.

Dependencies

  • rebar
  • make

Build

To build the pfile library just run make.

$ make

Example:

#first anonymous section
list = {1;2;3;4;5;6}; # list of values

option_list = 
{
  key1 = 1;
  key2 = "string";
};

complex_option_list = 
{
  {
    key1 = 1;
    key2 = "string";
  };
  {
    key1 = 2;
    key2 = "text";
  };
};

[first_section]
key1 = 1;
key2 = "string";

[optionset]
{
  id = 1;
  name = "the \"first\"";
};
{
  id = 2;
  name = 
"the second
with
wrapped
name
";
};

Other examples can be founded in priv:

{ok, Data} = file:read_file("../priv/config.cfg").
pfile:parse(binary_to_list(Data)).

Testing

There is a possible bug in line counting. So, unit test a not valid now. Waiting for pull request approvement: erlang/otp#431