Clone this repo:
  1. 0cd8b12 Merge pull request #3 from google/chunxiangzheng-patch-1 by spf2 · 5 years ago upstream/main
  2. d4a6624 Make proto-data-store.h depends on absl/strings/str_cat.h directly by Chunxiang Zheng · 5 years ago upstream/chunxiangzheng-patch-1
  3. 4c8c851 Merge pull request #2 from google/chunxiangzheng-patch-1 by spf2 · 5 years ago
  4. a978cb6 Include absl/strings/str_cat.h directly by Chunxiang Zheng · 5 years ago
  5. 4993f2f Merge pull request #1 from google/chunxiangzheng-patch-1 by Chunxiang Zheng · 5 years ago

ProtoDataStore C++

A simple file-backed proto with an in-memory cache.

Features

  1. Caches proto in RAM after first read for performance.
  2. Uses a checksum to verify integrity of data.
  3. Leverages modern Abseil error handling and memory management.

Usage

#include "protostore/file-storage.h"
#include "protostore/proto-data-store.h"

FileStorage storage;
ProtoDataStore<TestProto> pds(storage, testfile);

MyProto myproto;
myproto.set_value("hi");
absl::Status result = pds.Write(myproto);
if (!result.ok()) // error handling

Compared to Jetpack DataStore

This library is a C++ implementation from the same origin as Jetpack DataStore. Unlike that library, it does not support concurrent writes and the on-disk format is incompatible.