Magick++ 7.1.1
Loading...
Searching...
No Matches
myBlob Class Reference
Inheritance diagram for myBlob:
Collaboration diagram for myBlob:

Public Member Functions

 myBlob (ifstream &stream_)
 
- Public Member Functions inherited from Magick::Blob
 Blob (const void *data_, const size_t length_)
 
 Blob (const Blob &blob_)
 
Bloboperator= (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)
 

Additional Inherited Members

- Public Types inherited from Magick::Blob
enum  Allocator { MallocAllocator , NewAllocator }
 

Detailed Description

Definition at line 24 of file readWriteBlob.cpp.

Constructor & Destructor Documentation

◆ myBlob()

myBlob::myBlob ( ifstream &  stream_)
inline

Definition at line 28 of file readWriteBlob.cpp.

29 : Blob()
30 {
31 unsigned char* blobData = new unsigned char[100000];
32 char* c= reinterpret_cast<char *>(blobData);
33 size_t blobLen=0;
34 while( (blobLen< 100000) && stream_.get(*c) )
35 {
36 c++;
37 blobLen++;
38 }
39 if ((!stream_.eof()) || (blobLen == 0))
40 {
41 cout << "Failed to stream into blob!" << endl;
42 exit(1);
43 }
44
45 // Insert data into blob
46 updateNoCopy( reinterpret_cast<unsigned char*>(blobData), blobLen,
47 Blob::NewAllocator );
48 }

The documentation for this class was generated from the following file: