596f5e0544
Migrated from the webm-tools repository with minor tweaks to fix its build in the new location. Last location/revision: https://chromium.googlesource.com/webm/webm-tools a7e97e8f0a913ddd97444392bb8816f44a4821a1 Change-Id: Icfad43d9fdd37fc413a6a28b57b370c97c7c28df
30 lines
754 B
C++
30 lines
754 B
C++
/*
|
|
* Copyright (c) 2012 The WebM project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#include "common/indent.h"
|
|
|
|
#include <string>
|
|
|
|
namespace libwebm {
|
|
|
|
Indent::Indent(int indent) : indent_(indent), indent_str_() { Update(); }
|
|
|
|
void Indent::Adjust(int indent) {
|
|
indent_ += indent;
|
|
if (indent_ < 0)
|
|
indent_ = 0;
|
|
|
|
Update();
|
|
}
|
|
|
|
void Indent::Update() { indent_str_ = std::string(indent_, ' '); }
|
|
|
|
} // namespace libwebm
|