SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
SDL::StorageBase Struct Reference

Base class to Storage. More...

Inheritance diagram for SDL::StorageBase:
[legend]

Public Member Functions

bool Close ()
 Closes and frees a storage container.
bool Ready ()
 Checks if the storage container is ready to use.
std::optional< Uint64GetFileSize (StringParam path)
 Query the size of a file within a storage container.
bool ReadFile (StringParam path, TargetBytes destination)
 Synchronously read a file from a storage container into a client-provided buffer.
std::string ReadFile (StringParam path)
 Synchronously read a file from a storage container into a client-provided buffer.
template<class T>
std::vector< T > ReadFileAs (StringParam path)
 Synchronously read a file from a storage container into a client-provided buffer.
void WriteFile (StringParam path, SourceBytes source)
 Synchronously write a file from client memory into a storage container.
void CreateDirectory (StringParam path)
 Create a directory in a writable storage container.
void EnumerateDirectory (StringParam path, EnumerateDirectoryCallback callback, void *userdata)
 Enumerate a directory in a storage container through a callback function.
std::vector< PathEnumerateDirectory (StringParam path)
 Enumerate a directory in a storage container through a callback function.
void EnumerateDirectory (StringParam path, EnumerateDirectoryCB callback)
 Enumerate a directory in a storage container through a callback function.
void RemovePath (StringParam path)
 Remove a file or an empty directory in a writable storage container.
void RenamePath (StringParam oldpath, StringParam newpath)
 Rename a file or directory in a writable storage container.
void CopyFile (StringParam oldpath, StringParam newpath)
 Copy a file in a writable storage container.
PathInfo GetPathInfo (StringParam path)
 Get information about a filesystem path in a storage container.
Uint64 GetSpaceRemaining ()
 Queries the remaining space in a storage container.
OwnArray< char * > GlobDirectory (StringParam path, StringParam pattern, GlobFlags flags)
 Enumerate a directory tree, filtered by pattern, and return a list.
constexpr ResourceBaseT ()=default
 Default constructor, creates null/invalid resource.
constexpr ResourceBaseT (RawPointer resource)
 Constructs from resource pointer.
constexpr ResourceBaseT (std::nullptr_t)
 Constructs null/invalid.
constexpr ResourceBaseT (const ResourceBaseT &)=default
 Copy constructor.
constexpr ResourceBaseT (ResourceBaseT &&) noexcept=default
 Move constructor.
Public Member Functions inherited from SDL::ResourceBaseT< StorageRaw >
constexpr ResourceBaseT ()=default
 Default constructor, creates null/invalid resource.
constexpr operator bool () const
 Converts to bool.
constexpr auto operator<=> (const ResourceBaseT &other) const=default
 Comparison.
constexpr RawConstPointer operator-> () const noexcept
 member access to underlying resource pointer.
constexpr RawPointer get () const noexcept
 Retrieves underlying resource pointer.
constexpr RawPointer release () noexcept
 Retrieves underlying resource pointer and clear this.

Additional Inherited Members

Public Types inherited from SDL::ResourceBaseT< StorageRaw >
using RawPointer
 The underlying raw pointer type.
using RawConstPointer
 The underlying const raw pointer type.
Protected Member Functions inherited from SDL::ResourceBaseT< StorageRaw >
constexpr ~ResourceBaseT ()=default
 Destructor.
constexpr ResourceBaseToperator= (const ResourceBaseT &)=default
 Assignment operator.

Detailed Description

Base class to Storage.

See also
Storage

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