WebFramework v3.0.12
Web framework for C++.
Loading...
Searching...
No Matches
framework::sqlite::utility::SQLiteResult Class Reference

Contains result of SQL request. More...

#include <SQLiteResult.h>

Public Types

using const_iterator = std::vector<std::unordered_map<std::string, std::string>>::const_iterator
 

Public Member Functions

 SQLiteResult (std::vector< std::unordered_map< std::string, std::string > > &&rows) noexcept
 
 SQLiteResult (const SQLiteResult &other)=default
 
 SQLiteResult (SQLiteResult &&other) noexcept=default
 
SQLiteResultoperator= (const SQLiteResult &other)=default
 
SQLiteResultoperator= (SQLiteResult &&other) noexcept=default
 
size_t size () const
 Number of rows.
 
bool isEmpty () const
 Is SQLiteResult has no rows.
 
std::unordered_map< std::string, std::string > & operator[] (size_t index)
 Access operator.
 
const std::unordered_map< std::string, std::string > & operator[] (size_t index) const
 Const access operator.
 
std::unordered_map< std::string, std::string > & front ()
 Access to first row.
 
const std::unordered_map< std::string, std::string > & front () const
 Const access to first row.
 
std::unordered_map< std::string, std::string > & back ()
 Access to last row.
 
const std::unordered_map< std::string, std::string > & back () const
 Const access to last row.
 
std::unordered_map< std::string, std::string > & at (size_t index)
 Access to row.
 
const std::unordered_map< std::string, std::string > & at (size_t index) const
 Const access to row.
 
std::string & at (size_t index, const std::string &columnName)
 Access to column in row.
 
const std::string & at (size_t index, const std::string &columnName) const
 Const access to column in row.
 
const_iterator begin () const noexcept
 Begin iterator.
 
const_iterator end () const noexcept
 End iterator.
 

Detailed Description

Contains result of SQL request.

Contains all rows after SQL request

Definition at line 15 of file SQLiteResult.h.

Member Typedef Documentation

◆ const_iterator

using framework::sqlite::utility::SQLiteResult::const_iterator = std::vector<std::unordered_map<std::string, std::string>>::const_iterator

Definition at line 18 of file SQLiteResult.h.

Member Function Documentation

◆ at() [1/4]

unordered_map< string, string > & framework::sqlite::utility::SQLiteResult::at ( size_t index)

Access to row.

Parameters
indexRow index
Returns
Row
Exceptions
std::out_of_rangeWrong index

Definition at line 57 of file SQLiteResult.cpp.

◆ at() [2/4]

const unordered_map< string, string > & framework::sqlite::utility::SQLiteResult::at ( size_t index) const

Const access to row.

Parameters
indexRow index
Returns
Row
Exceptions
std::out_of_rangeWrong index

Definition at line 62 of file SQLiteResult.cpp.

◆ at() [3/4]

std::string & framework::sqlite::utility::SQLiteResult::at ( size_t index,
const std::string & columnName )

Access to column in row.

Parameters
indexRow index
columnNameColumn name
Returns
Value in column
Exceptions
std::out_of_rangeWrong index

◆ at() [4/4]

const std::string & framework::sqlite::utility::SQLiteResult::at ( size_t index,
const std::string & columnName ) const

Const access to column in row.

Parameters
indexRow index
columnNameColumn name
Returns
Value in column
Exceptions
std::out_of_rangeWrong index

◆ back() [1/2]

unordered_map< string, string > & framework::sqlite::utility::SQLiteResult::back ( )

Access to last row.

Returns
Last row
Exceptions
std::out_of_rangeEmpty SQLiteResult

Definition at line 47 of file SQLiteResult.cpp.

◆ back() [2/2]

const unordered_map< string, string > & framework::sqlite::utility::SQLiteResult::back ( ) const

Const access to last row.

Returns
Last row
Exceptions
std::out_of_rangeEmpty SQLiteResult

Definition at line 52 of file SQLiteResult.cpp.

◆ begin()

SQLiteResult::const_iterator framework::sqlite::utility::SQLiteResult::begin ( ) const
noexcept

Begin iterator.

Returns
Iterator to first row

Definition at line 77 of file SQLiteResult.cpp.

◆ end()

SQLiteResult::const_iterator framework::sqlite::utility::SQLiteResult::end ( ) const
noexcept

End iterator.

Returns
Iterator to row after last

Definition at line 82 of file SQLiteResult.cpp.

◆ front() [1/2]

unordered_map< string, string > & framework::sqlite::utility::SQLiteResult::front ( )

Access to first row.

Returns
First row
Exceptions
std::out_of_rangeEmpty SQLiteResult

Definition at line 37 of file SQLiteResult.cpp.

◆ front() [2/2]

const unordered_map< string, string > & framework::sqlite::utility::SQLiteResult::front ( ) const

Const access to first row.

Returns
First row
Exceptions
std::out_of_rangeEmpty SQLiteResult

Definition at line 42 of file SQLiteResult.cpp.

◆ isEmpty()

bool framework::sqlite::utility::SQLiteResult::isEmpty ( ) const

Is SQLiteResult has no rows.

Returns
rows.empty()

Definition at line 22 of file SQLiteResult.cpp.

◆ operator[]() [1/2]

unordered_map< string, string > & framework::sqlite::utility::SQLiteResult::operator[] ( size_t index)

Access operator.

Parameters
indexColumn name
Returns
Column value
Exceptions
std::out_of_rangeWrong index

Definition at line 27 of file SQLiteResult.cpp.

◆ operator[]() [2/2]

const unordered_map< string, string > & framework::sqlite::utility::SQLiteResult::operator[] ( size_t index) const

Const access operator.

Parameters
indexColumn name
Returns
Column value
Exceptions
std::out_of_rangeWrong index

Definition at line 32 of file SQLiteResult.cpp.

◆ size()

size_t framework::sqlite::utility::SQLiteResult::size ( ) const

Number of rows.

Returns
Number of rows

Definition at line 17 of file SQLiteResult.cpp.


The documentation for this class was generated from the following files: