1#ifndef LINTEL_ARGUMENTS_H
2#define LINTEL_ARGUMENTS_H
54 switch (m_connectionType) {
65 throw db::SQLException(
"Unknown connection type " + std::to_string(
static_cast<int>(m_connectionType)));
80 std::vector<Argument> m_arguments;
81 std::map<std::string, Argument> m_argumentsMap;
89 :
public std::iterator<std::random_access_iterator_tag, Argument, std::ptrdiff_t, Argument *, Argument &>
102 : m_arguments(
arguments), m_pos(
end ?
static_cast<std::size_t
>(m_arguments.
size()) : 0)
105 Iterator &operator++()
111 const Iterator operator++(
int)
113 Iterator
tmp = *
this;
118 bool operator==(Iterator
other)
const {
return m_pos ==
other.m_pos; }
120 bool operator!=(Iterator
other)
const {
return !(*
this ==
other); }
122 reference operator*() {
return m_arguments.
of(m_pos); }
130 iterator<std::random_access_iterator_tag, Argument, std::ptrdiff_t, const Argument *, const Argument &>
143 : m_arguments(
arguments), m_pos(
end ?
static_cast<std::size_t
>(m_arguments.
size()) : 0)
146 ConstIterator &operator++()
152 const ConstIterator operator++(
int)
154 ConstIterator
tmp = *
this;
159 bool operator==(ConstIterator
other)
const {
return m_pos ==
other.m_pos; }
161 bool operator!=(ConstIterator
other)
const {
return !(*
this ==
other); }
163 reference operator*()
const {
return m_arguments.
of(m_pos); }
204 Iterator
begin() {
return Iterator(*
this); }
207 Iterator
end() {
return Iterator(*
this,
true); }
213 [[
nodiscard]] ConstIterator
end()
const {
return ConstIterator(*
this,
true); }
static T deserializeFromString(const std::string &string)
Definition StringifyService.h:39
Definition Arguments.h:20
const std::string & getValue() const
const std::string & getName() const
void setConnectionType(ConnectionType connectionType)
TYPE getValue() const
Definition Arguments.h:52
friend std::ostream & operator<<(std::ostream &os, const db::Argument &argument)
Argument(std::string value, std::string name)
Definition Arguments.h:77
Iterator end()
Definition Arguments.h:207
Iterator begin()
Definition Arguments.h:204
ConstIterator begin() const
Definition Arguments.h:210
Argument & of(std::size_t iterator)
const Argument & of(std::size_t iterator) const
const Argument & of(const std::string &name) const
ConstIterator end() const
Definition Arguments.h:213
void add(Argument &argument)
Arguments(ConnectionType connectionType)
Definition ConnectionType.h:15
@ SQLite
Definition ConnectionType.h:18
@ PostgreSQL
Definition ConnectionType.h:18
@ UNDEFINED
Definition ConnectionType.h:18
Definition SQLException.h:11
Definition Serialization.h:34
Definition Serialization.h:38
Definition BaseFeature.h:6
constexpr std::string_view type_name()
Definition TypeName.h:9