Anklang 0.3.0-460-gc4ef46ba
ASE — Anklang Sound Engine (C++)

« « « Anklang Documentation
Loading...
Searching...
No Matches
blob.hh
Go to the documentation of this file.
1 // This Source Code Form is licensed MPL-2.0: http://mozilla.org/MPL/2.0
2#ifndef __ASE_BLOB_HH__
3#define __ASE_BLOB_HH__
4
5#include <ase/cxxaux.hh>
6
7namespace Ase {
8
9class BlobImpl;
10
12class Blob {
14 static Blob from_res (const char *resource);
15 static Blob from_string (const String &name, const String &data);
16 explicit Blob (std::shared_ptr<BlobImpl> blobimpl);
17public:
18 String name ();
19 const char* data ();
20 const uint8* bytes ();
21 size_t size ();
22 String string ();
23 explicit Blob ();
24 explicit Blob (const String &auto_url);
25 static Blob from_file (const String &filename);
26 static Blob from_url (const String &url);
27 explicit operator bool () const;
28};
29
30// == Helpers ==
31uint8* zintern_decompress (unsigned int decompressed_size, const unsigned char *cdata, unsigned int cdata_size);
32void zintern_free (uint8 *dc_data);
33
34} // Ase
35
36#endif // __ASE_BLOB_HH__
Binary large object storage container.
Definition blob.hh:12
static Blob from_file(const String &filename)
Create Blob by loading from filename.
Definition blob.cc:196
const uint8 * bytes()
Retrieve the Blob's data as uint8 buffer.
Definition blob.cc:105
static Blob from_url(const String &url)
Create Blob by opening a url.
Definition blob.cc:152
String name()
Retrieve the Blob's filename or url.
Definition blob.cc:88
const char * data()
Retrieve the Blob's data.
Definition blob.cc:99
size_t size()
Retrieve the Blob's data size in bytes.
Definition blob.cc:111
String string()
Copy Blob data into a zero terminated string.
Definition blob.cc:117
Blob()
Construct an empty Blob.
Definition blob.cc:122
The Anklang C++ API namespace.
Definition api.hh:9
uint8_t uint8
An 8-bit unsigned integer.
Definition cxxaux.hh:22
uint8 * zintern_decompress(unsigned int decompressed_size, const unsigned char *cdata, unsigned int cdata_size)
Definition blob.cc:257
void zintern_free(uint8 *dc_data)
Free data returned from zintern_decompress().
Definition blob.cc:235