|
- #pragma once
-
- #include "result.h"
-
- namespace cppmariadb
- {
-
- /* result ************************************************************************************/
-
- result::result(MYSQL_RES* h)
- : handle (h)
- , _is_initialized (false)
- , _rowindex (static_cast<unsigned long long>(-1))
- { }
-
- unsigned int result::columncount() const
- { return mysql_num_fields(*this); }
-
- const column_vector& result::columns() const
- {
- if (_columns.empty())
- update_columns();
- return _columns;
- }
-
- row* result::current() const
- { return _row.get(); }
-
- unsigned long long result::rowindex() const
- { return _rowindex; }
-
- void result::free()
- {
- auto h = get_handle();
- handle(nullptr);
- mysql_free_result(h);
- }
-
- void result::rowindex(unsigned long long value)
- { _rowindex = value; }
-
- /* result_stored ******************************************************************************/
-
- result_stored::result_stored(MYSQL_RES* h)
- : result(h)
- { }
-
- void result_stored::rowindex(unsigned long long index)
- {
- result::rowindex(index);
- mysql_data_seek(*this, result::rowindex());
- }
-
- unsigned long long result_stored::rowcount() const
- { return mysql_num_rows(*this); }
-
- /* result_used *******************************************************************************/
-
- result_used::result_used(MYSQL_RES* h)
- : result(h)
- { }
-
- }
|