Unravel Engine C++ Reference
|
Namespaces | |
namespace | detail |
Classes | |
class | cache |
class | pattern_filter |
A filter that combines include and exclude patterns for file/directory filtering. More... | |
struct | stream_buffer |
class | syncer |
class | watcher |
class | wildcard_pattern |
A wildcard pattern matcher that supports * (match any sequence) and ? (match single character) More... | |
Typedefs | |
using | directory_cache = cache<directory_iterator> |
using | recursive_directory_cache = cache<recursive_directory_iterator> |
using | protocols_t = std::unordered_map<std::string, std::string> |
using | byte_array_t = std::vector<std::uint8_t> |
Functions | |
template<typename Iterator = recursive_directory_iterator> | |
auto | make_filtered_cache (const fs::path &path, const std::vector< std::string > &includes, const std::vector< std::string > &excludes={}, std::chrono::steady_clock::duration scan_frequency=std::chrono::milliseconds(500)) -> cache< Iterator > |
Convenience function to create a directory cache with pattern filtering. | |
bool | is_case_insensitive () |
byte_array_t | read_stream (std::istream &stream) -> byte_array_t |
Load a byte_array_t with the contents of the specified file, be that file in a package or in the main file system. | |
std::string | read_stream_str (std::istream &stream) |
stream_buffer< byte_array_t > | read_stream_buffer (std::istream &stream) |
stream_buffer< std::string > | read_stream_buffer_str (std::istream &stream) |
bool | add_path_protocol (const std::string &protocol, const path &directory) -> bool |
Allows us to map a protocol to a specific directory. A path protocol gives the caller the ability to prepend an identifier to their file name i.e. "engine_data://textures/tex.png" and have it return the relevant mapped path. | |
protocols_t & | get_path_protocols () -> protocols_t & |
Returns the registered path protocols. | |
path | extract_protocol (const path &_path) -> path |
Given the specified path/filename, resolve the final full filename. This will be based on either the currently specified root path, or one of the 'path protocol' identifiers if it is included in the filename. | |
path | resolve_protocol (const path &_path) -> path |
Given the specified path/filename, resolve the final full filename. This will be based on either the currently specified root path, or one of the 'path protocol' identifiers if it is included in the filename. | |
bool | has_known_protocol (const path &_path) -> bool |
Checks whether the path has a known protocol. | |
path | convert_to_protocol (const path &_path) -> path |
Oposite of the resolve_protocol this function tries to convert to protocol path from an absolute one. | |
path | replace (const path &_path, const path &_sequence, const path &_new_sequence) -> path |
Replacing any occurences of the specified path sequence with another. | |
std::vector< path > | split_until (const path &_path, const path &_predicate) -> std::vector< path > |
another. | |
path | reduce_trailing_extensions (const path &_path) -> path |
another. | |
bool | is_any_parent_path (const path &parent, const path &child) |
auto | make_pattern_filter (const std::string &pattern) -> pattern_filter |
Convenience function to create a pattern filter from a single wildcard string Maintains backward compatibility with existing "*" usage. | |
auto | make_pattern_filter (const std::vector< std::string > &includes, const std::vector< std::string > &excludes={}) -> pattern_filter |
Convenience function to create a pattern filter with include and exclude lists. | |
auto | to_string (const watcher::entry &e) -> std::string |
using fs::byte_array_t = std::vector<std::uint8_t> |
Definition at line 14 of file filesystem.h.
using fs::directory_cache = cache<directory_iterator> |
using fs::protocols_t = std::unordered_map<std::string, std::string> |
Definition at line 13 of file filesystem.h.
using fs::recursive_directory_cache = cache<recursive_directory_iterator> |
auto fs::add_path_protocol | ( | const std::string & | protocol, |
const path & | dir ) |
Allows us to map a protocol to a specific directory. A path protocol gives the caller the ability to prepend an identifier to their file name i.e. "engine_data://textures/tex.png" and have it return the relevant mapped path.
Definition at line 181 of file filesystem.cpp.
auto fs::convert_to_protocol | ( | const path & | _path | ) |
Oposite of the resolve_protocol this function tries to convert to protocol path from an absolute one.
Definition at line 265 of file filesystem.cpp.
auto fs::extract_protocol | ( | const path & | _path | ) |
Given the specified path/filename, resolve the final full filename. This will be based on either the currently specified root path, or one of the 'path protocol' identifiers if it is included in the filename.
Definition at line 200 of file filesystem.cpp.
auto fs::get_path_protocols | ( | ) |
Returns the registered path protocols.
Definition at line 194 of file filesystem.cpp.
auto fs::has_known_protocol | ( | const path & | _path | ) |
Checks whether the path has a known protocol.
Definition at line 246 of file filesystem.cpp.
auto fs::is_any_parent_path | ( | const path & | parent, |
const path & | child ) |
Definition at line 342 of file filesystem.cpp.
bool fs::is_case_insensitive | ( | ) |
Definition at line 125 of file filesystem.cpp.
auto fs::make_filtered_cache | ( | const fs::path & | path, |
const std::vector< std::string > & | includes, | ||
const std::vector< std::string > & | excludes = {}, | ||
std::chrono::steady_clock::duration | scan_frequency = std::chrono::milliseconds(500) ) -> cache<Iterator> |
auto fs::make_pattern_filter | ( | const std::string & | pattern | ) | -> pattern_filter |
Convenience function to create a pattern filter from a single wildcard string Maintains backward compatibility with existing "*" usage.
pattern | Single pattern string |
Definition at line 175 of file pattern_filter.cpp.
auto fs::make_pattern_filter | ( | const std::vector< std::string > & | includes, |
const std::vector< std::string > & | excludes = {} ) -> pattern_filter |
Convenience function to create a pattern filter with include and exclude lists.
includes | Include patterns (OR logic) |
excludes | Exclude patterns (NOT logic) |
Definition at line 180 of file pattern_filter.cpp.
auto fs::read_stream | ( | std::istream & | stream | ) |
Load a byte_array_t with the contents of the specified file, be that file in a package or in the main file system.
Definition at line 153 of file filesystem.cpp.
auto fs::read_stream_buffer | ( | std::istream & | stream | ) |
Definition at line 167 of file filesystem.cpp.
auto fs::read_stream_buffer_str | ( | std::istream & | stream | ) |
Definition at line 174 of file filesystem.cpp.
auto fs::read_stream_str | ( | std::istream & | stream | ) |
Definition at line 160 of file filesystem.cpp.
auto fs::reduce_trailing_extensions | ( | const path & | _path | ) |
another.
Definition at line 328 of file filesystem.cpp.
auto fs::replace | ( | const path & | _path, |
const path & | _sequence, | ||
const path & | _new_sequence ) |
Replacing any occurences of the specified path sequence with another.
Definition at line 305 of file filesystem.cpp.
auto fs::resolve_protocol | ( | const path & | _path | ) |
Given the specified path/filename, resolve the final full filename. This will be based on either the currently specified root path, or one of the 'path protocol' identifiers if it is included in the filename.
Definition at line 215 of file filesystem.cpp.
auto fs::split_until | ( | const path & | _path, |
const path & | _predicate ) |
another.
Definition at line 310 of file filesystem.cpp.
auto fs::to_string | ( | const watcher::entry & | e | ) | -> std::string |
Definition at line 617 of file watcher.cpp.