表示C ++中的BLOB [英] representing BLOBs in C++
本文介绍了表示C ++中的BLOB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有任何STL容器似乎非常适合用作数据库软件的BLOB?我会认为一个向量< char>
,但有什么更好吗?也许 std :: string
?或一些非STL容器?
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?
推荐答案
BLOB
允许存储二进制数据,因此您需要一个有序的字节集合。最简单的选择是向量<>
,您可以选择 unsigned char
表示大多数平台上的字节
The BLOB
type of databases allows storage of binary data, so you need an ordered collection of bytes. The easiest choice would be a vector<>
and you could chose unsigned char
to represent a byte on most platforms
这篇关于表示C ++中的BLOB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文