Skip to content

Commit

Permalink
stop calling validate() in newReader/Writer()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cdunn2001 committed Feb 11, 2015
1 parent acbf4eb commit 3ebba5c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/lib_json/json_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 0 additions & 3 deletions src/lib_json/json_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 3ebba5c

Please sign in to comment.