Are there any STL containers that seem to be well-suited for using as BLOBs for database software? I would think a vector<char>
, but is there something better? Maybe a std::string
? Or some non-STL container?
C++ – representing BLOBs in C++
blobcstl
Related Topic
- C++ – Should we pass a shared_ptr by reference or by value
- C++ – memory fragmentation
- C++ – Thou shalt not inherit from std::vector
- C++ – Why use non-member begin and end functions in C++11
- C++ – Image Processing: Algorithm Improvement for ‘Coca-Cola Can’ Recognition
- C# – System.Windows.Application.GetResourceStream returns null
- R – Drupal: retrieve data from multiple node types in views 2
Best Answer
The
BLOB
type of databases allows storage of binary data, so you need an ordered collection of bytes. The easiest choice would be avector<>
and you could choseunsigned char
to represent a byte on most platforms