Skip to content

Commit

Permalink
Update vendor
Browse files Browse the repository at this point in the history
  • Loading branch information
tekezo committed Jun 19, 2024
1 parent 4c543c1 commit b11c302
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

// pqrs::json v1.5
// pqrs::json v1.6

// (C) Copyright Takayama Fumihiko 2019.
// Distributed under the Boost Software License, Version 1.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ struct options {
namespace impl {

template <typename T>
bool multi_line(const T& json,
const options& options,
std::optional<std::string> parent_object_key) {
inline bool multi_line(const T& json,
const options& options,
std::optional<std::string> parent_object_key) {
if (json.is_object()) {
if (json.size() == 0) {
return false;
Expand Down Expand Up @@ -113,20 +113,20 @@ bool multi_line(const T& json,
return false;
}

void indent(std::ostringstream& ss,
const options& options,
int indent_level) {
inline void indent(std::ostringstream& ss,
const options& options,
int indent_level) {
for (int i = 0; i < options.indent_size * indent_level; ++i) {
ss << ' ';
}
}

template <typename T>
void format(std::ostringstream& ss,
const T& json,
const options& options,
std::optional<std::string> parent_object_key,
int indent_level) {
inline void format(std::ostringstream& ss,
const T& json,
const options& options,
std::optional<std::string> parent_object_key,
int indent_level) {
if (json.is_object()) {
if (!multi_line(json, options, parent_object_key)) {
//
Expand Down Expand Up @@ -250,8 +250,8 @@ void format(std::ostringstream& ss,
} // namespace impl

template <typename T>
std::string format(const T& json,
const options& options) {
inline std::string format(const T& json,
const options& options) {
std::ostringstream ss;
impl::format(ss, json, options, std::nullopt, 0);
return ss.str();
Expand Down

0 comments on commit b11c302

Please sign in to comment.