|
enum | Allocator { MallocAllocator
, NewAllocator
} |
|
|
| Blob (const void *data_, const size_t length_) |
|
| Blob (const Blob &blob_) |
|
Blob & | operator= (const Blob &blob_) |
|
void | base64 (const std::string base64_) |
|
std::string | base64 (void) const |
|
const void * | data (void) const |
|
size_t | length (void) const |
|
void | update (const void *data_, const size_t length_) |
|
void | updateNoCopy (void *data_, const size_t length_, const Allocator allocator_=NewAllocator) |
|
Definition at line 22 of file Blob.h.
◆ Allocator
enum Magick::Blob::Allocator |
Definition at line 26 of file Blob.h.
27 {
28 MallocAllocator,
29 NewAllocator
30 };
◆ Blob() [1/3]
Magick::Blob::Blob |
( |
void | | ) |
|
◆ Blob() [2/3]
Magick::Blob::Blob |
( |
const void * | data_, |
|
|
const size_t | length_ ) |
◆ Blob() [3/3]
Magick::Blob::Blob |
( |
const Blob & | blob_ | ) |
|
Definition at line 31 of file Blob.cpp.
32 : _blobRef(blob_._blobRef)
33{
34
35 _blobRef->increase();
36}
◆ ~Blob()
Definition at line 38 of file Blob.cpp.
39{
40 try
41 {
42 if (_blobRef->decrease() == 0)
43 delete _blobRef;
44 }
46 {
47 }
48
50}
◆ base64() [1/2]
void Magick::Blob::base64 |
( |
const std::string | base64_ | ) |
|
Definition at line 65 of file Blob.cpp.
66{
67 size_t
68 length;
69
70 unsigned char
71 *decoded;
72
73 decoded=Base64Decode(base64_.c_str(),&length);
74
75 if(decoded)
76 updateNoCopy(static_cast<void*>(decoded),length,
77 Magick::Blob::MallocAllocator);
78}
◆ base64() [2/2]
std::string Magick::Blob::base64 |
( |
void | | ) |
const |
Definition at line 80 of file Blob.cpp.
81{
82 size_t
83 encoded_length;
84
85 char
86 *encoded;
87
88 std::string
89 result;
90
91 encoded_length=0;
92 encoded=Base64Encode(static_cast<const unsigned char*>(data()),length(),
93 &encoded_length);
94
95 if(encoded)
96 {
97 result=std::string(encoded,encoded_length);
98 encoded=(char *) RelinquishMagickMemory(encoded);
99 return result;
100 }
101
102 return(std::string());
103}
◆ data()
const void * Magick::Blob::data |
( |
void | | ) |
const |
Definition at line 105 of file Blob.cpp.
106{
107 return(_blobRef->data);
108}
◆ length()
size_t Magick::Blob::length |
( |
void | | ) |
const |
Definition at line 110 of file Blob.cpp.
111{
112 return(_blobRef->length);
113}
◆ operator=()
Definition at line 52 of file Blob.cpp.
53{
54 if (this != &blob_)
55 {
56 blob_._blobRef->increase();
57 if (_blobRef->decrease() == 0)
58 delete _blobRef;
59
60 _blobRef=blob_._blobRef;
61 }
62 return(*this);
63}
◆ update()
void Magick::Blob::update |
( |
const void * | data_, |
|
|
const size_t | length_ ) |
Definition at line 115 of file Blob.cpp.
116{
117 if (_blobRef->decrease() == 0)
118 delete _blobRef;
119
121}
◆ updateNoCopy()
void Magick::Blob::updateNoCopy |
( |
void * | data_, |
|
|
const size_t | length_, |
|
|
const Allocator | allocator_ = NewAllocator ) |
Definition at line 123 of file Blob.cpp.
125{
126 if (_blobRef->decrease() == 0)
127 delete _blobRef;
128
130 _blobRef->data=data_;
131 _blobRef->length=length_;
132 _blobRef->allocator=allocator_;
133}
◆ _blobRef
The documentation for this class was generated from the following files:
- ImageMagick-7/Magick++/lib/Magick++/Blob.h
- ImageMagick-7/Magick++/lib/Blob.cpp