Class view

Nested Relationships

Class Documentation

class legion::core::filesystem::view

Generates a view onto the virtual filesystem, can be used to do all kinds of fun stuff with, the underlying drivers.

Public Functions

view(const view &other) = default
view(view &&other) noexcept = default
view &operator=(const view &other) = default
view &operator=(view &&other) noexcept = default
virtual ~view() = default
inline view(std::string_view path)
operator bool() const

Checks the view for validity.

Note

No deep check!

bool is_valid(bool deep_check = false) const

Checks the view for validity.

Parameters
  • deep_check: Also checks if the provided path can be resolved instead of doing just a basic sanity check.

file_traits file_info() const

Gets the traits of the file pointed to.

filesystem_traits filesystem_info() const

Gets the traits of the top most filesystem pointed to.

std::string get_domain() const

Gets the root domain.

const std::string &get_virtual_path() const

Gets full virtual path.

common::result_decay_more<std::string, fs_error> get_extension() const

Gets file extension if applicable.

Note

You can use legion::common::valid to check for validity.

common::result_decay_more<std::string, fs_error> get_filename() const

Gets file name if applicable.

Note

You can use legion::common::valid to check for validity.

common::result_decay_more<std::string, fs_error> get_filestem() const

Gets file name if applicable.

Note

You can use legion::common::valid to check for validity.

common::result_decay_more<basic_resource, fs_error> get()

Gets the contents of the resource pointed to.

Note

You can use legion::common::valid to check for validity.

common::result_decay_more<const basic_resource, fs_error> get() const
common::result<void, fs_error> set(const basic_resource &resource)

Sets the contents of the resource pointed to.

Note

When setting was not possible has_err() will be true and get_err().what() will contain information on what went wrong.

view parent() const

Gets the parent folder of the file/folder and creates a new view from it.

virtual view find(std::string_view identifier) const

Creates a new view from a sub path (by first joining them together and then sanitizing the input)

view operator[](std::string_view identifier) const

alternative syntax for find

template<class T, class ...Args>
inline auto load_as(Args&&... args) -> decltype(auto)

same as get().decay().to<T>()

common::result_decay_more<std::vector<view>, fs_error> ls() const
inline view operator/(std::string_view identifier) const

alternative syntax for find

Protected Functions

view() = default
std::string create_identifier(const navigator::solution::iterator&) const
std::shared_ptr<filesystem_resolver> build() const
void make_inheritance() const
std::shared_ptr<create_chain> translate_solution() const
common::result<void, fs_error> make_solution() const

Protected Attributes

std::string m_path
mutable navigator::solution m_foundSolution = {}
struct create_chain

Public Members

std::shared_ptr<mem_filesystem_resolver> subject
std::shared_ptr<filesystem_resolver> provider
std::shared_ptr<create_chain> next