2#ifndef LIBSBX_FILESYSTEM_FILESYSTEM_BASE_HPP_
3#define LIBSBX_FILESYSTEM_FILESYSTEM_BASE_HPP_
9#include <libsbx/filesystem/file_base.hpp>
10#include <libsbx/filesystem/file_info.hpp>
12namespace sbx::filesystem {
18 using files_list = std::vector<file_info>;
24 [[nodiscard]]
virtual auto initialize() ->
bool = 0;
26 virtual auto shutdown() ->
void = 0;
28 [[nodiscard]]
virtual auto is_initialized()
const ->
bool = 0;
30 [[nodiscard]]
virtual auto base_path()
const ->
const std::string& = 0;
32 [[nodiscard]]
virtual auto virtual_path()
const ->
const std::string& = 0;
34 [[nodiscard]]
virtual auto files()
const -> files_list = 0;
36 [[nodiscard]]
virtual auto is_read_only()
const ->
bool = 0;
38 [[nodiscard]]
virtual auto open_file(
const std::string& path,
const file_base::mode mode) -> file_ptr = 0;
40 virtual auto close_file(
const file_ptr& file) ->
void = 0;
42 [[nodiscard]]
virtual auto create_file(
const std::string& path) -> file_ptr = 0;
44 [[nodiscard]]
virtual auto remove_file(
const std::string& path) ->
bool = 0;
46 [[nodiscard]]
virtual auto copy_file(
const std::string& source,
const std::string& destination,
const bool overwrite =
false) ->
bool = 0;
48 [[nodiscard]]
virtual auto rename_file(
const std::string& source,
const std::string& destination) ->
bool = 0;
50 [[nodiscard]]
virtual auto exists(
const std::string& path)
const ->
bool = 0;
54using filesystem_ptr = std::shared_ptr<filesystem_base>;
55using filesystem_weak_ptr = std::weak_ptr<filesystem_base>;
Definition: filesystem_base.hpp:14