PR changes: add document of makeCharReader, revert changes made by reformat.sh script

This commit is contained in:
Assaf Passal 2022-08-05 15:41:07 +03:00
parent f2ec46663f
commit d60e466dd1
3 changed files with 8 additions and 6 deletions

View File

@ -271,6 +271,10 @@ public:
* \throw std::exception if something goes wrong (e.g. invalid settings)
*/
virtual CharReader* newCharReader() const = 0;
/** \brief Allocate a CharReader via newCharReader().
* wrap the object in std::unique_ptr<CharReader> to esnure deletion.
* \throw std::exception if something goes wrong (e.g. invalid settings)
*/
std::unique_ptr<CharReader> makeCharReader() const;
}; // Factory
}; // CharReader

View File

@ -1895,7 +1895,6 @@ public:
CharReaderBuilder::CharReaderBuilder() { setDefaults(&settings_); }
CharReaderBuilder::~CharReaderBuilder() = default;
CharReader* CharReaderBuilder::newCharReader() const {
bool collectComments = settings_["collectComments"].asBool();
OurFeatures features = OurFeatures::all();

View File

@ -132,9 +132,8 @@ String valueToString(double value, bool useSpecialFloats,
if (!isfinite(value)) {
static const char* const reps[2][3] = {{"NaN", "-Infinity", "Infinity"},
{"null", "-1e+9999", "1e+9999"}};
return reps[useSpecialFloats ? 0 : 1][isnan(value) ? 0
: (value < 0) ? 1
: 2];
return reps[useSpecialFloats ? 0 : 1]
[isnan(value) ? 0 : (value < 0) ? 1 : 2];
}
String buffer(size_t(36), '\0');