Virtual File System

namespace tnt
class vfs_handle

Private Functions

void mount(char const *path, char const *alias) noexcept

Make alias evaluate to path when used with tnt::vfs::absolute.

Note

If alias has already been assigned to a different path, a debug log will be emmited and the old path will be replaced by the new one.

See

tnt::vfs::absolute.

Parameters
  • path: The path to be aliased.

  • alias: The alias of path.

void unmount(char const *path) noexcept

Remove path from the defined aliases.

Note

If path was never assigned, a debug log will be emmited and nothing will happen.

Parameters
  • path: The alias path to be removed.

std::string absolute(std::string_view path) const noexcept

Get the absolute path from a(n) absolute/relative/aliased path.

Return

std::string

Parameters
  • path: The path to be turned to an absolute path.

Private Members

std::mutex mtx
std::map<const char*, char const*, std::less<>> entries
namespace vfs

Functions

constexpr const char *path_sep() noexcept

Return the path separator used by the OS. “\” on Windows, “/” otherwise.

Todo:

(maybe) Use consteval ??

Return

constexpr const char*

TNT_API void mount (char const *path, char const *alias) noexcept

Make alias evaluate to path when used with tnt::vfs::absolute.

Note

If alias has already been assigned to a different path, a debug log will be emmited and the old path will be replaced by the new one.

See

tnt::vfs::absolute.

Parameters
  • path: The path to be aliased.

  • alias: The alias of path.

TNT_API void unmount (char const *path) noexcept

Remove path from the defined aliases.

Note

If path was never assigned, a debug log will be emmited and nothing will happen.

Parameters
  • path: The alias path to be removed.

TNT_API std::string absolute (std::string_view path) noexcept

Get the absolute path from a(n) absolute/relative/aliased path.

Return

std::string

Parameters
  • path: The path to be turned to an absolute path.