Loading...
Searching...
No Matches
result.hpp
Go to the documentation of this file.
/*##############################################################################
VSQLite++ - virtuosic bytes SQLite3 C++ wrapper
Copyright (c) 2006-2014 Vinzenz Feenstra vinzenz.feenstra@gmail.com
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of virtuosic bytes nor the names of its contributors may
be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
##############################################################################*/
#ifndef GUARD_SQLITE_RESULT_HPP_INCLUDED
#define GUARD_SQLITE_RESULT_HPP_INCLUDED
#include <boost/noncopyable.hpp>
#include <sqlite/ext/variant.hpp>
namespace sqlite{
struct query;
struct result_construct_params_private;
struct result : boost::noncopyable{
private:
typedef boost::shared_ptr<result_construct_params_private> construct_params;
friend struct query;
result(construct_params);
public:
~result();
bool next_row();
int get_row_count();
int get_column_count();
type get_column_type(int idx);
std::string get_column_decltype(int idx);
variant_t get_variant(int index);
int get_int(int idx);
boost::int64_t get_int64(int idx);
std::string get_string(int idx);
double get_double(int idx);
size_t get_binary_size(int idx);
void get_binary(int idx, void * buf, size_t buf_size);
void get_binary(int idx, std::vector<unsigned char> & vec);
std::string get_column_name(int idx);
private:
void access_check(int);
private:
construct_params m_params;
int m_columns;
int m_row_count;
};
typedef boost::shared_ptr<result> result_type;
}
#endif //GUARD_SQLITE_RESULT_HPP_INCLUDED
sqlite
Definition command.hpp:42
sqlite::result_type
boost::shared_ptr< result > result_type
Definition result.hpp:148
sqlite::type
type
Definition variant.hpp:43
sqlite::variant_t
boost::variant< unknown_t, int, boost::int64_t, long double, std::string, null_t, blob_ref_t > variant_t
Definition variant.hpp:64
sqlite::query
query should be used to execute SQL queries An object of this class is not copyable
Definition query.hpp:44
sqlite::result_construct_params_private
Definition result_construct_params_private.hpp:42
sqlite::result::get_int64
boost::int64_t get_int64(int idx)
Returns the data at the given index as 64-Bit Integer.
sqlite::result::get_column_name
std::string get_column_name(int idx)
Returns the column name at the given index.
sqlite::result::next_row
bool next_row()
Increases the row index.
sqlite::result::get_int
int get_int(int idx)
Returns the data at the given index as 32-Bit Integer.
sqlite::result::get_column_decltype
std::string get_column_decltype(int idx)
Returns the type of the column.
sqlite::result::get_double
double get_double(int idx)
Returns the data at the given index as double.
sqlite::result::get_binary
void get_binary(int idx, std::vector< unsigned char > &vec)
Used to retrieve a binary value.
sqlite::result::get_column_type
type get_column_type(int idx)
Returns the type of the column.
sqlite::result::result
result(construct_params)
sqlite::result::m_row_count
int m_row_count
Definition result.hpp:145
sqlite::result::query
friend struct query
Definition result.hpp:49
sqlite::result::get_column_count
int get_column_count()
Returns the number of columns.
sqlite::result::~result
~result()
destructor
sqlite::result::construct_params
boost::shared_ptr< result_construct_params_private > construct_params
Definition result.hpp:48
sqlite::result::get_variant
variant_t get_variant(int index)
Retrieves a the current typ into variant_t.
sqlite::result::get_binary
void get_binary(int idx, void *buf, size_t buf_size)
Used to retrieve a binary value.
sqlite::result::get_binary_size
size_t get_binary_size(int idx)
Returns the size of the data at the given index in bytes.
sqlite::result::get_string
std::string get_string(int idx)
Returns the data at the given index as String.
sqlite::result::access_check
void access_check(int)
sqlite::result::m_columns
int m_columns
Definition result.hpp:144
sqlite::result::m_params
construct_params m_params
Definition result.hpp:143
sqlite::result::get_row_count
int get_row_count()
Returns the number of rows in the result.
variant.hpp