Adding the method getBytes to the Column object, returning the size in bytes of the text value.

This commit is contained in:
Sébastien Rombauts
2013-03-08 21:24:38 +01:00
parent bc5b64d4a3
commit dc4802edd5
4 changed files with 20 additions and 3 deletions

View File

@@ -87,9 +87,10 @@ int main (void)
int id = query.getColumn(0); // = query.getColumn(0).getInt()
//const char* pvalue = query.getColumn(1); // = query.getColumn(1).getText()
std::string value2 = query.getColumn(1); // = query.getColumn(1).getText()
int bytes = query.getColumn(1).getBytes();
int size = query.getColumn(2); // = query.getColumn(2).getInt()
std::cout << "row : (" << id << ", " << value2.c_str() << ", " << size << ")\n";
std::cout << "row : (" << id << ", " << value2.c_str() << ", " << bytes << ", " << size << ")\n";
}
// Reset the query to use it again