/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
#include <folly/json.h>
#include <algorithm>
#include <boost/algorithm/string.hpp>
#include <boost/next_prior.hpp>
-#include <folly/Bits.h>
-#include <folly/Portability.h>
#include <folly/Conv.h>
+#include <folly/Portability.h>
#include <folly/Range.h>
#include <folly/String.h>
#include <folly/Unicode.h>
+#include <folly/lang/Bits.h>
#include <folly/portability/Constexpr.h>
namespace folly {
}
}
-private:
+ private:
void printKV(const std::pair<const dynamic, dynamic>& p) const {
if (!opts_.allow_non_string_keys && !p.first.isString()) {
throw std::runtime_error("folly::toJson: JSON object key was not a "
out_ += ']';
}
-private:
+ private:
void outdent() const {
if (indentLevel_) {
--*indentLevel_;
out_ += indentLevel_ ? " : " : ":";
}
-private:
- std::string& out_;
- unsigned* const indentLevel_;
- serialization_opts const& opts_;
+ private:
+ std::string& out_;
+ unsigned* const indentLevel_;
+ serialization_opts const& opts_;
};
//////////////////////////////////////////////////////////////////////
-struct ParseError : std::runtime_error {
+struct FOLLY_EXPORT ParseError : std::runtime_error {
explicit ParseError(
unsigned int line,
std::string const& context,
current_ = range_.empty() ? EOF : range_.front();
}
-private:
+ private:
StringPiece range_;
json::serialization_opts const& opts_;
unsigned lineNum_;
in.error("expected json value");
}
-}
+} // namespace
//////////////////////////////////////////////////////////////////////
return result;
}
-}
+} // namespace json
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
-}
+} // namespace folly