The reference manual describes the fson public API in a narrative, task-oriented form. The exhaustive machine-produced companion is the generated Doxygen tree.
All types are in namespace fedem::fson; diagnostics reuse fedem::parser::ParseError from the cparse library. Headers are #include "fson/<Name>.hh". The public API is C++17-compatible.
Ownership
Values are owned through std::unique_ptr<Value>. The polymorphic types are neither copyable nor movable — duplicate with clone(), which deep-copies a value and its attached comments. The trivia carriers Member and Element are move-only and also expose clone().
The map
| Layer | Types | Page |
|---|---|---|
| One-line entry point | Fson, LoadResult | Fson, LoadResult |
| Whole file | Document | Document |
| Containers | Object, Array | Object, Array |
| Leaf values | Value, Null, Boolean, Number, String | Value & leaf types |
| Trivia | Comment, CommentList, Key, Member, Element, Include | Comment & CommentList |
| Parse | FsonParser | FsonParser |
| Serialize | FsonWriter (Dialect, DisabledMemberPolicy) | FsonWriter |
| Diagnostics | ParseError | ParseError |
The one-minute version
#include "fson/Fson.hh"
#include "fson/String.hh"
using namespace fedem::fson;
auto r = Fson::load( "config.fson" );
if( r.ok() )
{
long long port = r.document->getInteger( "database.port", 5432 );
r.document->setPath( "database.host", std::make_unique<String>( "db1" ) );
Fson::save( *r.document, "config.fson" ); // every comment intact
}

