class
#include <IO/AndroidAssetStream.h>
AndroidAssetStream Read-only streaming directly from Android asset files.
Base classes
- class Stream
- Provides a generic view of a sequence of bytes.
Public static variables
-
static Containers::
StringView Prefix constexpr
Public static functions
- static void InitializeAssetManager(struct android_app* state)
- Sets the global pointer to the AAssetManager.
-
static auto TryGetAssetPath(const Containers::
StringView path) -> Containers:: StringView - Returns the path of an Android asset without the prefix.
- static auto GetInternalDataPath() -> const char*
- Returns path to the application's internal data directory.
- static auto GetExternalDataPath() -> const char*
- Returns path to the application's external (removable/mountable) data directory.
- static auto GetObbPath() -> const char*
- Returns path to the directory containing the application's OBB files.
-
static auto TryOpen(const Containers::
StringView path) -> bool - Checks if an asset path exists as a file or as a directory and can be opened.
-
static auto TryOpenFile(const Containers::
StringView path) -> bool - Checks if an asset path exists and can be opened as a file.
-
static auto TryOpenDirectory(const Containers::
StringView path) -> bool - Checks if an asset path exists and can be opened as a directory.
-
static auto GetFileSize(const Containers::
StringView path) -> std:: int64_t - Returns the total size of the asset data.
-
static auto OpenDirectory(const Containers::
StringView path) -> AAssetDir* - static void CloseDirectory(AAssetDir* assetDir)
- static void RewindDirectory(AAssetDir* assetDir)
- static auto GetNextFileName(AAssetDir* assetDir) -> const char*
Constructors, destructors, conversion operators
-
AndroidAssetStream(Containers::
StringView path, FileAccess mode) -
AndroidAssetStream(Containers::
String&& path, FileAccess mode) - ~AndroidAssetStream() override
- AndroidAssetStream(const AndroidAssetStream&) deleted
Public functions
- auto operator=(const AndroidAssetStream&) -> AndroidAssetStream& deleted
- void Dispose() override
- Closes the stream and releases all assigned resources.
-
auto Seek(std::
int64_t offset, SeekOrigin origin) -> std:: int64_t override - Seeks in an opened stream.
-
auto GetPosition() const -> std::
int64_t override - Tells the seek position of an opened stream.
-
auto Read(void* destination,
std::
int64_t bytesToRead) -> std:: int64_t override - Reads a certain amount of bytes from the stream to a buffer.
-
auto Write(const void* source,
std::
int64_t bytesToWrite) -> std:: int64_t override - Writes a certain amount of bytes from a buffer to the stream.
- auto Flush() -> bool override
- Clears all buffers for this stream and causes any buffered data to be written to the underlying device.
- auto IsValid() -> bool override
- Returns
true
if the stream has been sucessfully opened. -
auto GetSize() const -> std::
int64_t override - Returns stream size in bytes.
-
auto GetPath() const -> Containers::
StringView - Returns file path.