Last change
on this file since 90 was
90,
checked in by hozdoba, 14 years ago
|
Ancienne Version de parsing.
|
File size:
823 bytes
|
Line | |
---|
1 | #ifndef STDOUT_INDENT_HPP |
---|
2 | #define STDOUT_INDENT_HPP |
---|
3 | //#include "xmlio_std.hpp" |
---|
4 | |
---|
5 | extern int iostreamIndexIndent ; |
---|
6 | |
---|
7 | ostream& iendl(ostream& o) ; |
---|
8 | ostream& inc_endl(ostream& o) ; |
---|
9 | ostream& dec_endl(ostream& o) ; |
---|
10 | |
---|
11 | inline ostream& IncIndent(ostream& o) |
---|
12 | { |
---|
13 | ++o.iword(iostreamIndexIndent) ; |
---|
14 | return o ; |
---|
15 | } |
---|
16 | |
---|
17 | inline ostream& DecIndent(ostream& o) |
---|
18 | { |
---|
19 | if (o.iword(iostreamIndexIndent)>0) |
---|
20 | --o.iword(iostreamIndexIndent) ; |
---|
21 | return o ; |
---|
22 | } |
---|
23 | |
---|
24 | inline ostream& ResetIndent(ostream& o) |
---|
25 | { |
---|
26 | o.iword(iostreamIndexIndent)=0 ; |
---|
27 | return o ; |
---|
28 | } |
---|
29 | |
---|
30 | inline ostream& iendl(ostream& o) |
---|
31 | { |
---|
32 | o<<'\n' ; |
---|
33 | int mem=o.width(o.iword(iostreamIndexIndent)*2) ; |
---|
34 | o<<""; |
---|
35 | o.width(mem) ; |
---|
36 | return o ; |
---|
37 | } |
---|
38 | |
---|
39 | inline ostream& inc_endl(ostream& o) |
---|
40 | { |
---|
41 | return o<<IncIndent<<iendl ; |
---|
42 | } |
---|
43 | |
---|
44 | inline ostream& dec_endl(ostream& o) |
---|
45 | { |
---|
46 | return o<<DecIndent<<iendl ; |
---|
47 | } |
---|
48 | |
---|
49 | |
---|
50 | #endif |
---|
51 | |
---|
52 | |
---|
53 | |
---|
54 | |
---|
Note: See
TracBrowser
for help on using the repository browser.