Releases: nircoe/datacoe
Releases · nircoe/datacoe
v0.1.0
datacoe v0.1.0 - Initial Release
datacoe is a small, simple and generic C++ data management library template for game development that provides functionalities for data persistence, serialization, and encryption.
Features
- Data Management: Easy-to-use API for reading and writing game data to files
- JSON Serialization: Uses nlohmann/json for robust data serialization and deserialization
- Optional Encryption: AES encryption via CryptoPP with the ability to disable when not needed
- Automatic Format Detection: Handles both encrypted and unencrypted files automatically
- Comprehensive Test Suite: Extensive tests covering functionality, performance, error handling, and memory usage
- Cross-Platform: Works on Windows, macOS, and Linux with multiple compiler support
Getting Started
# Fork the repository on GitHub first and clone your fork with submodules
git clone --recurse-submodules https://github.com/yourusername/datacoe.git
# Or just clone the repository with submodules
git clone --recurse-submodules https://github.com/nircoe/datacoe.git
cd datacoe
# Build
mkdir build && cd build
cmake ..
cmake --build .
# Run tests
./tests/all_testsIntegration Methods
As Subdirectory (For Development)
add_subdirectory(path/to/datacoe)
target_link_libraries(your_app PRIVATE datacoe)With find_package (For Distribution)
# Build and install datacoe
cd path/to/datacoe
mkdir build && cd build
cmake ..
cmake --build .
cmake --install . --prefix <install_path>
# In your project
find_package(datacoe REQUIRED)
target_link_libraries(your_app PRIVATE datacoe)Usage Example
#include <datacoe/data_manager.hpp>
// Initialize
datacoe::DataManager manager;
bool loadSuccess = manager.init("save_game.json");
// Note: When init() returns false, it indicates no existing save was found,
// and a new default GameData instance was created internally
// Create and set data
datacoe::GameData gameData("Player1", 1000);
manager.setGamedata(gameData);
// Save to disk (with optional encryption)
bool saveSuccess = manager.saveGame();
// Load data
if (manager.loadGame()) {
const datacoe::GameData& data = manager.getGamedata();
std::string playerName = data.getNickname();
int score = data.getHighscore();
}Dependencies
- CryptoPP: Included as git submodule (external/cryptopp-cmake)
- nlohmann/json: Included as git submodule (external/json)
- Google Test: Automatically fetched when building tests
For full documentation and integration instructions, see the [README.md](https://github.com/nircoe/datacoe/blob/main/README.md)