Skip to content

Commit 024fd2e

Browse files
author
dawesc
committed
Windows needs more typedef
1 parent ae94087 commit 024fd2e

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

include/json/config.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@
115115

116116
//We may want to have different presets for the default allocator and
117117
//string
118-
#define JSONCPP_DEFAULT_CHAR_TRAITS = std::char_traits<char>
119-
#define JSONCPP_DEFAULT_ALLOCATOR = std::allocator<char>
118+
//#define JSONCPP_DEFAULT_CHAR_TRAITS = std::char_traits<char>
119+
//#define JSONCPP_DEFAULT_ALLOCATOR = std::allocator<char>
120+
#define JSONCPP_DEFAULT_CHAR_TRAITS
121+
#define JSONCPP_DEFAULT_ALLOCATOR
120122

121123
namespace Json {
122124
typedef int Int;

include/json/reader.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ template<typename _Traits, typename _Alloc>
2121
int Reader<_Traits, _Alloc>::stackDepth_g = 0;
2222

2323
template<typename _Traits, typename _Alloc>
24-
bool Reader<_Traits, _Alloc>::containsNewLine(Reader<_Traits, _Alloc>::Location begin, Reader<_Traits, _Alloc>::Location end) {
24+
bool Reader<_Traits, _Alloc>::containsNewLine(typename Reader<_Traits, _Alloc>::Location begin, typename Reader<_Traits, _Alloc>::Location end) {
2525
for (; begin < end; ++begin)
2626
if (*begin == '\n' || *begin == '\r')
2727
return true;
@@ -326,7 +326,7 @@ bool Reader<_Traits, _Alloc>::readComment() {
326326
}
327327

328328
template<typename _Traits, typename _Alloc>
329-
std::basic_string<char, _Traits, _Alloc> Reader<_Traits, _Alloc>::normalizeEOL(Reader<_Traits, _Alloc>::Location begin, Reader<_Traits, _Alloc>::Location end) {
329+
std::basic_string<char, _Traits, _Alloc> Reader<_Traits, _Alloc>::normalizeEOL(typename Reader<_Traits, _Alloc>::Location begin, typename Reader<_Traits, _Alloc>::Location end) {
330330
std::basic_string<char, _Traits, _Alloc> normalized;
331331
normalized.reserve(end - begin);
332332
Reader<_Traits, _Alloc>::Location current = begin;

include/json/reader_declaration.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class JSON_API Reader {
131131
* errors. This can occur if the parser recovers from a non-fatal
132132
* parse error and then encounters additional errors.
133133
*/
134-
std::vector<Reader::StructuredError> getStructuredErrors() const;
134+
std::vector<typename Reader::StructuredError> getStructuredErrors() const;
135135

136136
/** \brief Add a semantic error message.
137137
* \param value JSON Value<_Traits, _Alloc> location associated with the error
@@ -156,8 +156,8 @@ class JSON_API Reader {
156156
*/
157157
bool good() const;
158158

159-
static bool containsNewLine(Reader<_Traits, _Alloc>::Location begin, Reader<_Traits, _Alloc>::Location end);
160-
static std::basic_string<char, _Traits, _Alloc> normalizeEOL(Reader<_Traits, _Alloc>::Location begin, Reader<_Traits, _Alloc>::Location end);
159+
static bool containsNewLine(typename Reader<_Traits, _Alloc>::Location begin, typename Reader<_Traits, _Alloc>::Location end);
160+
static std::basic_string<char, _Traits, _Alloc> normalizeEOL(typename Reader<_Traits, _Alloc>::Location begin, typename Reader<_Traits, _Alloc>::Location end);
161161

162162
private:
163163
enum TokenType {
@@ -408,7 +408,7 @@ class OurReader {
408408
Value<_Traits, _Alloc>& root,
409409
bool collectComments = true);
410410
std::basic_string<char, _Traits, _Alloc> getFormattedErrorMessages() const;
411-
std::vector<OurReader::StructuredError> getStructuredErrors() const;
411+
std::vector<typename OurReader::StructuredError> getStructuredErrors() const;
412412
bool pushError(const Value<_Traits, _Alloc>& value, const std::basic_string<char, _Traits, _Alloc>& message);
413413
bool pushError(const Value<_Traits, _Alloc>& value, const std::basic_string<char, _Traits, _Alloc>& message, const Value<_Traits, _Alloc>& extra);
414414
bool good() const;

include/json/value.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ Value<_Traits, _Alloc>::Value(const char* beginValue, const char* endValue) {
304304
}
305305

306306
template<typename _Traits, typename _Alloc>
307-
Value<_Traits, _Alloc>::Value(const std::basic_string<Value<_Traits, _Alloc>::value_type, Value<_Traits, _Alloc>::traits_type, Value<_Traits, _Alloc>::allocator_type>& value) {
307+
Value<_Traits, _Alloc>::Value(const std::basic_string<typename Value<_Traits, _Alloc>::value_type, typename Value<_Traits, _Alloc>::traits_type, typename Value<_Traits, _Alloc>::allocator_type>& value) {
308308
initBasic(stringValue, true);
309309
value_.stringDuplicate_ =
310310
duplicateAndPrefixStringValue(value.data(), static_cast<unsigned>(value.length()));
@@ -1072,7 +1072,7 @@ const Value<_Traits, _Alloc>& Value<_Traits, _Alloc>::operator[](const char* key
10721072
return *found;
10731073
}
10741074
template<typename _Traits, typename _Alloc>
1075-
Value<_Traits, _Alloc> const& Value<_Traits, _Alloc>::operator[](Value<_Traits, _Alloc>::string_type const& key) const
1075+
Value<_Traits, _Alloc> const& Value<_Traits, _Alloc>::operator[](typename Value<_Traits, _Alloc>::string_type const& key) const
10761076
{
10771077
Value<_Traits, _Alloc> const* found = find(key.data(), key.data() + key.length());
10781078
if (!found) return nullRef;
@@ -1085,7 +1085,7 @@ Value<_Traits, _Alloc>& Value<_Traits, _Alloc>::operator[](const char* key) {
10851085
}
10861086

10871087
template<typename _Traits, typename _Alloc>
1088-
Value<_Traits, _Alloc>& Value<_Traits, _Alloc>::operator[](const Value<_Traits, _Alloc>::string_type& key) {
1088+
Value<_Traits, _Alloc>& Value<_Traits, _Alloc>::operator[](const typename Value<_Traits, _Alloc>::string_type& key) {
10891089
return resolveReference(key.data(), key.data() + key.length());
10901090
}
10911091

@@ -1123,7 +1123,7 @@ Value<_Traits, _Alloc> Value<_Traits, _Alloc>::get(char const* key, Value<_Trait
11231123
return get(key, key + strlen(key), defaultValue);
11241124
}
11251125
template<typename _Traits, typename _Alloc>
1126-
Value<_Traits, _Alloc> Value<_Traits, _Alloc>::get(Value<_Traits, _Alloc>::string_type const& key, Value<_Traits, _Alloc> const& defaultValue) const
1126+
Value<_Traits, _Alloc> Value<_Traits, _Alloc>::get(typename Value<_Traits, _Alloc>::string_type const& key, Value<_Traits, _Alloc> const& defaultValue) const
11271127
{
11281128
return get(key.data(), key.data() + key.length(), defaultValue);
11291129
}
@@ -1149,7 +1149,7 @@ bool Value<_Traits, _Alloc>::removeMember(const char* key, Value<_Traits, _Alloc
11491149
return removeMember(key, key + strlen(key), removed);
11501150
}
11511151
template<typename _Traits, typename _Alloc>
1152-
bool Value<_Traits, _Alloc>::removeMember(Value<_Traits, _Alloc>::string_type const& key, Value<_Traits, _Alloc>* removed)
1152+
bool Value<_Traits, _Alloc>::removeMember(typename Value<_Traits, _Alloc>::string_type const& key, Value<_Traits, _Alloc>* removed)
11531153
{
11541154
return removeMember(key.data(), key.data() + key.length(), removed);
11551155
}
@@ -1166,7 +1166,7 @@ Value<_Traits, _Alloc> Value<_Traits, _Alloc>::removeMember(const char* key)
11661166
return removed; // still null if removeMember() did nothing
11671167
}
11681168
template<typename _Traits, typename _Alloc>
1169-
Value<_Traits, _Alloc> Value<_Traits, _Alloc>::removeMember(const Value<_Traits, _Alloc>::string_type& key)
1169+
Value<_Traits, _Alloc> Value<_Traits, _Alloc>::removeMember(const typename Value<_Traits, _Alloc>::string_type& key)
11701170
{
11711171
return removeMember(key.c_str());
11721172
}
@@ -1215,7 +1215,7 @@ bool Value<_Traits, _Alloc>::isMember(char const* key) const
12151215
return isMember(key, key + strlen(key));
12161216
}
12171217
template<typename _Traits, typename _Alloc>
1218-
bool Value<_Traits, _Alloc>::isMember(Value<_Traits, _Alloc>::string_type const& key) const
1218+
bool Value<_Traits, _Alloc>::isMember(typename Value<_Traits, _Alloc>::string_type const& key) const
12191219
{
12201220
return isMember(key.data(), key.data() + key.length());
12211221
}

0 commit comments

Comments
 (0)