aboutsummaryrefslogtreecommitdiff
path: root/libxsde/xsde/cxx/parser/non-validating/number.hxx
blob: b2b5c2028a101d87e012e494e3fb35b97b694aa6 (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/non-validating/number.hxx
// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
// license   : GNU GPL v2 + exceptions; see accompanying LICENSE file

#ifndef XSDE_CXX_PARSER_NON_VALIDATING_NUMBER_HXX
#define XSDE_CXX_PARSER_NON_VALIDATING_NUMBER_HXX

#include <stddef.h> // size_t

#include <xsde/cxx/ro-string.hxx>

namespace xsde
{
  namespace cxx
  {
    namespace parser
    {
      namespace non_validating
      {
        class number
        {
        protected:
          void
          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_NON_VALIDATING_NUMBER_HXX