gdpm/include/cache.hpp
David J. Allen 5a73651ad1 Major refactor and API changes
- Updated `.gitignore` file
- Updated `CMakeLists.txt` to build static exectuable
- Changed some `Doxyfile` configurations to build more robust and complete documentation (WIP)
- Changed how `remote` works to better reflect `git`'s API (WIP)
- Changed how error handling works
- Improved `bin/compile.sh` script
- Improved `bin/lines.sh` script (kinda)
- Removed some instances of `fmt` in favor of `std` string functions
- Restructed style for better readibility
2023-05-22 17:54:45 -06:00

32 lines
No EOL
1.4 KiB
C++

#pragma once
#include "constants.hpp"
#include "package.hpp"
#include "error.hpp"
#include "result.hpp"
#include <sqlite3.h>
#include <vector>
#include <string>
namespace gdpm::cache {
struct params {
std::string cache_path = GDPM_PACKAGE_CACHE_PATH;
std::string table_name = GDPM_PACKAGE_CACHE_TABLENAME;
};
error create_package_database(bool overwrite = false, const params& = params());
error insert_package_info(const package::info_list& packages, const params& = params());
result_t<package::info_list> get_package_info_by_id(const package::id_list& package_ids, const params& = params());
result_t<package::info_list> get_package_info_by_title(const package::title_list& package_titles, const params& params = cache::params());
result_t<package::info_list> get_installed_packages(const params& = params());
error update_package_info(const package::info_list& packages, const params& = params());
error update_sync_info(const std::vector<std::string>& download_urls, const params& = params());
error delete_packages(const package::title_list& package_titles, const params& = params());
error delete_packages(const package::id_list& package_ids, const params& = params());
error drop_package_database(const params& = params());
result_t<std::string> to_values(const package::info& package);
result_t<std::string> to_values(const package::info_list& packages);
}