Added section to README.md and minor fixes

This commit is contained in:
David Allen 2023-07-02 08:39:10 -06:00
parent 6141a24473
commit 37b65c0939
7 changed files with 83 additions and 40 deletions

View file

@ -48,7 +48,7 @@ namespace gdpm::config{
error load(std::filesystem::path path, context& config);
error save(std::filesystem::path path, const context& config);
error handle_config(config::context& config, const args_t& args, const var_opts& opts);
error set_property(config::context& config, const string& property, const any& value);
error set_property(config::context& config, const string& property, const string& value);
template <typename T = any>
T& get_property(const config::context& config, const string& property);
context make_context(const string& username = GDPM_CONFIG_USERNAME, const string& password = GDPM_CONFIG_PASSWORD, const string& path = GDPM_CONFIG_PATH, const string& token = GDPM_CONFIG_TOKEN, const string& godot_version = GDPM_CONFIG_GODOT_VERSION, const string& packages_dir = GDPM_CONFIG_LOCAL_PACKAGES_DIR, const string& tmp_dir = GDPM_CONFIG_LOCAL_TMP_DIR, const string_map& remote_sources = {GDPM_CONFIG_REMOTE_SOURCES}, int jobs = GDPM_CONFIG_THREADS, int timeout = 0, bool enable_sync = GDPM_CONFIG_ENABLE_SYNC, bool enable_file_logging = GDPM_CONFIG_ENABLE_FILE_LOGGING, int verbose = GDPM_CONFIG_VERBOSE);

View file

@ -1,6 +1,5 @@
#pragma once
#include "clipp.h"
#include <tuple>
#include <functional>
#include <type_traits>
@ -77,6 +76,7 @@ namespace gdpm{
return sl;
}
inline opts_t unwrap(const var_opts& opts){
opts_t o;
std::for_each(opts.begin(), opts.end(), [&o](const var_opt& opt){

View file

@ -72,6 +72,7 @@ namespace gdpm::utils {
from.erase(part);
}
bool to_bool(const std::string& s);
std::vector<std::string> split_lines(const std::string& contents);
std::string readfile(const std::string& path);
std::string to_lower(const std::string& s);