Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/erikzenker/filestatedatabase
A C++ class, that helps you to save the state of files in a sql database.
https://github.com/erikzenker/filestatedatabase
Last synced: 26 days ago
JSON representation
A C++ class, that helps you to save the state of files in a sql database.
- Host: GitHub
- URL: https://github.com/erikzenker/filestatedatabase
- Owner: erikzenker
- License: gpl-3.0
- Created: 2013-09-20T07:32:26.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-04-30T17:29:08.000Z (over 10 years ago)
- Last Synced: 2024-10-30T01:44:45.843Z (2 months ago)
- Language: C++
- Size: 168 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
FileStateDatabase
=================A C++ class, that helps you to save the state of files in a sql database. It is a header only class.
## Description ##
## Build ##
+ include FileStateDatabase.h
+ compile with -lsqlite3 -lboost_system -lboost_filesystem -std=c++11
+ example: clang++ main.cc -I . -lsqlite3 -lboost_system -lboost_filesystem -std=c++11## Example ##
Small example explains how to use FileStateDatabase. (see main.cc)
```c++#include
#includeint main(int argc, char **argv){
if(argc <= 1){
std::cout << "Usage: ./a.out /dir/to/generate/filestates" << std::endl;
return 1;
}boost::filesystem::path dir(argv[1]);
FileStateDatabase fileStateDatabase("my_filestate_database", dir);// Get updates since last getUpdates
std::vector > updates = fileStateDatabase.getUpdates();for(auto update: updates){
FileState fs = update.first;
ModState ms = update.second;
std::cout << "Update: " << fs.path << " " << fs.modtime << " " << FileStateDatabase::modStateToString(ms) << std::endl;// Propagate modstate into database
fileStateDatabase.propagateUpdate(update);
}return 0;
}```
## Dependencies ##
+ boost
+ c++11
+ sqlite3## Copyrigth
License GPLv3+: GNU GPL version 3 or later .
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.## Author ##
Written by Erik Zenker ([email protected])