@@ -892,6 +892,39 @@ bool Reader::good() const {
892
892
return !errors_.size ();
893
893
}
894
894
895
+ // exact copy of Features
896
+ class OldFeatures {
897
+ public:
898
+ static OldFeatures all ();
899
+ static OldFeatures strictMode ();
900
+ OldFeatures ();
901
+ bool allowComments_;
902
+ bool strictRoot_;
903
+ bool allowDroppedNullPlaceholders_;
904
+ bool allowNumericKeys_;
905
+ }; // OldFeatures
906
+
907
+ // exact copy of Implementation of class Features
908
+ // ////////////////////////////////
909
+
910
+ OldFeatures::OldFeatures ()
911
+ : allowComments_(true ), strictRoot_(false ),
912
+ allowDroppedNullPlaceholders_(false ), allowNumericKeys_(false ) {}
913
+
914
+ OldFeatures OldFeatures::all () { return OldFeatures (); }
915
+
916
+ OldFeatures OldFeatures::strictMode () {
917
+ OldFeatures features;
918
+ features.allowComments_ = false ;
919
+ features.strictRoot_ = true ;
920
+ features.allowDroppedNullPlaceholders_ = false ;
921
+ features.allowNumericKeys_ = false ;
922
+ return features;
923
+ }
924
+
925
+ // Implementation of class Reader
926
+ // ////////////////////////////////
927
+
895
928
// exact copy of Reader, renamed to OldReader
896
929
class OldReader {
897
930
public:
@@ -903,7 +936,7 @@ class OldReader {
903
936
std::string message;
904
937
};
905
938
906
- OldReader (Features const & features);
939
+ OldReader (OldFeatures const & features);
907
940
bool parse (const char * beginDoc,
908
941
const char * endDoc,
909
942
Value& root,
@@ -1000,13 +1033,13 @@ class OldReader {
1000
1033
Location lastValueEnd_;
1001
1034
Value* lastValue_;
1002
1035
std::string commentsBefore_;
1003
- Features features_;
1036
+ OldFeatures features_;
1004
1037
bool collectComments_;
1005
1038
}; // OldReader
1006
1039
1007
1040
// complete copy of Read impl, for OldReader
1008
1041
1009
- OldReader::OldReader (Features const & features)
1042
+ OldReader::OldReader (OldFeatures const & features)
1010
1043
: errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(),
1011
1044
lastValue_(), commentsBefore_(), features_(features), collectComments_() {
1012
1045
}
@@ -1788,7 +1821,7 @@ class OldCharReader : public CharReader {
1788
1821
public:
1789
1822
OldCharReader (
1790
1823
bool collectComments,
1791
- Features const & features)
1824
+ OldFeatures const & features)
1792
1825
: collectComments_(collectComments)
1793
1826
, reader_(features)
1794
1827
{}
@@ -1815,7 +1848,7 @@ CharReader* CharReaderBuilder::newCharReader() const
1815
1848
// TODO: Maybe serialize the invalid settings into the exception.
1816
1849
1817
1850
bool collectComments = settings_[" collectComments" ].asBool ();
1818
- Features features = Features ::all ();
1851
+ OldFeatures features = OldFeatures ::all ();
1819
1852
features.allowComments_ = settings_[" allowComments" ].asBool ();
1820
1853
features.strictRoot_ = settings_[" strictRoot" ].asBool ();
1821
1854
features.allowDroppedNullPlaceholders_ = settings_[" allowDroppedNullPlaceholders" ].asBool ();
0 commit comments