}
}
-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_;
};
//////////////////////////////////////////////////////////////////////
// Parse ahead for as long as the supplied predicate is satisfied,
// returning a range of what was skipped.
- template<class Predicate>
+ template <class Predicate>
StringPiece skipWhile(const Predicate& p) {
std::size_t skipped = 0;
for (; skipped < range_.size(); ++skipped) {
storeCurrent();
}
- template<class T>
+ template <class T>
T extract() {
try {
return to<T>(&range_);
current_ = range_.empty() ? EOF : range_.front();
}
-private:
+ private:
StringPiece range_;
json::serialization_opts const& opts_;
unsigned lineNum_;
in.error("expected json value");
}
-}
+} // namespace
//////////////////////////////////////////////////////////////////////
template <class T>
size_t firstEscapableInWord(T s) {
static_assert(std::is_unsigned<T>::value, "Unsigned integer required");
- constexpr T kOnes = ~T() / 255; // 0x...0101
- constexpr T kMsbs = kOnes * 0x80; // 0x...8080
+ static constexpr T kOnes = ~T() / 255; // 0x...0101
+ static constexpr T kMsbs = kOnes * 0x80; // 0x...8080
// Sets the MSB of bytes < b. Precondition: b < 128.
auto isLess = [](T w, uint8_t b) {
return result;
}
-}
+} // namespace json
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
-}
+} // namespace folly