2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
15 \brief Format inline non-template implementation */
21 #define prefix_ inline
22 //-/////////////////////////////////////////////////////////////////////////////////////////////////
24 //-/////////////////////////////////////////////////////////////////////////////////////////////////
27 prefix_ senf::format::eng::eng(float v, float d)
28 : v_ (v), d_ (d), haveWidth_ (false), width_ (0), havePrecision_ (false), precision_ (0),
29 haveFill_ (false), fill_ (' '), mask_ (), flags_ ()
32 prefix_ senf::format::eng const & senf::format::eng::setw(unsigned w)
40 prefix_ senf::format::eng const & senf::format::eng::setprecision(unsigned p)
43 havePrecision_ = true;
48 prefix_ senf::format::eng const & senf::format::eng::setfill(char c)
56 prefix_ senf::format::eng const & senf::format::eng::showbase()
59 mask_ |= std::ios_base::showbase;
60 flags_ |= std::ios_base::showbase;
64 prefix_ senf::format::eng const & senf::format::eng::noshowbase()
67 mask_ |= std::ios_base::showbase;
68 flags_ &= ~std::ios_base::showbase;
72 prefix_ senf::format::eng const & senf::format::eng::showpos()
75 mask_ |= std::ios_base::showpos;
76 flags_ |= std::ios_base::showpos;
80 prefix_ senf::format::eng const & senf::format::eng::noshowpos()
83 mask_ |= std::ios_base::showpos;
84 flags_ &= ~std::ios_base::showpos;
88 prefix_ senf::format::eng const & senf::format::eng::showpoint()
91 mask_ |= std::ios_base::showpoint;
92 flags_ |= std::ios_base::showpoint;
96 prefix_ senf::format::eng const & senf::format::eng::noshowpoint()
99 mask_ |= std::ios_base::showpoint;
100 flags_ &= ~std::ios_base::showpoint;
104 prefix_ senf::format::eng const & senf::format::eng::uppercase()
107 mask_ |= std::ios_base::uppercase;
108 flags_ |= std::ios_base::uppercase;
112 prefix_ senf::format::eng const & senf::format::eng::nouppercase()
115 mask_ |= std::ios_base::uppercase;
116 flags_ &= ~std::ios_base::uppercase;
120 prefix_ senf::format::eng const & senf::format::eng::left()
123 mask_ |= std::ios_base::adjustfield;
124 flags_ &= ~std::ios_base::adjustfield;
125 flags_ |= std::ios_base::left;
129 prefix_ senf::format::eng const & senf::format::eng::internal()
132 mask_ |= std::ios_base::adjustfield;
133 flags_ &= ~std::ios_base::adjustfield;
134 flags_ |= std::ios_base::internal;
138 prefix_ senf::format::eng const & senf::format::eng::right()
141 mask_ |= std::ios_base::adjustfield;
142 flags_ &= ~std::ios_base::adjustfield;
143 flags_ |= std::ios_base::right;
147 //-/////////////////////////////////////////////////////////////////////////////////////////////////
148 // senf::format::IndentHelper
150 prefix_ senf::format::IndentHelper::IndentHelper()
156 prefix_ senf::format::IndentHelper::~IndentHelper()
158 static_level -= instance_level;
161 prefix_ void senf::format::IndentHelper::increase()
167 prefix_ unsigned int senf::format::IndentHelper::level()
173 prefix_ std::ostream & senf::format::operator<<(std::ostream & os, senf::format::IndentHelper const & indent)
175 for (unsigned int i=0, j=indent.level(); i<j; ++i)
180 //-/////////////////////////////////////////////////////////////////////////////////////////////////
187 // comment-column: 40
188 // c-file-style: "senf"
189 // indent-tabs-mode: nil
190 // ispell-local-dictionary: "american"
191 // compile-command: "scons -u test"