1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 //---------------------------------------------------------------------------
41 //---------------------------------------------------------------------------
46 #include "OSGConfig.h"
48 #include "OSGStatStringElem.h"
50 #include <boost/format.hpp>
55 /***************************************************************************\
57 \***************************************************************************/
59 /*! \class OSG::StatStringElem
61 The StatIntElem keeps a std::string for messages, states or status
62 information, see \ref PageSystemStatistics for details.
65 /***************************************************************************\
67 \***************************************************************************/
69 /*------------- constructors & destructors --------------------------------*/
71 StatStringElem::StatStringElem(StatElemDescBase
*desc
) :
77 StatElem
*StatStringElem::create(StatElemDescBase
*desc
)
79 return new StatStringElem(desc
);
82 StatStringElem::~StatStringElem(void)
86 /*------------------------------ access -----------------------------------*/
88 void StatStringElem::putToString(
89 std::string
&str
, const std::string
&format
) const
97 boost::format
fmt(format
);
105 bool StatStringElem::getFromCString(const Char8
*&inVal
)
115 Real64
StatStringElem::getValue(void) const
120 void StatStringElem::reset(void)
126 /*-------------------------- assignment -----------------------------------*/
128 StatStringElem
& StatStringElem::operator = (const StatStringElem
&source
)
138 /*-------------------------- comparison -----------------------------------*/
140 bool StatStringElem::operator < (const StatStringElem
&other
) const
142 return this < &other
;
145 /*--------------------------- creation ------------------------------------*/
147 StatElem
*StatStringElem::clone(void) const
149 StatStringElem
*e
= new StatStringElem(getDesc());
156 /*--------------------------- operators ------------------------------------*/
158 StatElem
&StatStringElem::operator += (const StatElem
&other
)
160 const StatStringElem
*o
= dynamic_cast<const StatStringElem
*>(&other
);
162 _value
+= " " + o
->_value
;