| 292 | } |
| 293 | |
| 294 | const std::string get_column_as_text ( |
| 295 | unsigned long idx |
| 296 | ) const |
| 297 | { |
| 298 | // make sure requires clause is not broken |
| 299 | DLIB_ASSERT(idx < get_num_columns(), |
| 300 | "\t std::string statement::get_column_as_text()" |
| 301 | << "\n\t Invalid column index." |
| 302 | << "\n\t idx: " << idx |
| 303 | << "\n\t this: " << this |
| 304 | ); |
| 305 | |
| 306 | const char* data = reinterpret_cast<const char*>(sqlite3_column_text(stmt, idx)); |
| 307 | if (data != 0) |
| 308 | return std::string(data); |
| 309 | else |
| 310 | return std::string(); |
| 311 | } |
| 312 | |
| 313 | double get_column_as_double ( |
| 314 | unsigned long idx |