X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsupport%2Flyxmanip.h;h=b2d08611536985bfe2265b1eec6a9c8ce24d24ca;hb=2515a3bded01e27dcc3b19502e649f01fff5ace0;hp=9b1bdcd3373d5cb7be5ee13f2ed2d5a4b3df4d49;hpb=def72111a5ac739cf8c5377a67adeee64c37e1ab;p=lyx.git diff --git a/src/support/lyxmanip.h b/src/support/lyxmanip.h index 9b1bdcd337..b2d0861153 100644 --- a/src/support/lyxmanip.h +++ b/src/support/lyxmanip.h @@ -1,20 +1,45 @@ // -*- C++ -*- +/** + * \file lyxmanip.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. + * + * \author Lars Gullik Bjønnes + * + * Full author contact details are available in file CREDITS. + */ + #ifndef LYX_MANIP_H #define LYX_MANIP_H -#include +#include "support/std_ostream.h" + + +namespace lyx { + +/// +struct NewLineAndDepth_ { + int depth_; +}; /// inline -ostream & newlineAndDepth_helper(ostream & s, int n) +NewLineAndDepth_ newlineAndDepth(int n) { - return s << '\n' << string(n, ' '); + NewLineAndDepth_ nlad_; + nlad_.depth_ = n; + return nlad_; } + /// inline -omanip newlineAndDepth(int n) +std::ostream & operator<<(std::ostream & os, NewLineAndDepth_ const & nlad_) { - return omanip(newlineAndDepth_helper, n); + os << std::string(nlad_.depth_, ' '); + return os; } + +} // namespace lyx + #endif