SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SDL::StorageRef Struct Reference

Semi-safe reference for Storage.

Inheritance diagram for SDL::StorageRef:
Inheritance graph
[legend]
Collaboration diagram for SDL::StorageRef:
Collaboration graph
[legend]

Public Member Functions

 StorageRef (StorageParam resource)
 Constructs from StorageParam. More...
 
 StorageRef (const StorageRef &other)
 Copy constructor.
 
 ~StorageRef ()
 Destructor.
 
- Public Member Functions inherited from SDL::Storage
constexpr Storage ()=default
 Default ctor.
 
constexpr Storage (const StorageRaw resource)
 Constructs from StorageParam. More...
 
constexpr Storage (const Storage &other)=delete
 Copy constructor.
 
constexpr Storage (Storage &&other)
 Move constructor.
 
constexpr Storage (const StorageRef &other)=delete
 
constexpr Storage (StorageRef &&other)=delete
 
 Storage (StringParam override, PropertiesParam props)
 Opens up a read-only container for the application's filesystem. More...
 
 Storage (StringParam org, StringParam app, PropertiesParam props)
 Opens up a container for a user's unique read/write filesystem. More...
 
 Storage (StringParam path)
 Opens up a container for local filesystem storage. More...
 
 Storage (const StorageInterface &iface, void *userdata)
 Opens up a container using a client-provided storage interface. More...
 
 ~Storage ()
 Destructor.
 
Storageoperator= (Storage other)
 Assignment operator.
 
constexpr StorageRaw get () const
 Retrieves underlying StorageRaw.
 
constexpr StorageRaw release ()
 Retrieves underlying StorageRaw and clear this.
 
constexpr auto operator<=> (const Storage &other) const =default
 Comparison.
 
constexpr bool operator== (std::nullptr_t _) const
 Comparison.
 
constexpr operator bool () const
 Converts to bool.
 
constexpr operator StorageParam () const
 Converts to StorageParam.
 
bool Close ()
 Closes and frees a storage container. More...
 
bool Ready ()
 Checks if the storage container is ready to use. More...
 
std::optional< Uint64GetFileSize (StringParam path)
 Query the size of a file within a storage container. More...
 
bool ReadFile (StringParam path, TargetBytes destination)
 Synchronously read a file from a storage container into a client-provided buffer. More...
 
std::string ReadFile (StringParam path)
 Synchronously read a file from a storage container into a client-provided buffer. More...
 
void WriteFile (StringParam path, SourceBytes source)
 Synchronously write a file from client memory into a storage container. More...
 
void CreateDirectory (StringParam path)
 Create a directory in a writable storage container. More...
 
void EnumerateDirectory (StringParam path, EnumerateDirectoryCallback callback, void *userdata)
 Enumerate a directory in a storage container through a callback function. More...
 
std::vector< PathEnumerateDirectory (StringParam path)
 Enumerate a directory in a storage container through a callback function. More...
 
void EnumerateDirectory (StringParam path, EnumerateDirectoryCB callback)
 Enumerate a directory in a storage container through a callback function. More...
 
void RemovePath (StringParam path)
 Remove a file or an empty directory in a writable storage container. More...
 
void RenamePath (StringParam oldpath, StringParam newpath)
 Rename a file or directory in a writable storage container. More...
 
void CopyFile (StringParam oldpath, StringParam newpath)
 Copy a file in a writable storage container. More...
 
PathInfo GetPathInfo (StringParam path)
 Get information about a filesystem path in a storage container. More...
 
Uint64 GetSpaceRemaining ()
 Queries the remaining space in a storage container. More...
 
OwnArray< char * > GlobDirectory (StringParam path, StringParam pattern, GlobFlags flags)
 Enumerate a directory tree, filtered by pattern, and return a list. More...
 
template<class T >
std::vector< T > ReadFileAs (StringParam path)
 Synchronously read a file from a storage container into a client-provided buffer. More...
 

Constructor & Destructor Documentation

◆ StorageRef()

SDL::StorageRef::StorageRef ( StorageParam  resource)
inline
Parameters
resourcea StorageRaw or Storage.

This does not takes ownership!


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