]> git.lyx.org Git - lyx.git/blob - src/support/lyxmanip.h
If I ever see another licence blurb again, it'll be too soon...
[lyx.git] / src / support / lyxmanip.h
1 // -*- C++ -*-
2 /**
3  * \file lyxmanip.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars Gullik Bjønnes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef LYX_MANIP_H
13 #define LYX_MANIP_H
14
15 #include "support/LOstream.h"
16
17 ///
18 struct NewLineAndDepth_ {
19         int depth_;
20 };
21
22 ///
23 inline
24 NewLineAndDepth_ newlineAndDepth(int n)
25 {
26         NewLineAndDepth_ nlad_;
27         nlad_.depth_ = n;
28         return nlad_;
29 }
30
31 ///
32 inline
33 std::ostream & operator<<(std::ostream & os, NewLineAndDepth_ const & nlad_)
34 {
35         os << string(nlad_.depth_, ' ');
36         return os;
37 }
38
39 #endif