Skip to content

Commit 51721ca

Browse files
committed
Removed unneeded macro, added options to make_from_json.
1 parent 185fdec commit 51721ca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+63
-68
lines changed

parse/jsd_array.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace JSON
88
{
99
template <typename T, std::size_t N>
1010
void parse(std::array<T, N>& value, std::string const& name,
11-
PropertyTree const& object, ParsingOptions const& options = DEFAULT_PARSER_OPTIONS)
11+
PropertyTree const& object, ParsingOptions const& options = {})
1212
{
1313
try
1414
{

parse/jsd_atomic.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace JSON
77
{
88
template <typename T>
99
void parse(std::atomic<T>& value, std::string const& name,
10-
PropertyTree const& object, ParsingOptions const& options = DEFAULT_PARSER_OPTIONS)
10+
PropertyTree const& object, ParsingOptions const& options = {})
1111
{
1212
try
1313
{

parse/jsd_container.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace JSON
66
{
77
template <typename T, template <typename, class = std::allocator <T> > class ContainerT>
88
void parse(ContainerT<T>& value, std::string const& name,
9-
PropertyTree const& object, ParsingOptions const& options = DEFAULT_PARSER_OPTIONS)
9+
PropertyTree const& object, ParsingOptions const& options = {})
1010
{
1111
try
1212
{

parse/jsd_convenience.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,37 @@
77
namespace JSON
88
{
99
template <typename T>
10-
void try_parse(T& obj, std::string const& name, PropertyTree const& tree, ParsingOptions const& options = DEFAULT_PARSER_OPTIONS,
10+
void try_parse(T& obj, std::string const& name, PropertyTree const& tree, ParsingOptions const& options = {},
1111
typename std::enable_if <Internal::can_parse<T>::value, void>::type* = nullptr)
1212
{
1313
parse(obj, name, tree, options);
1414
}
1515

1616
template <typename T>
17-
void try_parse(T&, std::string const&, PropertyTree const&, ParsingOptions const& = DEFAULT_PARSER_OPTIONS,
17+
void try_parse(T&, std::string const&, PropertyTree const&, ParsingOptions const& = {},
1818
typename std::enable_if <!Internal::can_parse<T>::value, int>::type* = nullptr)
1919
{
2020
static_assert (Internal::can_parse<T>::value, "the object you try to parse has no applicable interface");
2121
}
2222

2323
template <typename T>
24-
T make_from_json(std::istream&& stream)
24+
T make_from_json(std::istream&& stream, ParsingOptions const& = {})
2525
{
2626
T res;
2727
JSON::parse(res, "", JSON::parse_json(stream));
2828
return res;
2929
}
3030

3131
template <typename T>
32-
T make_from_json(std::istream& stream)
32+
T make_from_json(std::istream& stream, ParsingOptions const& = {})
3333
{
3434
T res;
3535
JSON::parse(res, "", JSON::parse_json(stream));
3636
return res;
3737
}
3838

3939
template <typename T>
40-
T make_from_json(std::string const& str)
40+
T make_from_json(std::string const& str, ParsingOptions const& = {})
4141
{
4242
T res;
4343
JSON::parse(res, "", JSON::parse_json(str));

parse/jsd_enum.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace JSON
99
{
1010
template <typename T>
1111
void parse(T& value, std::string const& name,
12-
PropertyTree const& object, ParsingOptions const& options = DEFAULT_PARSER_OPTIONS,
12+
PropertyTree const& object, ParsingOptions const& options = {},
1313
typename std::enable_if<std::is_enum<T>::value>::type* = nullptr)
1414
{
1515
try

parse/jsd_fundamental.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace JSON
1010
&& !std::is_enum<T>::value >::type
1111
>
1212
void parse(T& value, std::string const& name,
13-
PropertyTree const& object, ParsingOptions const& options = DEFAULT_PARSER_OPTIONS)
13+
PropertyTree const& object, ParsingOptions const& options = {})
1414
{
1515
try
1616
{
@@ -27,7 +27,7 @@ namespace JSON
2727
}
2828

2929
void parse(char& value, std::string const& name,
30-
PropertyTree const& object, ParsingOptions const& options = DEFAULT_PARSER_OPTIONS);
30+
PropertyTree const& object, ParsingOptions const& options = {});
3131
void parse(wchar_t& value, std::string const& name,
32-
PropertyTree const& object, ParsingOptions const& options = DEFAULT_PARSER_OPTIONS);
32+
PropertyTree const& object, ParsingOptions const& options = {});
3333
}

parse/jsd_map.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace JSON
77
{
88
template <typename ValueT, typename CompareT = std::less <ValueT>, class AllocT = std::allocator <ValueT>>
99
void parse(std::map<std::string, ValueT, CompareT, AllocT>& value, std::string const& name,
10-
PropertyTree const& object, ParsingOptions const& options = DEFAULT_PARSER_OPTIONS)
10+
PropertyTree const& object, ParsingOptions const& options = {})
1111
{
1212
try
1313
{

parse/jsd_object.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace JSON
4343

4444
template <typename T>
4545
typename std::enable_if <Internal::isParsable<T>::value, void>::type
46-
parse(T& value, std::string const& name, PropertyTree const& tree, ParsingOptions const& options = DEFAULT_PARSER_OPTIONS)
46+
parse(T& value, std::string const& name, PropertyTree const& tree, ParsingOptions const& options = {})
4747
{
4848
value.parse(name, tree, options);
4949
}

parse/jsd_optional.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace JSON
88
{
99
template <typename T>
1010
void parse(boost::optional <T>& value, std::string const& name,
11-
PropertyTree const& object, ParsingOptions const& options = DEFAULT_PARSER_OPTIONS)
11+
PropertyTree const& object, ParsingOptions const& options = {})
1212
{
1313
try
1414
{

parse/jsd_options.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,4 @@
22

33
namespace JSON
44
{
5-
ParsingOptions::ParsingOptions(InvalidPropertyHandlingBehaviour invalidPropertyHandler,
6-
InvalidPathHandlingBehaviour invalidPathHandler,
7-
bool strings_are_binary)
8-
: invalidPropertyHandler(invalidPropertyHandler)
9-
, invalidPathHandler(invalidPathHandler)
10-
, strings_are_binary(strings_are_binary)
11-
{}
125
}

0 commit comments

Comments
 (0)