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);
124Blob::operator
delete(
void*
ptr)
136 DataHeap =
new Memory::Heap(
"Util.Blob.DataHeap");
183 this->
Copy(fromPtr, fromSize);
197 this->Copy(rhs.ptr, rhs.size);
213 this->
size = rhs.size;
240 return (0 != this->
ptr);
286 n_assert((0 != fromPtr) && (fromSize > 0));
294 this->
size = fromSize;
307 const size_t oldSize = this->size;
309 if (this->
ptr && oldSize > 0)
317 this->size = oldSize;
350 this->
size = rhs.size;
440 this->size = trimSize;
449 this->
Copy(fromPtr, fromSize);
459 size_t newSize = (internalOffset +
size);
472 this->size =
Math::max(this->size, newSize);
500 const char* charPtr = (
const char*) this->
ptr;
501 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
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:71
void Copy(const void *ptr, size_t size)
copy content
Definition blob.h:284
void * GetPtr() const
get blob ptr
Definition blob.h:479
bool operator>=(const Blob &rhs) const
greater-equal operator
Definition blob.h:398
void SetSize(size_t size)
set size in bytes, allocating if needed
Definition blob.h:416
void Set(const void *ptr, size_t size)
set blob contents
Definition blob.h:447
void * ptr
Definition blob.h:103
void Delete()
delete content
Definition blob.h:247
void Trim(size_t size)
trim the size member (without re-allocating!)
Definition blob.h:437
bool operator<(const Blob &rhs) const
less operator
Definition blob.h:389
bool IsValid() const
return true if the blob contains data
Definition blob.h:238
bool operator!=(const Blob &rhs) const
inequality operator
Definition blob.h:371
size_t allocSize
Definition blob.h:105
bool operator==(const Blob &rhs) const
equality operator
Definition blob.h:362
uint32_t HashCode() const
get a hash code (compatible with Util::HashTable)
Definition blob.h:497
~Blob()
destructor
Definition blob.h:263
void SetFromFile(const IO::URI &uri)
set from file
Definition blob.cc:87
void Allocate(size_t size)
allocate internal buffer
Definition blob.h:272
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:380
size_t Size() const
get blob size
Definition blob.h:488
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:456
void operator=(const Blob &rhs)
assignment operator
Definition blob.h:325
void SetFromBase64(const void *ptr, size_t size)
set from base64 enconded
Definition blob.cc:55
static Memory::Heap * DataHeap
Definition blob.h:101
bool operator<=(const Blob &rhs) const
less-eqial operator
Definition blob.h:407
size_t size
Definition blob.h:104
#define n_assert(exp)
Definition debug.h:50
__forceinline TYPE max(TYPE a, TYPE b)
Definition scalar.h:368
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 quad tree designed to return regions of free 2D space.
Definition String.cs:6
int IndexT
Definition types.h:41