mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-10-01 00:41:18 -04:00
run clang format
This commit is contained in:
parent
7f7b02b95e
commit
2ff6cbcb97
@ -272,7 +272,7 @@ public:
|
||||
|
||||
/** \brief Returns a vector of structured errors encountered while parsing.
|
||||
* Each parse call resets the stored list of errors.
|
||||
*/
|
||||
*/
|
||||
std::vector<StructuredError> getStructuredErrors() const;
|
||||
|
||||
class JSON_API Factory {
|
||||
@ -287,17 +287,17 @@ public:
|
||||
protected:
|
||||
class Impl {
|
||||
public:
|
||||
virtual ~Impl() = default;
|
||||
virtual bool parse(char const* beginDoc, char const* endDoc, Value* root,
|
||||
String* errs) = 0;
|
||||
virtual std::vector<StructuredError> getStructuredErrors() const = 0;
|
||||
virtual ~Impl() = default;
|
||||
virtual bool parse(char const* beginDoc, char const* endDoc, Value* root,
|
||||
String* errs) = 0;
|
||||
virtual std::vector<StructuredError> getStructuredErrors() const = 0;
|
||||
};
|
||||
|
||||
explicit CharReader(std::unique_ptr<Impl> impl) : _impl(std::move(impl)) { }
|
||||
explicit CharReader(std::unique_ptr<Impl> impl) : _impl(std::move(impl)) {}
|
||||
|
||||
private:
|
||||
std::unique_ptr<Impl> _impl;
|
||||
}; // CharReader
|
||||
}; // CharReader
|
||||
|
||||
/** \brief Build a CharReader implementation.
|
||||
*
|
||||
|
@ -1831,7 +1831,8 @@ String OurReader::getFormattedErrorMessages() const {
|
||||
return formattedMessage;
|
||||
}
|
||||
|
||||
std::vector<CharReader::StructuredError> OurReader::getStructuredErrors() const {
|
||||
std::vector<CharReader::StructuredError>
|
||||
OurReader::getStructuredErrors() const {
|
||||
std::vector<CharReader::StructuredError> allErrors;
|
||||
for (const auto& error : errors_) {
|
||||
CharReader::StructuredError structured;
|
||||
@ -1847,7 +1848,8 @@ class OurCharReader : public CharReader {
|
||||
|
||||
public:
|
||||
OurCharReader(bool collectComments, OurFeatures const& features)
|
||||
: CharReader(std::unique_ptr<OurImpl>(new OurImpl(collectComments, features))) {}
|
||||
: CharReader(
|
||||
std::unique_ptr<OurImpl>(new OurImpl(collectComments, features))) {}
|
||||
|
||||
protected:
|
||||
class OurImpl : public Impl {
|
||||
@ -1864,7 +1866,8 @@ protected:
|
||||
return ok;
|
||||
}
|
||||
|
||||
std::vector<CharReader::StructuredError> getStructuredErrors() const override {
|
||||
std::vector<CharReader::StructuredError>
|
||||
getStructuredErrors() const override {
|
||||
return reader_.getStructuredErrors();
|
||||
}
|
||||
|
||||
@ -1961,13 +1964,14 @@ void CharReaderBuilder::setDefaults(Json::Value* settings) {
|
||||
//! [CharReaderBuilderDefaults]
|
||||
}
|
||||
|
||||
std::vector<CharReader::StructuredError> CharReader::getStructuredErrors() const {
|
||||
return _impl->getStructuredErrors();
|
||||
std::vector<CharReader::StructuredError>
|
||||
CharReader::getStructuredErrors() const {
|
||||
return _impl->getStructuredErrors();
|
||||
}
|
||||
|
||||
bool CharReader::parse(char const* beginDoc, char const* endDoc, Value* root,
|
||||
String* errs) {
|
||||
return _impl->parse(beginDoc, endDoc, root, errs);
|
||||
return _impl->parse(beginDoc, endDoc, root, errs);
|
||||
}
|
||||
|
||||
//////////////////////////////////
|
||||
|
@ -3918,8 +3918,9 @@ JSONTEST_FIXTURE_LOCAL(FuzzTest, fuzzDoesntCrash) {
|
||||
}
|
||||
|
||||
struct ParseWithStructuredErrorsTest : JsonTest::TestCase {
|
||||
void testErrors(const std::string& doc, bool success,
|
||||
const std::vector<Json::CharReader::StructuredError>& expectedErrors) {
|
||||
void testErrors(
|
||||
const std::string& doc, bool success,
|
||||
const std::vector<Json::CharReader::StructuredError>& expectedErrors) {
|
||||
Json::CharReaderBuilder b;
|
||||
CharReaderPtr reader(b.newCharReader());
|
||||
Json::Value root;
|
||||
|
Loading…
x
Reference in New Issue
Block a user