blob: 47adac9b0f9fa6a127bf7e5605b23dead4de68b9 [file] [log] [blame]
Erik Kline2d3a1632016-03-15 16:33:48 +09001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef NETD_SERVER_DUMPWRITER_H_
18#define NETD_SERVER_DUMPWRITER_H_
19
20#include <string>
21#include <utils/String16.h>
22#include <utils/Vector.h>
23
Lorenzo Colitti7035f222017-02-13 18:29:00 +090024namespace android {
25namespace net {
Erik Kline2d3a1632016-03-15 16:33:48 +090026
27class DumpWriter {
28public:
29 DumpWriter(int fd);
30
31 void incIndent();
32 void decIndent();
33
34 void println(const std::string& line);
35 void println(const char* fmt, ...);
36 void blankline() { println(""); }
37
38private:
39 uint8_t mIndentLevel;
40 int mFd;
41};
42
Lorenzo Colitti7035f222017-02-13 18:29:00 +090043} // namespace net
44} // namespace android
45
Erik Kline2d3a1632016-03-15 16:33:48 +090046#endif // NETD_SERVER_DUMPWRITER_H_