ini_parser.qbk 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. [/
  2. / Copyright (c) 2008 Marcin Kalicinski (kalita <at> poczta dot onet dot pl)
  3. / Copyright (c) 2009 Sebastian Redl (sebastian dot redl <at> getdesigned dot at)
  4. /
  5. / Distributed under the Boost Software License, Version 1.0. (See accompanying
  6. / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. /]
  8. [section INI Parser]
  9. [def __ini__ [@http://en.wikipedia.org/wiki/INI INI format]]
  10. The __ini__ was once widely used in the world of Windows. It is now deprecated,
  11. but is still used by a surprisingly large number of applications. The reason is
  12. probably its simplicity, plus that Microsoft recommends using the registry as
  13. a replacement, which not all developers want to do.
  14. INI is a simple key-value format with a single level of sectioning. It is thus
  15. less rich than the property tree dataset, which means that not all property
  16. trees can be serialized as INI files.
  17. The INI parser creates a tree node for every section, and a child node for
  18. every property in that section. All properties not in a section are directly
  19. added to the root node. Empty sections are ignored. (They don't round-trip, as
  20. described below.)
  21. The INI serializer reverses this process. It first writes out every child of the
  22. root that contains data, but no child nodes, as properties. Then it creates a
  23. section for every child that contains child nodes, but no data. The children of
  24. the sections must only contain data. It is an error if the root node contains
  25. data, or any child of the root contains both data and content, or there's more
  26. than three levels of hierarchy. There must also not be any duplicate keys.
  27. An empty tree node is assumed to be an empty property. There is no way to create
  28. empty sections.
  29. Since the Windows INI parser discards trailing spaces and does not support
  30. quoting, the property tree parser follows this example. This means that
  31. property values containing trailing spaces do not round-trip.
  32. [endsect] [/ini_parser]