Orcus
Toggle main menu visibility
Loading...
Searching...
No Matches
include
orcus
parser_global.hpp
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
* This Source Code Form is subject to the terms of the Mozilla Public
4
* License, v. 2.0. If a copy of the MPL was not distributed with this
5
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
*/
7
8
#ifndef ORCUS_PARSER_GLOBAL_HPP
9
#define ORCUS_PARSER_GLOBAL_HPP
10
11
#include "env.hpp"
12
13
#include <sstream>
14
15
namespace
orcus {
16
17
class
cell_buffer
;
18
22
enum class
string_escape_char_t
23
{
24
invalid,
26
regular_char,
28
control_char,
30
unicode,
31
};
32
39
struct
parse_quoted_string_state
40
{
41
static
constexpr
std::size_t error_no_closing_quote = 1;
42
static
constexpr
std::size_t error_illegal_escape_char = 2;
43
static
constexpr
std::size_t error_invalid_hex_digits = 3;
44
45
const
char
* str;
46
std::size_t length;
47
58
bool
transient
;
59
64
bool
has_control_character
;
65
};
66
67
ORCUS_PSR_DLLPUBLIC
bool
is_blank(
char
c);
68
ORCUS_PSR_DLLPUBLIC
bool
is_alpha(
char
c);
69
ORCUS_PSR_DLLPUBLIC
bool
is_numeric(
char
c);
70
81
ORCUS_PSR_DLLPUBLIC
bool
is_in(
char
c, std::string_view allowed);
82
92
ORCUS_PSR_DLLPUBLIC
const
char
* parse_numeric(
const
char
* p,
const
char
* p_end,
double
& value);
93
106
ORCUS_PSR_DLLPUBLIC
const
char
* parse_integer(
const
char
* p,
const
char
* p_end,
long
& value);
107
111
ORCUS_PSR_DLLPUBLIC
parse_quoted_string_state
parse_single_quoted_string(
112
const
char
*& p, std::size_t max_length,
cell_buffer
& buffer);
113
125
ORCUS_PSR_DLLPUBLIC
const
char
* parse_to_closing_single_quote(
126
const
char
* p, std::size_t max_length);
127
128
ORCUS_PSR_DLLPUBLIC
parse_quoted_string_state
parse_double_quoted_string(
129
const
char
*& p, std::size_t max_length,
cell_buffer
& buffer);
130
142
ORCUS_PSR_DLLPUBLIC
const
char
* parse_to_closing_double_quote(
143
const
char
* p, std::size_t max_length);
144
154
ORCUS_PSR_DLLPUBLIC string_escape_char_t get_string_escape_char_type(
char
c);
155
156
ORCUS_PSR_DLLPUBLIC std::string_view trim(std::string_view str);
157
158
}
159
160
#endif
161
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
orcus::cell_buffer
Definition
cell_buffer.hpp:22
orcus::parse_quoted_string_state
Definition
parser_global.hpp:40
orcus::parse_quoted_string_state::has_control_character
bool has_control_character
Definition
parser_global.hpp:64
orcus::parse_quoted_string_state::transient
bool transient
Definition
parser_global.hpp:58
Generated on
for Orcus by
1.17.0