|
Unravel Engine C++ Reference
|
Namespaces | |
| namespace | detail |
| namespace | file_stream_detail |
Classes | |
| class | cache |
| class | file_istream |
| stdio-backed input stream. Accepts std::ios open flags (e.g. std::ios::binary) when opening a More... | |
| class | file_ostream |
| stdio-backed output stream. Accepts std::ios open flags (e.g. std::ios::binary | std::ios::app) More... | |
| class | pattern_filter |
| A filter that combines include and exclude patterns for file/directory filtering. More... | |
| struct | stream_buffer |
| class | syncer |
| class | watcher |
| class | watcher_fallback |
| class | watcher_wtr |
| 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> |
Enumerations | |
| enum class | file_stream_ownership : std::uint8_t { take_ownership , retain_ownership } |
| Whether a file stream wrapper should fclose its FILE* on destruction. More... | |
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. | |
| void | benchmark_directory_reads (const path &directory) |
| auto | hash_file_fingerprint (const path &file_path, bool normalize_text_line_endings) -> std::string |
| Hash a file's contents. Text assets normalize CRLF to LF before hashing. | |
| auto | combine_file_fingerprints (const std::string &first_fingerprint, const std::string *additional_fingerprints, size_t additional_count) -> std::string |
| Combine per-file fingerprints (raw 128-bit digests) into one hex fingerprint. | |
| 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. | |
| static auto | extract_entry_extension (const fs::path &path) -> std::string |
| static void | ensure_directory_exists (const fs::path &path) |
| static auto | entry_serialization_key (const fs::path &watch_root, const fs::watcher::entry &entry) -> std::string |
| Paths that share a key are processed on one worker in order (create -> rename, etc.). | |
| auto | to_string (const watcher::entry &e) -> std::string |
| auto | filetime_to_system_clock (fs::file_time_type ft) -> std::chrono::system_clock::time_point |
Variables | |
| constexpr uint64_t | current_source_fingerprint_version = 1 |
| xxHash3 128-bit fingerprints (hex). Bump when the hashing or dependency-ordering scheme changes. | |
| constexpr std::ios_base::openmode | default_file_read_mode |
| constexpr std::ios_base::openmode | default_file_write_mode |
| 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> |
|
strong |
Whether a file stream wrapper should fclose its FILE* on destruction.
| Enumerator | |
|---|---|
| take_ownership | |
| retain_ownership | |
Definition at line 12 of file file_stream_common.h.
| 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 182 of file filesystem.cpp.
| void fs::benchmark_directory_reads | ( | const path & | directory | ) |
Recursively collects regular files under directory and benchmarks three read backends (FILE*, file_istream, std::ifstream, mapped_file_reader) in two modes:
Definition at line 418 of file file_benchmarks.cpp.
| auto fs::combine_file_fingerprints | ( | const std::string & | first_fingerprint, |
| const std::string * | additional_fingerprints, | ||
| size_t | additional_count ) -> std::string |
Combine per-file fingerprints (raw 128-bit digests) into one hex fingerprint.
Definition at line 211 of file file_fingerprint.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 266 of file filesystem.cpp.
|
static |
Definition at line 29 of file syncer.cpp.
|
static |
Paths that share a key are processed on one worker in order (create -> rename, etc.).
Definition at line 43 of file syncer.cpp.
|
static |
Definition at line 17 of file syncer.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 201 of file filesystem.cpp.
|
inline |
| auto fs::get_path_protocols | ( | ) |
Returns the registered path protocols.
Definition at line 195 of file filesystem.cpp.
| auto fs::has_known_protocol | ( | const path & | _path | ) |
Checks whether the path has a known protocol.
Definition at line 247 of file filesystem.cpp.
| auto fs::hash_file_fingerprint | ( | const path & | file_path, |
| bool | normalize_text_line_endings ) -> std::string |
Hash a file's contents. Text assets normalize CRLF to LF before hashing.
Definition at line 201 of file file_fingerprint.cpp.
| auto fs::is_any_parent_path | ( | const path & | parent, |
| const path & | child ) |
Definition at line 345 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 154 of file filesystem.cpp.
| auto fs::read_stream_buffer | ( | std::istream & | stream | ) |
Definition at line 168 of file filesystem.cpp.
| auto fs::read_stream_buffer_str | ( | std::istream & | stream | ) |
Definition at line 175 of file filesystem.cpp.
| auto fs::read_stream_str | ( | std::istream & | stream | ) |
Definition at line 161 of file filesystem.cpp.
| auto fs::reduce_trailing_extensions | ( | const path & | _path | ) |
another.
Definition at line 331 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 308 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 216 of file filesystem.cpp.
| auto fs::split_until | ( | const path & | _path, |
| const path & | _predicate ) |
another.
Definition at line 313 of file filesystem.cpp.
| auto fs::to_string | ( | const watcher::entry & | e | ) | -> std::string |
Definition at line 99 of file watcher.cpp.
|
inlineconstexpr |
xxHash3 128-bit fingerprints (hex). Bump when the hashing or dependency-ordering scheme changes.
Definition at line 11 of file file_fingerprint.h.
|
inlineconstexpr |
Definition at line 18 of file file_stream_common.h.
|
inlineconstexpr |
Definition at line 21 of file file_stream_common.h.