|
nfx-serialization 0.3.0
Cross-platform C++ JSON serialization library with extensible trait capabilities
|
Path iterator for traversing all paths in a JSON document. More...
#include <nfx/serialization/json/Document.h>
Classes | |
| struct | Entry |
| Represents a single path entry in the document. More... | |
| class | Iterator |
| Forward iterator for path entries. More... | |
Public Types | |
| enum class | Format : bool { JsonPointer = 0 , DotNotation } |
| Format for path string representation. More... | |
Public Member Functions | |
| PathView (const Document &doc, Format format=Format::JsonPointer, bool includeContainers=true) | |
| Construct PathView for a document. | |
| Iterator | begin () const |
| Get iterator to first entry. | |
| Iterator | end () const |
| Get iterator past last entry. | |
| size_t | size () const |
| Get number of path entries. | |
| bool | empty () const |
| Check if empty. | |
| const Entry & | operator[] (size_t index) const |
| Access entry by index. | |
| std::vector< Entry > | leaves () const |
| Get only leaf entries (primitives). | |
Path iterator for traversing all paths in a JSON document.
Provides depth-first traversal of all JSON paths with their values. Supports both JSON Pointer format ("/user/name") and dot notation ("user.name").
Example usage:
Definition at line 1106 of file Document.h.
|
strong |
Format for path string representation.
| Enumerator | |
|---|---|
| JsonPointer | RFC 6901 JSON Pointer format (e.g., "/user/addresses/0/city"). |
| DotNotation | Dot notation format (e.g., "user.addresses[0].city"). |
Definition at line 1122 of file Document.h.
|
explicit |
Construct PathView for a document.
| doc | Document to iterate |
| format | Path format to use |
| includeContainers | Whether to include object/array container paths |
Example usage:

|
inline |
Get iterator to first entry.
Definition at line 1208 of file Document.h.
|
inline |
|
inline |
Get iterator past last entry.
Definition at line 1214 of file Document.h.
| std::vector< Entry > nfx::serialization::json::Document::PathView::leaves | ( | ) | const |
Get only leaf entries (primitives).
|
inline |
Access entry by index.
| index | Index of entry |
Definition at line 1237 of file Document.h.
|
inline |