blob: 496b5d5088193b1e8ecfb1aa28928dab0f5a2144 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
// file : xsde/cxx/parser/validating/number.hxx
// copyright : Copyright (c) 2005-2014 Code Synthesis Tools CC
// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
#ifndef XSDE_CXX_PARSER_VALIDATING_NUMBER_HXX
#define XSDE_CXX_PARSER_VALIDATING_NUMBER_HXX
#include <stddef.h> // size_t
#include <xsde/cxx/ro-string.hxx>
namespace xsde
{
namespace cxx
{
namespace parser
{
namespace validating
{
class number
{
protected:
bool
parse (const ro_string&, char* str, size_t max);
protected:
size_t size_;
enum {leading_ws, sign, leading_zeros, literal, trailing_ws} state_;
enum {none, plus, minus} sign_;
};
}
}
}
}
#endif // XSDE_CXX_PARSER_VALIDATING_NUMBER_HXX
|