Esempio n. 1
0
void PJson::insert_spacing(Type type, Out& out)
{
    if(!this->scope_closed && type != Type::Scope_End) {
        out.write(',');
    }
    if(this->compact) {
        return;
    }
    auto depth = type == Type::Scope_End
        ? this->scope_stack.size() - 1
        : this->scope_stack.size();

    if(this->scope_stack.size() > 0) {
        out.write('\n');
    }

    out.write_times(depth, '\t');
}