Unravel Engine C++ Reference
Loading...
Searching...
No Matches
filesystem.h File Reference
#include <hpp/filesystem.hpp>
#include <istream>
#include <unordered_map>
#include <vector>
#include <fstream>

Go to the source code of this file.

Classes

struct  fs::stream_buffer< Container, CharT, Traits >
 
class  fs::stream_buffer< Container, CharT, Traits >::membuf
 

Namespaces

namespace  fs
 

Typedefs

using fs::protocols_t = std::unordered_map<std::string, std::string>
 
using fs::byte_array_t = std::vector<std::uint8_t>
 

Functions

bool fs::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_tfs::get_path_protocols () -> protocols_t &
 Returns the registered path protocols.
 
path fs::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 fs::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.
 
path fs::convert_to_protocol (const path &_path) -> path
 Oposite of the resolve_protocol this function tries to convert to protocol path from an absolute one.
 
bool fs::has_known_protocol (const path &_path) -> bool
 Checks whether the path has a known protocol.
 
byte_array_t fs::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 fs::read_stream_str (std::istream &stream)
 
stream_buffer< byte_array_tfs::read_stream_buffer (std::istream &stream)
 
stream_buffer< std::string > fs::read_stream_buffer_str (std::istream &stream)
 
path fs::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 > fs::split_until (const path &_path, const path &_predicate) -> std::vector< path >
 another.
 
path fs::reduce_trailing_extensions (const path &_path) -> path
 another.
 
bool fs::is_any_parent_path (const path &parent, const path &child)