1
// This may look like C code, but it is really -*- C++ -*-
3
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002
5
// Reference counted container class for Binary Large Objects (BLOBs)
8
#if !defined(Magick_BlobRef_header)
9
#define Magick_BlobRef_header
11
#include "Magick++/Include.h"
19
class MagickDLLDecl Blob
30
// Default constructor
33
// Construct object with data, making a copy of the supplied data.
34
Blob ( const void* data_, size_t length_ );
36
// Copy constructor (reference counted)
37
Blob ( const Blob& blob_ );
39
// Destructor (reference counted)
42
// Assignment operator (reference counted)
43
Blob& operator= ( const Blob& blob_ );
45
// Update object contents from Base64-encoded string representation.
46
void base64 ( const std::string base64_ );
47
// Return Base64-encoded string representation.
48
std::string base64 ( void );
50
// Update object contents, making a copy of the supplied data.
51
// Any existing data in the object is deallocated.
52
void update ( const void* data_, size_t length_ );
54
// Update object contents, using supplied pointer directly (no
55
// copy). Any existing data in the object is deallocated. The user
56
// must ensure that the pointer supplied is not deleted or
57
// otherwise modified after it has been supplied to this method.
58
// Specify allocator_ as "MallocAllocator" if memory is allocated
59
// via the C language malloc() function, or "NewAllocator" if
60
// memory is allocated via C++ 'new'.
61
void updateNoCopy ( void* data_, size_t length_,
62
Allocator allocator_ = NewAllocator );
64
// Obtain pointer to data. The user should never try to modify or
65
// free this data since the Blob class manages its own data. The
66
// user must be finished with the data before allowing the Blob to
67
// be destroyed since the pointer is invalid once the Blob is
69
const void* data ( void ) const;
72
size_t length ( void ) const;
82
#endif // Magick_BlobRef_header