Atlas  0.7.0
Networking protocol for the Worldforge system.
MultiLineListFormatter.cpp
1 // Copyright (C) 2009 Alistair Riddoch
2 //
3 // This program is free software; you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation; either version 2 of the License, or
6 // (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software Foundation,
15 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 
17 #include "MultiLineListFormatter.h"
18 
19 #include <iostream>
20 
21 namespace Atlas
22 {
23 
24 MultiLineListFormatter::MultiLineListFormatter(std::ostream & s, Bridge & b) :
25  Formatter(s, b)
26 {
27 }
28 
30 {
32  m_indent += m_spacing;
33  m_stream << std::endl;
34 }
35 
37 {
39 }
40 
42 {
43  m_stream << std::string(m_indent, ' ');
45  m_indent += m_spacing;
46  m_stream << std::endl;
47 }
48 
50 {
51  m_stream << std::string(m_indent, ' ');
53  m_stream << std::endl;
54 }
55 
57 {
58  m_stream << std::string(m_indent, ' ');
60  m_stream << std::endl;
61 }
62 
64 {
65  m_stream << std::string(m_indent, ' ');
67  m_stream << std::endl;
68 }
69 
71 {
72  m_stream << std::string(m_indent, ' ');
74  m_stream << std::endl;
75 }
76 
78 {
79  m_indent -= m_spacing;
80  m_stream << std::string(m_indent, ' ');
82 }
83 }
void listStringItem(std::string) override
Definition: Formatter.cpp:118
void listIntItem(std::int64_t l) override
void listStringItem(std::string s) override
void listMapItem() override
Definition: Formatter.cpp:95
void listFloatItem(double d) override
void listEnd() override
Definition: Formatter.cpp:127
void listIntItem(std::int64_t) override
Definition: Formatter.cpp:108
void mapListItem(std::string name) override
Definition: Formatter.cpp:53
void listListItem() override
Definition: Formatter.cpp:103
void listNoneItem() override
Definition: Formatter.cpp:123
void listFloatItem(double) override
Definition: Formatter.cpp:113
Definition: Bridge.h:20
void mapListItem(std::string name) override