occ
Loading...
Searching...
No Matches
occ::io::FileJsonCache Class Referencefinal

Documents on disk, one file per key. Persists between runs. More...

#include <json_cache.h>

Inheritance diagram for occ::io::FileJsonCache:
[legend]
Collaboration diagram for occ::io::FileJsonCache:
[legend]

Public Member Functions

std::optional< nlohmann::json > load (const std::string &key) const override
 The document stored under key, or nothing if there is none.
 
void store (const std::string &key, const nlohmann::json &doc) override
 
std::string location (const std::string &key) const override
 Where key lives, for log messages: "file <key>" or "memory [<key>]".
 
- Public Member Functions inherited from occ::io::JsonCache
virtual ~JsonCache ()=default
 

Detailed Description

Documents on disk, one file per key. Persists between runs.

Member Function Documentation

◆ load()

std::optional< nlohmann::json > occ::io::FileJsonCache::load ( const std::string &  key) const
overridevirtual

The document stored under key, or nothing if there is none.

A document that exists but cannot be parsed is an error, not a miss.

Implements occ::io::JsonCache.

◆ location()

std::string occ::io::FileJsonCache::location ( const std::string &  key) const
overridevirtual

Where key lives, for log messages: "file <key>" or "memory [<key>]".

Implements occ::io::JsonCache.

◆ store()

void occ::io::FileJsonCache::store ( const std::string &  key,
const nlohmann::json &  doc 
)
overridevirtual

Implements occ::io::JsonCache.


The documentation for this class was generated from the following file: