#include "fson/Value.hh"
Abstract base of every FSON value. Non-copyable, non-movable — duplicate with clone().
| Member | Description |
|---|---|
enum class Type { Null, Boolean, Number, String, Array, Object } | |
getType() → Type | dynamic type |
clone() → std::unique_ptr<Value> | deep copy including attached comments |
isNull() … isObject() → bool | type predicates |
asNull() … asObject() | checked casts — nullptr on a type mismatch (const and non-const overloads). No dynamic_cast needed. |
if( Number* n = v->asNumber() ) std::cout << n->asDouble();
else if( String* s = v->asString() ) std::cout << s->getValue();
Null — fson/Null.hh
The literal null. Default-constructible, no further state.
Boolean — fson/Boolean.hh
Boolean( bool = false );
bool getValue() const;
void setValue( bool );
Number and String
The two leaf types with real state have their own pages: Number, String.

