Comment, CommentList — fson/Comment.hh
A single comment, stored without its delimiters.
| Member | Description |
|---|---|
enum class Kind { SingleLine, MultiLine } | // … vs /* … */ |
Comment(Kind, std::string text) | construct |
getKind() → Kind | |
getText() → std::string const& / setText(text) | text between the delimiters; nested /* */ pairs appear verbatim in a MultiLine text |
CommentList is std::vector<Comment>. Comments attach to model nodes as leading (before a member / element), trailing (end of that line), dangling (before } / ]), and document header / footer lists — all exposed by reference and freely editable. Comment text is never re-indented or reflowed by the writer.
Key — fson/Object.hh
| Member | Description |
|---|---|
enum class Form { Quoted, Bare } | |
Key(Form, std::string), Key::quoted(name), Key::bare(name) | bare() throws std::invalid_argument for a grammar-invalid name |
static isValidName(text) → bool | the name grammar |
getForm() → Form / getName() → std::string const& |
Member — fson/Object.hh {#member}
One key/value pair with trivia and the disabled flag. Move-only; clone().
| Member | Description |
|---|---|
Member(Key, std::unique_ptr<Value>, bool disabled = false) | |
getKey() → Key const& / setKey(Key) | |
isDisabled() → bool / setDisabled(bool) | the -- flag |
getValue() → Value& / setValue(std::unique_ptr<Value>) | |
getLeadingComments() → CommentList& | |
getTrailingComment() → std::optional<Comment>& | |
getOriginFile() → std::string const& | empty for a host member; the source file for a %include-merged one |
getOriginLocalPath() → std::string const& | the value's path within that file (differs from the host query path for aliases) |
setOrigin(file, localPath) / isMerged() → bool | set by include resolution |
Element — fson/Array.hh
One array slot's trivia — see Array.

