4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Stefan Bund <g0dil@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief Format inline non-template implementation */
30 #define prefix_ inline
31 ///////////////////////////////cci.p///////////////////////////////////////
33 ///////////////////////////////////////////////////////////////////////////
36 prefix_ senf::format::eng::eng(float v, float d)
37 : v_ (v), d_ (d), haveWidth_ (false), width_ (0), havePrecision_ (false), precision_ (0),
38 haveFill_ (false), fill_ (' '), mask_ (), flags_ ()
41 prefix_ senf::format::eng const & senf::format::eng::setw(unsigned w)
49 prefix_ senf::format::eng const & senf::format::eng::setprecision(unsigned p)
52 havePrecision_ = true;
57 prefix_ senf::format::eng const & senf::format::eng::setfill(char c)
65 prefix_ senf::format::eng const & senf::format::eng::showbase()
68 mask_ |= std::ios_base::showbase;
69 flags_ |= std::ios_base::showbase;
73 prefix_ senf::format::eng const & senf::format::eng::noshowbase()
76 mask_ |= std::ios_base::showbase;
77 flags_ &= ~std::ios_base::showbase;
81 prefix_ senf::format::eng const & senf::format::eng::showpos()
84 mask_ |= std::ios_base::showpos;
85 flags_ |= std::ios_base::showpos;
89 prefix_ senf::format::eng const & senf::format::eng::noshowpos()
92 mask_ |= std::ios_base::showpos;
93 flags_ &= ~std::ios_base::showpos;
97 prefix_ senf::format::eng const & senf::format::eng::showpoint()
100 mask_ |= std::ios_base::showpoint;
101 flags_ |= std::ios_base::showpoint;
105 prefix_ senf::format::eng const & senf::format::eng::noshowpoint()
108 mask_ |= std::ios_base::showpoint;
109 flags_ &= ~std::ios_base::showpoint;
113 prefix_ senf::format::eng const & senf::format::eng::uppercase()
116 mask_ |= std::ios_base::uppercase;
117 flags_ |= std::ios_base::uppercase;
121 prefix_ senf::format::eng const & senf::format::eng::nouppercase()
124 mask_ |= std::ios_base::uppercase;
125 flags_ &= ~std::ios_base::uppercase;
129 prefix_ senf::format::eng const & senf::format::eng::left()
132 mask_ |= std::ios_base::adjustfield;
133 flags_ &= ~std::ios_base::adjustfield;
134 flags_ |= std::ios_base::left;
138 prefix_ senf::format::eng const & senf::format::eng::internal()
141 mask_ |= std::ios_base::adjustfield;
142 flags_ &= ~std::ios_base::adjustfield;
143 flags_ |= std::ios_base::internal;
147 prefix_ senf::format::eng const & senf::format::eng::right()
150 mask_ |= std::ios_base::adjustfield;
151 flags_ &= ~std::ios_base::adjustfield;
152 flags_ |= std::ios_base::right;
156 ///////////////////////////////////////////////////////////////////////////
157 // senf::format::IndentHelper
159 prefix_ senf::format::IndentHelper::IndentHelper()
165 prefix_ senf::format::IndentHelper::~IndentHelper()
167 static_level -= instance_level;
170 prefix_ void senf::format::IndentHelper::increase()
176 prefix_ unsigned int senf::format::IndentHelper::level()
182 prefix_ std::ostream & senf::format::operator<<(std::ostream & os, senf::format::IndentHelper const & indent)
184 for (unsigned int i=0, j=indent.level(); i<j; ++i)
194 ///////////////////////////////cci.e///////////////////////////////////////
201 // comment-column: 40
202 // c-file-style: "senf"
203 // indent-tabs-mode: nil
204 // ispell-local-dictionary: "american"
205 // compile-command: "scons -u test"