Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# cache0

![Build Status](https://github.com/algotyrnt/cache0/actions/workflows/run_tests.yml/badge.svg)
![Language](https://img.shields.io/badge/language-C++17-blue.svg)
![License](https://img.shields.io/badge/license-MIT-green.svg)
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README advertises an MIT license badge, but there is no LICENSE (or similar) file in the repository. This is misleading for users and automated tooling. Add the appropriate license file or update/remove the badge to match the actual licensing.

Suggested change
![License](https://img.shields.io/badge/license-MIT-green.svg)

Copilot uses AI. Check for mistakes.

**cache0** is a lightweight, persistent Key-Value store built from scratch in C++. It is designed to demonstrate core systems programming concepts including memory management, file persistence (RAII), and the Standard Template Library (STL).

## Features

- **In-Memory Speed:** Uses `std::unordered_map` for $O(1)$ average time complexity on lookups.
- **Persistence:** Automatically saves data to disk on exit and loads on startup (RAII pattern).
- **Safety:** Utilizes `std::optional` to handle missing keys gracefully.
- **Modern C++:** Written in C++17.

## Getting Started

### Prerequisites
- A C++ compiler supporting C++17 (GCC, Clang, or MSVC).

### Directory Structure
```text
Cache0/
├── include/
│ └── cache0.hpp # The Product (Header-Only Library)
├── src/
│ └── main.cpp # The Example/Demo file
Comment on lines +25 to +27
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment labels include/cache0.hpp as a "Header-Only Library", but the implementation currently lives in src/cache0.cpp (so it is not header-only). Either adjust the README wording or convert the library to be truly header-only.

Suggested change
│ └── cache0.hpp # The Product (Header-Only Library)
├── src/
│ └── main.cpp # The Example/Demo file
│ └── cache0.hpp # Public header for the cache0 library
├── src/
│ ├── cache0.cpp # Library implementation
│ └── main.cpp # Example/Demo file

Copilot uses AI. Check for mistakes.
├── tests/
│ └──test_cache0.cpp # Unit Tests
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the directory tree, └──test_cache0.cpp is missing a space after the branch symbol, which makes the formatting inconsistent with the other entries.

Suggested change
│ └──test_cache0.cpp # Unit Tests
│ └── test_cache0.cpp # Unit Tests

Copilot uses AI. Check for mistakes.
├── .gitignore # The ignore file
├── .github/ # The CI workflow
└── README.md # Readme File
Comment on lines +23 to +32
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The listed directory structure does not match the current repo layout (e.g., the repo has test/ not tests/, and there is a src/cache0.cpp implementation file that is not shown). Please update the tree to reflect the actual top-level folders/files to avoid onboarding confusion.

Suggested change
Cache0/
├── include/
│ └── cache0.hpp # The Product (Header-Only Library)
├── src/
│ └── main.cpp # The Example/Demo file
├── tests/
│ └──test_cache0.cpp # Unit Tests
├── .gitignore # The ignore file
├── .github/ # The CI workflow
└── README.md # Readme File
cache0/
├── include/
│ └── cache0.hpp # Public header
├── src/
│ ├── cache0.cpp # Implementation file
│ └── main.cpp # Example/Demo executable
├── test/
│ └── test_cache0.cpp # Unit tests
├── .gitignore # Git ignore rules
├── .github/ # CI workflows
└── README.md # Project documentation

Copilot uses AI. Check for mistakes.
```