WebFramework v3.0.12
Web framework for C++.
Loading...
Searching...
No Matches
SQLiteResult.cpp
1#include "SQLiteResult.h"
2
3using namespace std;
4
5namespace framework
6{
7 namespace sqlite
8 {
9 namespace utility
10 {
11 SQLiteResult::SQLiteResult(vector<unordered_map<string, string>>&& rows) noexcept :
12 rows(move(rows))
13 {
14
15 }
16
17 size_t SQLiteResult::size() const
18 {
19 return rows.size();
20 }
21
23 {
24 return rows.empty();
25 }
26
27 unordered_map<string, string>& SQLiteResult::operator [] (size_t index)
28 {
29 return rows[index];
30 }
31
32 const unordered_map<string, string>& SQLiteResult::operator [] (size_t index) const
33 {
34 return rows[index];
35 }
36
37 unordered_map<string, string>& SQLiteResult::front()
38 {
39 return rows.front();
40 }
41
42 const unordered_map<string, string>& SQLiteResult::front() const
43 {
44 return rows.front();
45 }
46
47 unordered_map<string, string>& SQLiteResult::back()
48 {
49 return rows.back();
50 }
51
52 const unordered_map<string, string>& SQLiteResult::back() const
53 {
54 return rows.back();
55 }
56
57 unordered_map<string, string>& SQLiteResult::at(size_t index)
58 {
59 return rows.at(index);
60 }
61
62 const unordered_map<string, string>& SQLiteResult::at(size_t index) const
63 {
64 return rows.at(index);
65 }
66
67 string& SQLiteResult::at(size_t index, const string& columnName)
68 {
69 return rows[index].at(columnName);
70 }
71
72 const string& SQLiteResult::at(size_t index, const string& columnName) const
73 {
74 return rows[index].at(columnName);
75 }
76
77 SQLiteResult::const_iterator SQLiteResult::begin() const noexcept
78 {
79 return rows.begin();
80 }
81
82 SQLiteResult::const_iterator SQLiteResult::end() const noexcept
83 {
84 return rows.end();
85 }
86 }
87 }
88}
std::unordered_map< std::string, std::string > & back()
Access to last row.
std::unordered_map< std::string, std::string > & front()
Access to first row.
std::unordered_map< std::string, std::string > & operator[](size_t index)
Access operator.
const_iterator end() const noexcept
End iterator.
size_t size() const
Number of rows.
bool isEmpty() const
Is SQLiteResult has no rows.
const_iterator begin() const noexcept
Begin iterator.
std::unordered_map< std::string, std::string > & at(size_t index)
Access to row.