4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
6 // The contents of this file are subject to the Fraunhofer FOKUS Public License
7 // Version 1.0 (the "License"); you may not use this file except in compliance
8 // with the License. You may obtain a copy of the License at
9 // http://senf.berlios.de/license.html
11 // The Fraunhofer FOKUS Public License Version 1.0 is based on,
12 // but modifies the Mozilla Public License Version 1.1.
13 // See the full license text for the amendments.
15 // Software distributed under the License is distributed on an "AS IS" basis,
16 // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
17 // for the specific language governing rights and limitations under the License.
19 // The Original Code is Fraunhofer FOKUS code.
21 // The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V.
22 // (registered association), Hansastraße 27 c, 80686 Munich, Germany.
23 // All Rights Reserved.
26 // Stefan Bund <g0dil@berlios.de>
29 \brief Format inline non-template implementation */
35 #define prefix_ inline
36 //-/////////////////////////////////////////////////////////////////////////////////////////////////
38 //-/////////////////////////////////////////////////////////////////////////////////////////////////
41 prefix_ senf::format::eng::eng(float v, float d)
42 : v_ (v), d_ (d), haveWidth_ (false), width_ (0), havePrecision_ (false), precision_ (0),
43 haveFill_ (false), fill_ (' '), mask_ (), flags_ ()
46 prefix_ senf::format::eng const & senf::format::eng::setw(unsigned w)
54 prefix_ senf::format::eng const & senf::format::eng::setprecision(unsigned p)
57 havePrecision_ = true;
62 prefix_ senf::format::eng const & senf::format::eng::setfill(char c)
70 prefix_ senf::format::eng const & senf::format::eng::showbase()
73 mask_ |= std::ios_base::showbase;
74 flags_ |= std::ios_base::showbase;
78 prefix_ senf::format::eng const & senf::format::eng::noshowbase()
81 mask_ |= std::ios_base::showbase;
82 flags_ &= ~std::ios_base::showbase;
86 prefix_ senf::format::eng const & senf::format::eng::showpos()
89 mask_ |= std::ios_base::showpos;
90 flags_ |= std::ios_base::showpos;
94 prefix_ senf::format::eng const & senf::format::eng::noshowpos()
97 mask_ |= std::ios_base::showpos;
98 flags_ &= ~std::ios_base::showpos;
102 prefix_ senf::format::eng const & senf::format::eng::showpoint()
105 mask_ |= std::ios_base::showpoint;
106 flags_ |= std::ios_base::showpoint;
110 prefix_ senf::format::eng const & senf::format::eng::noshowpoint()
113 mask_ |= std::ios_base::showpoint;
114 flags_ &= ~std::ios_base::showpoint;
118 prefix_ senf::format::eng const & senf::format::eng::uppercase()
121 mask_ |= std::ios_base::uppercase;
122 flags_ |= std::ios_base::uppercase;
126 prefix_ senf::format::eng const & senf::format::eng::nouppercase()
129 mask_ |= std::ios_base::uppercase;
130 flags_ &= ~std::ios_base::uppercase;
134 prefix_ senf::format::eng const & senf::format::eng::left()
137 mask_ |= std::ios_base::adjustfield;
138 flags_ &= ~std::ios_base::adjustfield;
139 flags_ |= std::ios_base::left;
143 prefix_ senf::format::eng const & senf::format::eng::internal()
146 mask_ |= std::ios_base::adjustfield;
147 flags_ &= ~std::ios_base::adjustfield;
148 flags_ |= std::ios_base::internal;
152 prefix_ senf::format::eng const & senf::format::eng::right()
155 mask_ |= std::ios_base::adjustfield;
156 flags_ &= ~std::ios_base::adjustfield;
157 flags_ |= std::ios_base::right;
161 //-/////////////////////////////////////////////////////////////////////////////////////////////////
162 // senf::format::IndentHelper
164 prefix_ senf::format::IndentHelper::IndentHelper()
170 prefix_ senf::format::IndentHelper::~IndentHelper()
172 static_level -= instance_level;
175 prefix_ void senf::format::IndentHelper::increase()
181 prefix_ unsigned int senf::format::IndentHelper::level()
187 prefix_ std::ostream & senf::format::operator<<(std::ostream & os, senf::format::IndentHelper const & indent)
189 for (unsigned int i=0, j=indent.level(); i<j; ++i)
199 //-/////////////////////////////////////////////////////////////////////////////////////////////////
206 // comment-column: 40
207 // c-file-style: "senf"
208 // indent-tabs-mode: nil
209 // ispell-local-dictionary: "american"
210 // compile-command: "scons -u test"