Go to the documentation of this file.
9 #ifndef EAGINE_FILE_CONTENTS_HPP
10 #define EAGINE_FILE_CONTENTS_HPP
13 #include "config/basic.hpp"
46 explicit operator bool() const noexcept {
53 return bool(EAGINE_LIKELY(_pimpl)) ? _pimpl->block()
65 std::shared_ptr<file_contents_intf> _pimpl{};
73 ,
public structured_memory_block<const T> {
89 #if !EAGINE_LINK_LIBRARY || defined(EAGINE_IMPLEMENTING_LIBRARY)
90 #include <eagine/file_contents.inl>
93 #endif // EAGINE_FILE_CONTENTS_HPP
Class providing access to the contents of a file.
Definition: file_contents.hpp:30
Common code is placed in this namespace.
Definition: eagine.hpp:21
auto block() const noexcept -> memory::const_block
Returns the block viewing the loaded file contents.
Definition: file_contents.hpp:52
basic_block< true > const_block
Alias for const byte memory span.
Definition: block.hpp:32
Class loading a baked structured data from a file.
Definition: file_contents.hpp:71
structured_file_content(file_contents &&fc)
Construction from a file contents instance.
Definition: file_contents.hpp:82
auto is_loaded() const noexcept -> bool
Checks if the contents were loaded.
Definition: file_contents.hpp:40
Base template for abstract interfaces, implements common functionality.
Definition: interface.hpp:18
Non-owning view of a contiguous range of memory with ValueType elements.
Definition: flatten_fwd.hpp:16
structured_file_content(string_view path)
Constructor that opens and loads contents of file at the given path.
Definition: file_contents.hpp:76
file_contents()=default
Default constructor.
Class holding a single tagged data member.
Definition: protected_member.hpp:20
Interface for file content getter implementations.
Definition: file_contents.hpp:24
auto get_the_member(type_identity< file_contents >=type_identity< file_contents >()) noexcept -> file_contents &
Returns a reference to the stored member.
Definition: protected_member.hpp:23