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

Yet another config parser

License

GPL-3.0, LGPL-3.0 licenses found

Licenses found

GPL-3.0
LICENSE
LGPL-3.0
LICENSE.LESSER
Notifications You must be signed in to change notification settings

archimed-shaman/pfile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Yet another config parser

Resources

License

GPL-3.0, LGPL-3.0 licenses found

Licenses found

GPL-3.0
LICENSE
LGPL-3.0
LICENSE.LESSER

Stars

Watchers

Forks

Packages

No packages published

Languages