Skip to content

Commit a02304d

Browse files
committed
Rename files, classes
1 parent 916ad57 commit a02304d

File tree

8 files changed

+88
-88
lines changed

8 files changed

+88
-88
lines changed

include/tao/json/from_string.hh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#include "internal/value_builder.hh"
1010

1111
#include "internal/grammar.hh"
12-
#include "internal/sax_action.hh"
13-
#include "internal/sax_control.hh"
12+
#include "internal/action.hh"
13+
#include "internal/control.hh"
1414

1515
namespace tao
1616
{
@@ -21,7 +21,7 @@ namespace tao
2121
{
2222
internal::value_builder< Traits > handler;
2323
tao_json_pegtl::input input( line, column, data, data + size, source ? source : __PRETTY_FUNCTION__ );
24-
tao_json_pegtl::parse_input< internal::grammar, internal::sax_action, internal::sax_control >( input, handler );
24+
tao_json_pegtl::parse_input< internal::grammar, internal::action, internal::control >( input, handler );
2525
return std::move( handler.value );
2626
}
2727

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
// Copyright (c) 2016 Dr. Colin Hirsch and Daniel Frey
22
// Please see LICENSE for license or visit https://github.com/taocpp/json/
33

4-
#ifndef TAOCPP_JSON_INCLUDE_INTERNAL_SAX_ACTION_HH
5-
#define TAOCPP_JSON_INCLUDE_INTERNAL_SAX_ACTION_HH
4+
#ifndef TAOCPP_JSON_INCLUDE_INTERNAL_ACTION_HH
5+
#define TAOCPP_JSON_INCLUDE_INTERNAL_ACTION_HH
66

77
#include "../external/pegtl/contrib/changes.hh"
88

99
#include "errors.hh"
1010
#include "grammar.hh"
1111

12-
#include "sax_number_state.hh"
12+
#include "number_state.hh"
1313

1414
namespace tao
1515
{
@@ -18,10 +18,10 @@ namespace tao
1818
namespace internal
1919
{
2020
template < typename Rule >
21-
struct sax_action : tao_json_pegtl::nothing< Rule > {};
21+
struct action : tao_json_pegtl::nothing< Rule > {};
2222

2323
template<>
24-
struct sax_action< rules::null >
24+
struct action< rules::null >
2525
{
2626
template< typename State >
2727
static void apply( const tao_json_pegtl::input &, State & handler )
@@ -31,7 +31,7 @@ namespace tao
3131
};
3232

3333
template<>
34-
struct sax_action< rules::true_ >
34+
struct action< rules::true_ >
3535
{
3636
template< typename State >
3737
static void apply( const tao_json_pegtl::input &, State & handler )
@@ -41,7 +41,7 @@ namespace tao
4141
};
4242

4343
template<>
44-
struct sax_action< rules::false_ >
44+
struct action< rules::false_ >
4545
{
4646
template< typename State >
4747
static void apply( const tao_json_pegtl::input &, State & handler )
@@ -51,7 +51,7 @@ namespace tao
5151
};
5252

5353
template<>
54-
struct sax_action< rules::array::begin >
54+
struct action< rules::array::begin >
5555
{
5656
template< typename State >
5757
static void apply( const tao_json_pegtl::input &, State & handler )
@@ -61,7 +61,7 @@ namespace tao
6161
};
6262

6363
template<>
64-
struct sax_action< rules::array::element >
64+
struct action< rules::array::element >
6565
{
6666
template< typename State >
6767
static void apply( const tao_json_pegtl::input &, State & handler )
@@ -71,7 +71,7 @@ namespace tao
7171
};
7272

7373
template<>
74-
struct sax_action< rules::array::end >
74+
struct action< rules::array::end >
7575
{
7676
template< typename State >
7777
static void apply( const tao_json_pegtl::input &, State & handler )
@@ -81,7 +81,7 @@ namespace tao
8181
};
8282

8383
template<>
84-
struct sax_action< rules::object::begin >
84+
struct action< rules::object::begin >
8585
{
8686
template< typename State >
8787
static void apply( const tao_json_pegtl::input &, State & handler )
@@ -91,7 +91,7 @@ namespace tao
9191
};
9292

9393
template<>
94-
struct sax_action< rules::object::element >
94+
struct action< rules::object::element >
9595
{
9696
template< typename State >
9797
static void apply( const tao_json_pegtl::input &, State & handler )
@@ -101,7 +101,7 @@ namespace tao
101101
};
102102

103103
template<>
104-
struct sax_action< rules::object::end >
104+
struct action< rules::object::end >
105105
{
106106
template< typename State >
107107
static void apply( const tao_json_pegtl::input &, State & handler )
@@ -111,27 +111,27 @@ namespace tao
111111
};
112112

113113
template<>
114-
struct sax_action< rules::msign >
114+
struct action< rules::msign >
115115
{
116-
static void apply( const tao_json_pegtl::input &, sax_number_state & result )
116+
static void apply( const tao_json_pegtl::input &, number_state & result )
117117
{
118118
result.mneg = true;
119119
}
120120
};
121121

122122
template<>
123-
struct sax_action< rules::esign >
123+
struct action< rules::esign >
124124
{
125-
static void apply( const tao_json_pegtl::input & in, sax_number_state & result )
125+
static void apply( const tao_json_pegtl::input & in, number_state & result )
126126
{
127127
result.eneg = ( in.peek_char() == '-' );
128128
}
129129
};
130130

131131
template<>
132-
struct sax_action< rules::idigits >
132+
struct action< rules::idigits >
133133
{
134-
static void apply( const tao_json_pegtl::input & in, sax_number_state & result )
134+
static void apply( const tao_json_pegtl::input & in, number_state & result )
135135
{
136136
if ( in.size() > ( 1 << 20 ) ) {
137137
throw tao_json_pegtl::parse_error( "JSON number with 1 megabyte digits", in );
@@ -151,9 +151,9 @@ namespace tao
151151
};
152152

153153
template<>
154-
struct sax_action< rules::fdigits >
154+
struct action< rules::fdigits >
155155
{
156-
static void apply( const tao_json_pegtl::input & in, sax_number_state & result )
156+
static void apply( const tao_json_pegtl::input & in, number_state & result )
157157
{
158158
result.isfp = true;
159159

@@ -184,9 +184,9 @@ namespace tao
184184
};
185185

186186
template<>
187-
struct sax_action< rules::edigits >
187+
struct action< rules::edigits >
188188
{
189-
static void apply( const tao_json_pegtl::input & in, sax_number_state & result )
189+
static void apply( const tao_json_pegtl::input & in, number_state & result )
190190
{
191191
result.isfp = true;
192192

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Copyright (c) 2016 Dr. Colin Hirsch and Daniel Frey
2+
// Please see LICENSE for license or visit https://github.com/taocpp/json/
3+
4+
#ifndef TAOCPP_JSON_INCLUDE_INTERNAL_CONTROL_HH
5+
#define TAOCPP_JSON_INCLUDE_INTERNAL_CONTROL_HH
6+
7+
#include "../external/pegtl/contrib/changes.hh"
8+
9+
#include "errors.hh"
10+
11+
#include "unescape_action.hh"
12+
13+
#include "number_state.hh"
14+
#include "string_state.hh"
15+
#include "key_state.hh"
16+
17+
namespace tao
18+
{
19+
namespace json
20+
{
21+
namespace internal
22+
{
23+
template< typename Rule >
24+
struct control : errors< Rule > {};
25+
26+
template<>
27+
struct control< rules::number > : tao_json_pegtl::change_state< rules::number, number_state, tao_json_pegtl::normal > {};
28+
29+
template<>
30+
struct control< rules::string::content > : tao_json_pegtl::change_state_and_action< rules::string::content, string_state, unescape_action, tao_json_pegtl::normal > {};
31+
32+
template<>
33+
struct control< rules::key::content > : tao_json_pegtl::change_state_and_action< rules::key::content, key_state, unescape_action, tao_json_pegtl::normal > {};
34+
35+
} // internal
36+
37+
} // json
38+
39+
} // tao
40+
41+
#endif

include/tao/json/internal/sax_key_state.hh renamed to include/tao/json/internal/key_state.hh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright (c) 2016 Dr. Colin Hirsch and Daniel Frey
22
// Please see LICENSE for license or visit https://github.com/taocpp/json/
33

4-
#ifndef TAOCPP_JSON_INCLUDE_INTERNAL_SAX_KEY_STATE_HH
5-
#define TAOCPP_JSON_INCLUDE_INTERNAL_SAX_KEY_STATE_HH
4+
#ifndef TAOCPP_JSON_INCLUDE_INTERNAL_KEY_STATE_HH
5+
#define TAOCPP_JSON_INCLUDE_INTERNAL_KEY_STATE_HH
66

77
#include <string>
88
#include <utility>
@@ -13,11 +13,11 @@ namespace tao
1313
{
1414
namespace internal
1515
{
16-
struct sax_key_state
16+
struct key_state
1717
{
18-
sax_key_state() = default;
19-
sax_key_state( const sax_key_state & ) = delete;
20-
void operator= ( const sax_key_state & ) = delete;
18+
key_state() = default;
19+
key_state( const key_state & ) = delete;
20+
void operator= ( const key_state & ) = delete;
2121

2222
template< typename Handler >
2323
void success( Handler & handler )

include/tao/json/internal/sax_number_state.hh renamed to include/tao/json/internal/number_state.hh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright (c) 2016 Dr. Colin Hirsch and Daniel Frey
22
// Please see LICENSE for license or visit https://github.com/taocpp/json/
33

4-
#ifndef TAOCPP_JSON_INCLUDE_INTERNAL_SAX_NUMBER_STATE_HH
5-
#define TAOCPP_JSON_INCLUDE_INTERNAL_SAX_NUMBER_STATE_HH
4+
#ifndef TAOCPP_JSON_INCLUDE_INTERNAL_NUMBER_STATE_HH
5+
#define TAOCPP_JSON_INCLUDE_INTERNAL_NUMBER_STATE_HH
66

77
#include <cstdint>
88
#include <cstdlib>
@@ -18,15 +18,15 @@ namespace tao
1818
{
1919
static const std::size_t max_mantissa_digits = 772;
2020

21-
struct sax_number_state
21+
struct number_state
2222
{
23-
sax_number_state()
23+
number_state()
2424
{
2525
mantissa[ 0 ] = '-';
2626
}
2727

28-
sax_number_state( const sax_number_state & ) = delete;
29-
void operator= ( const sax_number_state & ) = delete;
28+
number_state( const number_state & ) = delete;
29+
void operator= ( const number_state & ) = delete;
3030

3131
int32_t exponent10 = 0;
3232
uint16_t msize = 0; // Excluding sign.

include/tao/json/internal/sax_control.hh

Lines changed: 0 additions & 41 deletions
This file was deleted.

include/tao/json/internal/sax_string_state.hh renamed to include/tao/json/internal/string_state.hh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright (c) 2016 Dr. Colin Hirsch and Daniel Frey
22
// Please see LICENSE for license or visit https://github.com/taocpp/json/
33

4-
#ifndef TAOCPP_JSON_INCLUDE_INTERNAL_SAX_STRING_STATE_HH
5-
#define TAOCPP_JSON_INCLUDE_INTERNAL_SAX_STRING_STATE_HH
4+
#ifndef TAOCPP_JSON_INCLUDE_INTERNAL_STRING_STATE_HH
5+
#define TAOCPP_JSON_INCLUDE_INTERNAL_STRING_STATE_HH
66

77
#include <string>
88
#include <utility>
@@ -13,11 +13,11 @@ namespace tao
1313
{
1414
namespace internal
1515
{
16-
struct sax_string_state
16+
struct string_state
1717
{
18-
sax_string_state() = default;
19-
sax_string_state( const sax_string_state & ) = delete;
20-
void operator= ( const sax_string_state & ) = delete;
18+
string_state() = default;
19+
string_state( const string_state & ) = delete;
20+
void operator= ( const string_state & ) = delete;
2121

2222
template< typename Handler >
2323
void success( Handler & handler )

include/tao/json/parse_file.hh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#include "internal/value_builder.hh"
1010

1111
#include "internal/grammar.hh"
12-
#include "internal/sax_action.hh"
13-
#include "internal/sax_control.hh"
12+
#include "internal/action.hh"
13+
#include "internal/control.hh"
1414

1515
namespace tao
1616
{
@@ -20,7 +20,7 @@ namespace tao
2020
basic_value< Traits > parse_file( const std::string & filename )
2121
{
2222
internal::value_builder< Traits > handler;
23-
tao_json_pegtl::file_parser( filename ).parse< internal::grammar, internal::sax_action, internal::sax_control >( handler );
23+
tao_json_pegtl::file_parser( filename ).parse< internal::grammar, internal::action, internal::control >( handler );
2424
return std::move( handler.value );
2525
}
2626

0 commit comments

Comments
 (0)