1 //                                               -*- C++ -*-
2 /**
3  *  @brief The class OSS streams out objects
4  *
5  *  Copyright 2005-2021 Airbus-EDF-IMACS-ONERA-Phimeca
6  *
7  *  This library is free software: you can redistribute it and/or modify
8  *  it under the terms of the GNU Lesser General Public License as published by
9  *  the Free Software Foundation, either version 3 of the License, or
10  *  (at your option) any later version.
11  *
12  *  This library is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *  GNU Lesser General Public License for more details.
16  *
17  *  You should have received a copy of the GNU Lesser General Public License
18  *  along with this library.  If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 #include "openturns/OSS.hxx"
22 #include "openturns/PlatformInfo.hxx"
23 
24 BEGIN_NAMESPACE_OPENTURNS
25 
OSS(bool full)26 OSS::OSS(bool full) : oss_(), precision_(PlatformInfo::GetNumericalPrecision()), full_(full) {}
27 
operator std::string() const28 OSS::operator std::string() const
29 {
30   return oss_.str();
31 }
32 
str() const33 std::string OSS::str() const
34 {
35   return oss_.str();
36 }
37 
clear()38 void OSS::clear()
39 {
40   // To clear the content
41   oss_.str("");
42   // To clear the flags
43   oss_.clear();
44 }
45 
46 END_NAMESPACE_OPENTURNS
47