Loading...
Searching...
No Matches
opencv_json.hpp File Reference
Header-only C++17 value adapter around OpenCV's JSON persistence layer. More...
#include <opencv2/core.hpp>#include <opencv2/core/persistence.hpp>#include <algorithm>#include <array>#include <cctype>#include <charconv>#include <cmath>#include <cstddef>#include <cstdint>#include <cstdlib>#include <initializer_list>#include <limits>#include <map>#include <memory>#include <stdexcept>#include <string>#include <string_view>#include <system_error>#include <type_traits>#include <utility>#include <vector>
Include dependency graph for opencv_json.hpp:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Data Structures | |
| struct | usher_cv_json::Node |
| Heap-backed tagged storage independent of a FileStorage lifetime. More... | |
| class | usher_cv_json::Value |
| C++ value interface with explicit conversions and OpenCV JSON I/O. More... | |
| class | usher_cv_json::Value::exception |
| Adapter errors exposed independently of OpenCV's exception type. More... | |
| struct | usher_cv_json::Value::is_std_array< Type > |
| False primary trait; unsupported conversions must not masquerade as arrays. More... | |
| struct | usher_cv_json::Value::is_std_array< std::array< Type, Count > > |
| Recognize fixed arrays so get() can require their exact length. More... | |
| struct | usher_cv_json::Value::is_std_vector< Type > |
| False primary trait for dynamic-vector conversion detection. More... | |
| struct | usher_cv_json::Value::is_std_vector< std::vector< Type, Allocator > > |
| Recognize vectors without fixing their element allocator. More... | |
Namespaces | |
| namespace | usher_cv_json |
| OpenCV-backed JSON values and the internal tree supporting them. | |
Detailed Description
Header-only C++17 value adapter around OpenCV's JSON persistence layer.
OpenCV remains the parser and ordinary writer. Normalization carries null, booleans and 64-bit integers through reserved string markers so those types are not lost in FileStorage's representation. Nodes are then detached from FileStorage into a heap-backed tree usable by existing C++ consumers.
- Ownership and mutation
- Ordinary Value copies recursively clone their trees. Child lookups and items() initially return shared child handles instead, allowing a selected child's mutators to affect its parent. Copying such a handle creates an independent tree; assigning a new Value to the handle rebinds the handle, not the parent slot.
- Deliberate limits of this adapter
- This is not JSONbourne's bounded arena API: strings, maps, vectors and shared nodes allocate, while cloning, conversion and serialization recurse. No fixed nesting or allocation budget is imposed here. Objects use unique sorted map keys rather than retaining duplicate members or their original source order.
- Precondition
- Application string/key data must not use the reserved __USHER_OPENCV_JSON_ namespace, which belongs to the transport representation.
- Note
- OpenCV acceptance and this adapter's normalization determine accepted input; this wrapper is not an independent strict RFC 8259 validator.
Definition in file opencv_json.hpp.