29 void*
operator new(
size_t s);
31 void operator delete(
void*
ptr);
36 Blob(std::nullptr_t t);
79 void SetChunk(
const void* from,
size_t size,
size_t internalOffset);
112Blob::operator
new(
size_t size)
124Blob::operator
delete(
void* ptr)
183 this->
Copy(fromPtr, fromSize);
197 this->Copy(rhs.ptr, rhs.size);
213 this->size = rhs.size;
214 this->allocSize = rhs.allocSize;
239 return (0 != this->
ptr);
286 n_assert((0 != fromPtr) && (fromSize > 0));
294 this->
size = fromSize;
340 this->size = rhs.size;
341 this->allocSize = rhs.allocSize;
430 this->size = trimSize;
439 this->
Copy(fromPtr, fromSize);
451 size_t newSize = (internalOffset +
size);
487 const char* charPtr = (
const char*) this->
ptr;
488 for (
size_t i = 0; i < this->
size; i++)
An URI object can split a Uniform Resource Identifier string into its components or build a string fr...
Definition uri.h:67
Implements a private heap.
The Util::Blob class encapsulates a chunk of raw memory into a C++ object which can be copied,...
Definition blob.h:22
Util::Blob GetBase64() const
get as base64 encoded
Definition blob.cc:61
void Copy(const void *ptr, size_t size)
copy content
Definition blob.h:284
void * GetPtr() const
get blob ptr
Definition blob.h:464
bool operator>=(const Blob &rhs) const
greater-equal operator
Definition blob.h:388
void Set(const void *ptr, size_t size)
set blob contents
Definition blob.h:437
void * ptr
Definition blob.h:103
void Delete()
delete content
Definition blob.h:246
void Trim(size_t size)
trim the size member (without re-allocating!)
Definition blob.h:427
bool operator<(const Blob &rhs) const
less operator
Definition blob.h:379
bool IsValid() const
return true if the blob contains data
Definition blob.h:237
bool operator!=(const Blob &rhs) const
inequality operator
Definition blob.h:361
size_t allocSize
Definition blob.h:105
bool operator==(const Blob &rhs) const
equality operator
Definition blob.h:352
uint32_t HashCode() const
get a hash code (compatible with Util::HashTable)
Definition blob.h:484
~Blob()
destructor
Definition blob.h:262
void SetFromFile(const IO::URI &uri)
set from file
Definition blob.cc:77
void Allocate(size_t size)
allocate internal buffer
Definition blob.h:271
static void Setup()
static Setup method, called by SysFunc::Setup()
Definition blob.h:133
Blob()
default constructor
Definition blob.h:154
bool operator>(const Blob &rhs) const
greater operator
Definition blob.h:370
size_t Size() const
get blob size
Definition blob.h:474
void GrowTo(size_t size)
Increases allocated size without deleting existing data (reallocate and memcopy).
Definition blob.h:302
static void Shutdown()
static Shutdown method called by SysFunc::Exit
Definition blob.h:143
int BinaryCompare(const Blob &rhs) const
do a binary comparison between this and other blob
Definition blob.cc:23
void SetChunk(const void *from, size_t size, size_t internalOffset)
set chunk contents. Will allocate more memory if necessary.
Definition blob.h:446
void operator=(const Blob &rhs)
assignment operator
Definition blob.h:319
void SetFromBase64(const void *ptr, size_t size)
set from base64 enconded
Definition blob.cc:46
void Reserve(size_t size)
reserve N bytes
Definition blob.h:406
static Memory::Heap * DataHeap
Definition blob.h:101
bool operator<=(const Blob &rhs) const
less-eqial operator
Definition blob.h:397
size_t size
Definition blob.h:104
#define n_assert(exp)
Definition debug.h:50
void Copy(const void *from, void *to, size_t numBytes)
Copy a chunk of memory (note the argument order is different from memcpy()!!!)
Definition osxmemory.cc:213
void * Alloc(HeapType heapType, size_t size, size_t alignment)
Allocate a block of memory from one of the global heaps.
Definition osxmemory.cc:56
void Free(HeapType heapType, void *ptr)
Free a block of memory.
Definition osxmemory.cc:136
@ ObjectHeap
Definition osxmemoryconfig.h:27
A pinned array is an array which manages its own virtual memory.
Definition String.cs:6
int IndexT
Definition types.h:48