mirror of
https://github.com/obsqrbtz/clrsync.git
synced 2026-04-09 04:29:04 +03:00
init
This commit is contained in:
45
src/core/io/file.hpp
Normal file
45
src/core/io/file.hpp
Normal file
@@ -0,0 +1,45 @@
|
||||
#ifndef CLRSYNC_CORE_IO_FILE_HPP
|
||||
#define CLRSYNC_CORE_IO_FILE_HPP
|
||||
#include <cstdint>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <variant>
|
||||
|
||||
using value_type = std::variant<std::string, uint32_t, int, bool>;
|
||||
|
||||
namespace clrsync::core::io
|
||||
{
|
||||
class file
|
||||
{
|
||||
public:
|
||||
file() = default;
|
||||
file(std::string path) {};
|
||||
virtual bool parse() { return false; };
|
||||
virtual const std::string get_string_value(const std::string §ion,
|
||||
const std::string &key) const
|
||||
{
|
||||
return {};
|
||||
}
|
||||
virtual uint32_t get_uint_value(const std::string §ion, const std::string &key) const
|
||||
{
|
||||
return {};
|
||||
}
|
||||
virtual uint32_t get_bool_value(const std::string §ion, const std::string &key) const
|
||||
{
|
||||
return {};
|
||||
}
|
||||
virtual std::map<std::string, value_type> get_table(const std::string §ion_path) const
|
||||
{
|
||||
return {};
|
||||
}
|
||||
virtual void set_value(const std::string §ion, const std::string &key,
|
||||
const value_type &value)
|
||||
{
|
||||
insert_or_update_value(section, key, value);
|
||||
}
|
||||
virtual void insert_or_update_value(const std::string §ion, const std::string &key,
|
||||
const value_type &value) {};
|
||||
virtual void save_file() {};
|
||||
};
|
||||
} // namespace clrsync::core::io
|
||||
#endif
|
||||
Reference in New Issue
Block a user