Anklang 0.3.0-460-gc4ef46ba
ASE — Anklang Sound Engine (C++)
« « « Anklang Documentation |
Binary large object storage container. More...
#include "blob.hh"
Public Member Functions | |
String | name () |
Retrieve the Blob's filename or url. | |
const char * | data () |
Retrieve the Blob's data. | |
const uint8 * | bytes () |
Retrieve the Blob's data as uint8 buffer. | |
size_t | size () |
Retrieve the Blob's data size in bytes. | |
String | string () |
Copy Blob data into a zero terminated string. | |
Blob () | |
Construct an empty Blob. | |
Blob (const String &auto_url) | |
Construct Blob from url or filename (auto detected). | |
operator bool () const | |
Checks if the Blob contains accessible data. | |
Static Public Member Functions | |
static Blob | from_file (const String &filename) |
Create Blob by loading from filename. | |
static Blob | from_url (const String &url) |
Create Blob by opening a url. | |
|
explicit |
Construct an empty Blob.
Definition at line 122 of file blob.cc.
Referenced by from_file(), and from_url().
|
explicit |
Construct Blob from url or filename (auto detected).
Definition at line 129 of file blob.cc.
References from_file(), and from_url().
const uint8 * Ase::Blob::bytes | ( | ) |
const char * Ase::Blob::data | ( | ) |
Create Blob by loading from filename.
Definition at line 196 of file blob.cc.
References Blob(), std::string::c_str(), close(), ENOENT, errno(), fstat(), std::make_shared(), mmap(), munmap(), open(), and stat().
Referenced by Blob(), from_url(), and Ase::WebSocketConnection::http_request().
Create Blob by opening a url.
Definition at line 152 of file blob.cc.
References Blob(), std::string::c_str(), std::string::compare(), ENOENT, errno(), from_file(), and Ase::string_tolower().
Referenced by Blob().
String Ase::Blob::name | ( | ) |
Retrieve the Blob's filename or url.
Definition at line 88 of file blob.cc.
Referenced by Ase::IniFile::IniFile().
|
explicit |
size_t Ase::Blob::size | ( | ) |
String Ase::Blob::string | ( | ) |
Copy Blob data into a zero terminated string.
Definition at line 117 of file blob.cc.
Referenced by Ase::WebSocketConnection::http_request(), and Ase::IniFile::IniFile().