From 3ebba5cea89800e044505bc6de6259bdc6a4acfa Mon Sep 17 00:00:00 2001 From: Christopher Dunn Date: Wed, 11 Feb 2015 11:15:32 -0600 Subject: [PATCH] stop calling validate() in newReader/Writer() By not calling validate(), we can add non-invasive features which will be simply ignored when user-code is compiled against an old version. That way, we can often avoid a minor version-bump. The user can call validate() himself if he prefers that behavior. --- src/lib_json/json_reader.cpp | 3 --- src/lib_json/json_writer.cpp | 3 --- 2 files changed, 6 deletions(-) diff --git a/src/lib_json/json_reader.cpp b/src/lib_json/json_reader.cpp index 1e7db68..103bf67 100644 --- a/src/lib_json/json_reader.cpp +++ b/src/lib_json/json_reader.cpp @@ -1863,9 +1863,6 @@ CharReaderBuilder::~CharReaderBuilder() {} CharReader* CharReaderBuilder::newCharReader() const { - if (!validate(NULL)) throw std::runtime_error("invalid settings"); - // TODO: Maybe serialize the invalid settings into the exception. - bool collectComments = settings_["collectComments"].asBool(); OurFeatures features = OurFeatures::all(); features.allowComments_ = settings_["allowComments"].asBool(); diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp index ca62c78..29f6619 100644 --- a/src/lib_json/json_writer.cpp +++ b/src/lib_json/json_writer.cpp @@ -968,9 +968,6 @@ StreamWriterBuilder::~StreamWriterBuilder() {} StreamWriter* StreamWriterBuilder::newStreamWriter() const { - if (!validate(NULL)) throw std::runtime_error("invalid settings"); - // TODO: Maybe serialize the invalid settings into the exception. - std::string indentation = settings_["indentation"].asString(); std::string cs_str = settings_["commentStyle"].asString(); bool eyc = settings_["enableYAMLCompatibility"].asBool(); -- 2.7.4