Skip to content

Commit 027ee3d

Browse files
committed
Fix up code to execute
Now with the templates in place we need to have the code so that it compiles, this is going through and adding typename in appropriate places and the links to the template names throughout the class names to get it to compile.
1 parent 0092dd7 commit 027ee3d

File tree

13 files changed

+840
-812
lines changed

13 files changed

+840
-812
lines changed

include/json/forwards.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ template<class _Value>
3434
class Path;
3535
template<class _Value>
3636
class PathArgument;
37-
template<template<class T> class _Alloc = std::allocator<char>,
38-
class _String = std::basic_string<char, std::char_traits<char>, std::allocator<char>>>
37+
template<class _Alloc, class _String>
3938
class Value;
4039
template<class _Value>
4140
class ValueIteratorBase;

include/json/reader.h

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class JSON_API Reader {
7474
* error occurred.
7575
*/
7676
bool
77-
parse(const std::string& document, Value& root, bool collectComments = true);
77+
parse(const std::string& document, _Value& root, bool collectComments = true);
7878

7979
/** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a>
8080
document.
@@ -96,12 +96,12 @@ class JSON_API Reader {
9696
*/
9797
bool parse(const char* beginDoc,
9898
const char* endDoc,
99-
Value& root,
99+
_Value& root,
100100
bool collectComments = true);
101101

102102
/// \brief Parse from input stream.
103103
/// \see Json::operator>>(std::istream&, Json::Value&).
104-
bool parse(std::istream& is, Value& root, bool collectComments = true);
104+
bool parse(std::istream& is, _Value& root, bool collectComments = true);
105105

106106
/** \brief Returns a user friendly string that list errors in the parsed
107107
* document.
@@ -140,7 +140,7 @@ class JSON_API Reader {
140140
* \return \c true if the error was successfully added, \c false if the
141141
* Value offset exceeds the document size.
142142
*/
143-
bool pushError(const Value& value, const std::string& message);
143+
bool pushError(const _Value& value, const std::string& message);
144144

145145
/** \brief Add a semantic error message with extra context.
146146
* \param value JSON Value location associated with the error
@@ -149,7 +149,7 @@ class JSON_API Reader {
149149
* \return \c true if the error was successfully added, \c false if either
150150
* Value offset exceeds the document size.
151151
*/
152-
bool pushError(const Value& value, const std::string& message, const Value& extra);
152+
bool pushError(const _Value& value, const std::string& message, const _Value& extra);
153153

154154
/** \brief Return whether there are any errors.
155155
* \return \c true if there are no errors to report \c false if
@@ -203,11 +203,11 @@ class JSON_API Reader {
203203
bool readObject(Token& token);
204204
bool readArray(Token& token);
205205
bool decodeNumber(Token& token);
206-
bool decodeNumber(Token& token, Value& decoded);
206+
bool decodeNumber(Token& token, _Value& decoded);
207207
bool decodeString(Token& token);
208208
bool decodeString(Token& token, std::string& decoded);
209209
bool decodeDouble(Token& token);
210-
bool decodeDouble(Token& token, Value& decoded);
210+
bool decodeDouble(Token& token, _Value& decoded);
211211
bool decodeUnicodeCodePoint(Token& token,
212212
Location& current,
213213
Location end,
@@ -222,23 +222,23 @@ class JSON_API Reader {
222222
Token& token,
223223
TokenType skipUntilToken);
224224
void skipUntilSpace();
225-
Value& currentValue();
225+
_Value& currentValue();
226226
Char getNextChar();
227227
void
228228
getLocationLineAndColumn(Location location, int& line, int& column) const;
229229
std::string getLocationLineAndColumn(Location location) const;
230230
void addComment(Location begin, Location end, CommentPlacement placement);
231231
void skipCommentTokens(Token& token);
232232

233-
typedef std::stack<Value*> Nodes;
233+
typedef std::stack<_Value*> Nodes;
234234
Nodes nodes_;
235235
Errors errors_;
236236
std::string document_;
237237
Location begin_;
238238
Location end_;
239239
Location current_;
240240
Location lastValueEnd_;
241-
Value* lastValue_;
241+
_Value* lastValue_;
242242
std::string commentsBefore_;
243243
Features features_;
244244
bool collectComments_;
@@ -269,7 +269,7 @@ class JSON_API CharReader {
269269
*/
270270
virtual bool parse(
271271
char const* beginDoc, char const* endDoc,
272-
Value* root, std::string* errs) = 0;
272+
_Value* root, std::string* errs) = 0;
273273

274274
class JSON_API Factory {
275275
public:
@@ -294,7 +294,7 @@ class JSON_API CharReader {
294294
\endcode
295295
*/
296296
template<class _Value>
297-
class JSON_API CharReaderBuilder : public CharReader::Factory {
297+
class JSON_API CharReaderBuilder : public CharReader<_Value>::Factory {
298298
public:
299299
// Note: We use a Json::Value so that we can add data-members to this class
300300
// without a major version bump.
@@ -334,34 +334,34 @@ class JSON_API CharReaderBuilder : public CharReader::Factory {
334334
JSON Value.
335335
\sa setDefaults()
336336
*/
337-
Json::Value settings_;
337+
_Value settings_;
338338

339339
CharReaderBuilder();
340340
~CharReaderBuilder() override;
341341

342-
CharReader* newCharReader() const override;
342+
CharReader<_Value>* newCharReader() const override;
343343

344344
/** \return true if 'settings' are legal and consistent;
345345
* otherwise, indicate bad settings via 'invalid'.
346346
*/
347-
bool validate(Json::Value* invalid) const;
347+
bool validate(_Value* invalid) const;
348348

349349
/** A simple way to update a specific setting.
350350
*/
351-
Value& operator[](std::string key);
351+
_Value& operator[](std::string key);
352352

353353
/** Called by ctor, but you can use this to reset settings_.
354354
* \pre 'settings' != NULL (but Json::null is fine)
355355
* \remark Defaults:
356356
* \snippet src/lib_json/json_reader.cpp CharReaderBuilderDefaults
357357
*/
358-
static void setDefaults(Json::Value* settings);
358+
static void setDefaults(_Value* settings);
359359
/** Same as old Features::strictMode().
360360
* \pre 'settings' != NULL (but Json::null is fine)
361361
* \remark Defaults:
362362
* \snippet src/lib_json/json_reader.cpp CharReaderBuilderStrictMode
363363
*/
364-
static void strictMode(Json::Value* settings);
364+
static void strictMode(_Value* settings);
365365
};
366366

367367
/** Consume entire stream and use its begin/end.
@@ -370,9 +370,9 @@ class JSON_API CharReaderBuilder : public CharReader::Factory {
370370
*/
371371
template<class _Value>
372372
bool JSON_API parseFromStream(
373-
CharReader::Factory const&,
373+
typename CharReader<_Value>::Factory const&,
374374
std::istream&,
375-
Value* root, std::string* errs);
375+
_Value* root, std::string* errs);
376376

377377
/** \brief Read from 'sin' into 'root'.
378378
@@ -399,7 +399,7 @@ bool JSON_API parseFromStream(
399399
\see Json::operator<<()
400400
*/
401401
template<class _Value>
402-
JSON_API std::istream& operator>>(std::istream&, Value&);
402+
JSON_API std::istream& operator>>(std::istream&, _Value&);
403403

404404
} // namespace detail
405405

0 commit comments

Comments
 (0)