Anklang-0.3.0.dev956+gd75ac925 anklang-0.3.0.dev956+gd75ac925
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#pragma once
3
4#include <ase/cxxaux.hh>
5
6namespace Ase {
7
8class BlobImpl;
9
11class Blob {
13 static Blob from_res (const char *resource);
14 static Blob from_string (const String &name, const String &data);
15 explicit Blob (std::shared_ptr<BlobImpl> blobimpl);
16public:
17 String name ();
18 const char* data ();
19 const uint8* bytes ();
20 size_t size ();
21 String string ();
22 explicit Blob ();
23 explicit Blob (const String &auto_url);
24 static Blob from_file (const String &filename);
25 static Blob from_url (const String &url);
26 explicit operator bool () const;
27};
28
29// == Helpers ==
30uint8* zintern_decompress (unsigned int decompressed_size, const unsigned char *cdata, unsigned int cdata_size);
31void zintern_free (uint8 *dc_data);
32
33} // Ase
34
Binary large object storage container.
Definition blob.hh:11
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:8
uint8_t uint8
An 8-bit unsigned integer.
Definition cxxaux.hh:21
uint8 * zintern_decompress(unsigned int decompressed_size, const unsigned char *cdata, unsigned int cdata_size)
Decompress data via zlib.
Definition blob.cc:257
void zintern_free(uint8 *dc_data)
Free data returned from zintern_decompress().
Definition blob.cc:235