| 273 | |
| 274 | template <typename T> |
| 275 | void get_column_as_object ( |
| 276 | unsigned long idx, |
| 277 | T& item |
| 278 | ) const |
| 279 | { |
| 280 | // make sure requires clause is not broken |
| 281 | DLIB_ASSERT(idx < get_num_columns(), |
| 282 | "\t void statement::get_column_as_object()" |
| 283 | << "\n\t Invalid column index." |
| 284 | << "\n\t idx: " << idx |
| 285 | << "\n\t this: " << this |
| 286 | ); |
| 287 | |
| 288 | const char* data = static_cast<const char*>(sqlite3_column_blob(stmt, idx)); |
| 289 | const int size = sqlite3_column_bytes(stmt, idx); |
| 290 | std::istringstream sin(std::string(data,size)); |
| 291 | deserialize(item, sin); |
| 292 | } |
| 293 | |
| 294 | const std::string get_column_as_text ( |
| 295 | unsigned long idx |
no test coverage detected