array.hxx
#ifndef PQXX_H_ARRAY
#define PQXX_H_ARRAY
#include "pqxx/compiler-public.hxx"
#include "pqxx/compiler-internal-pre.hxx"
#include "pqxx/internal/encoding_group.hxx"
#include "pqxx/internal/encodings.hxx"
#include <stdexcept>
#include <string>
#include <utility>
namespace pqxx
{
class PQXX_LIBEXPORT array_parser
{
public:
enum juncture
{
row_start,
row_end,
null_value,
string_value,
done,
};
// XXX: Actually _pass_ encoding group!
explicit array_parser(
const char input[],
internal::encoding_group=internal::encoding_group::MONOBYTE);
std::pair<juncture, std::string> get_next();
private:
const char *const m_input;
const std::string::size_type m_end;
internal::glyph_scanner_func *const m_scan;
std::string::size_type m_pos;
std::string::size_type scan_single_quoted_string() const;
std::string parse_single_quoted_string(std::string::size_type end) const;
std::string::size_type scan_double_quoted_string() const;
std::string parse_double_quoted_string(std::string::size_type end) const;
std::string::size_type scan_unquoted_string() const;
std::string parse_unquoted_string(std::string::size_type end) const;
std::string::size_type scan_glyph(std::string::size_type pos) const;
std::string::size_type scan_glyph(
std::string::size_type pos,
std::string::size_type end) const;
};
} // namespace pqxx
#include "pqxx/compiler-internal-post.hxx"
#endif
pqxx::array_parser::string_value
@ string_value
Found a string value.
Definition: array.hxx:59
pqxx::array_parser
Low-level array parser.
Definition: array.hxx:46
pqxx::array_parser::null_value
@ null_value
Found a NULL value.
Definition: array.hxx:57
pqxx::array_parser::row_end
@ row_end
Ending the current row.
Definition: array.hxx:55
pqxx::array_parser::array_parser
array_parser(const char input[], internal::encoding_group=internal::encoding_group::MONOBYTE)
Constructor. You don't need this; use field::as_array instead.
Definition: array.cxx:229
pqxx::array_parser::row_start
@ row_start
Starting a new row.
Definition: array.hxx:53
pqxx::array_parser::done
@ done
Parsing has completed.
Definition: array.hxx:61
pqxx::array_parser::juncture
juncture
What's the latest thing found in the array?
Definition: array.hxx:50
pqxx
The home of all libpqxx classes, functions, templates, etc.
Definition: array.hxx:25
pqxx::array_parser::get_next
std::pair< juncture, std::string > get_next()
Parse the next step in the array.
Definition: array.cxx:241