Rebel Fork Framework
Urho3D::FileIdentifier Struct Reference

#include <Urho3D/IO/FileIdentifier.h>

Public Member Functions

 FileIdentifier ()=default
 Construct default.
 FileIdentifier (ea::string_view scheme, ea::string_view fileName)
 Construct from scheme and path (as is).
 FileIdentifier (const ea::string &uri)
 Deprecated. Use FromUri() instead.
ea::string ToUri () const
 Return URI-like path. Does not always return original path.
void AppendPath (ea::string_view path)
bool IsEmpty () const
 Return whether the identifier is empty.
 operator bool () const
bool operator! () const
bool operator< (const FileIdentifier &rhs) const noexcept
bool operator== (const FileIdentifier &rhs) const noexcept
bool operator!= (const FileIdentifier &rhs) const noexcept
FileIdentifieroperator+= (ea::string_view rhs)
FileIdentifier operator+ (ea::string_view rhs) const

Static Public Member Functions

static FileIdentifier FromUri (ea::string_view uri)
 Construct from uri-like path.
static ea::string SanitizeFileName (ea::string_view fileName)

Public Attributes

ea::string scheme_
 URI-like scheme. May be empty if not specified.
ea::string fileName_
 URI-like path to the file.

Static Public Attributes

static const FileIdentifier Empty {}
 File identifier that references nothing.

Detailed Description

File identifier, similar to Uniform Resource Identifier (URI). Known differences:

  • If URI starts with / or x:/ it is treated as file scheme automatically.
  • Host names are not supported for file: scheme. All of file:/path/to/file, file://path/to/file, and file:///path/to/file are supported and denote absolute file path.
  • If URI does not contain :, it is treated as special "empty" scheme, and the entire URI is treated as relative path.
  • Conversion to URI string uses scheme:// format.

Member Function Documentation

◆ AppendPath()

void Urho3D::FileIdentifier::AppendPath ( ea::string_view  path)

Append path to the current path, adding slash in between if it's missing. Ignores current scheme restrictions.

◆ operator bool()

Urho3D::FileIdentifier::operator bool ( ) const


The documentation for this struct was generated from the following files: