#include <set>
#include <boost/shared_ptr.hpp>
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
+#include <sstream>
//TODO: Is it reasonable to have undocumented exceptions?
std::string header;
getline (in, header);
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream s;
-#else
- std::ostrstream s;
-#endif
-
s << "[deal.II intermediate format graphics data]";
-
-#ifndef HAVE_STD_STRINGSTREAM
- s << std::ends;
-#endif
Assert (header == s.str(), ExcUnexpectedInput(s.str(),header));
}
std::string header;
getline (in, header);
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream s;
-#else
- std::ostrstream s;
-#endif
-
s << "[written by " << PACKAGE_STRING << "]";
-
-#ifndef HAVE_STD_STRINGSTREAM
- s << std::ends;
-#endif
Assert (header == s.str(), ExcUnexpectedInput(s.str(),header));
}
}
while ((header == "") && in);
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream s;
-#else
- std::ostrstream s;
-#endif
-
s << "[deal.II intermediate Patch<" << dim << ',' << spacedim << ">]";
-
-#ifndef HAVE_STD_STRINGSTREAM
- s << std::ends;
-#endif
Assert (header == s.str(), ExcUnexpectedInput(s.str(),header));
}
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 2000, 2001, 2002, 2003, 2005 by the deal.II authors
+// Copyright (C) 1998, 2000, 2001, 2002, 2003, 2005, 2006 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
#include <string>
#include <cstdlib>
#include <iostream>
-
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
+#include <sstream>
#ifdef HAVE_GLIBC_STACKTRACE
# include <execinfo.h>
// convert the messages printed by
// the exceptions into a
// std::string
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream converter;
-#else
- std::ostrstream converter;
-#endif
converter << "--------------------------------------------------------"
<< std::endl;
converter << "--------------------------------------------------------"
<< std::endl;
-#ifndef HAVE_STD_STRINGSTREAM
- converter << std::ends;
-#endif
description = converter.str();
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
#include <iostream>
#include <iomanip>
#include <fstream>
-
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
+#include <sstream>
// on SunOS 4.x, getrusage is stated in the man pages and exists, but
#ifdef DEALII_MEMORY_DEBUG
static const pid_t id = getpid();
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream statname;
-#else
- std::ostrstream statname;
-#endif
-
statname << "/proc/" << id << "/stat";
-#ifndef HAVE_STD_STRINGSTREAM
- statname << std::ends;
-#endif
+
static long size;
static string dummy;
ifstream stat(statname.str());
#include <cstdlib>
#include <algorithm>
#include <list>
-
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
+#include <sstream>
#ifdef HAVE_STD_NUMERIC_LIMITS
# include <limits>
bool Integer::match (const std::string &test_string) const
{
-#ifdef HAVE_STD_STRINGSTREAM
std::istringstream str(test_string);
-#else
- std::istrstream str(test_string.c_str());
-#endif
int i;
if (str >> i)
// output their values
if (lower_bound <= upper_bound)
{
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream description;
-#else
- std::ostrstream description;
-#endif
description << "[Integer range "
<< lower_bound << "..." << upper_bound
<< " (inclusive)]";
-#ifndef HAVE_STD_STRINGSTREAM
- description << std::ends;
-#endif
return description.str();
}
else
bool Double::match (const std::string &test_string) const
{
-#ifdef HAVE_STD_STRINGSTREAM
std::istringstream str(test_string);
-#else
- std::istrstream str(test_string.c_str());
-#endif
double d;
if (str >> d)
// output their values
if (lower_bound <= upper_bound)
{
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream description;
-#else
- std::ostrstream description;
-#endif
description << "[Floating point range "
<< lower_bound << "..." << upper_bound
<< " (inclusive)]";
-#ifndef HAVE_STD_STRINGSTREAM
- description << std::ends;
-#endif
return description.str();
}
else
std::string List::description () const
{
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream description;
-#else
- std::ostrstream description;
-#endif
description << "list of <" << pattern->description() << ">"
<< " of length " << min_elements << "..." << max_elements
<< " (inclusive)";
-#ifndef HAVE_STD_STRINGSTREAM
- description << std::ends;
-#endif
-
return description.str();
}
ParameterHandler::set (const std::string &entry_string,
const double &new_value)
{
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream s;
-#else
- std::ostrstream s;
-#endif
s << std::setprecision(16);
s << new_value;
-#ifndef HAVE_STD_STRINGSTREAM
- s << std::ends;
-#endif
// hand this off to the function that
// actually sets the value as a string
ParameterHandler::set (const std::string &entry_string,
const long int &new_value)
{
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream s;
-#else
- std::ostrstream s;
-#endif
s << new_value;
-#ifndef HAVE_STD_STRINGSTREAM
- s << std::ends;
-#endif
// hand this off to the function that
// actually sets the value as a string
ParameterHandler::set (const std::string &entry_string,
const bool &new_value)
{
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream s;
-#else
- std::ostrstream s;
-#endif
s << new_value;
-#ifndef HAVE_STD_STRINGSTREAM
- s << std::ends;
-#endif
// hand this off to the function that
// actually sets the value as a string
// $Id$
// Version: $Name$
//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
#include <base/table_handler.h>
#include <base/table.h>
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
-
+#include <sstream>
#include <iostream>
#include <iomanip>
#include <strings.h>
// write it into a dummy
// stream, just to get its
// size upon output
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream dummy_out;
-#else
- std::ostrstream dummy_out;
-#endif
dummy_out << std::setprecision(column.precision);
else
dummy_out.setf (std::ios::fixed, std::ios::floatfield);
column.entries[i]->write_text (dummy_out);
-#ifndef HAVE_STD_STRINGSTREAM
- dummy_out << std::ends;
-#endif
// get size, note that we are
// not interested in the
// trailing \0
-#ifdef HAVE_STD_STRINGSTREAM
entry_widths[i][j] = dummy_out.str().length();
-#else
- entry_widths[i][j] = strlen(dummy_out.str());
-#endif
- };
+ }
// next compute the width each row
// has to have to suit all entries
// $Id$
// Version: $Name$
//
-// Copyright (C) 2005 by the deal.II authors
+// Copyright (C) 2005, 2006 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
#include <cmath>
#include <unistd.h>
#include <sys/types.h>
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
+#include <sstream>
+
#ifdef HAVE_STD_NUMERIC_LIMITS
# include <limits>
#else
int
string_to_int (const std::string &s)
{
-#ifdef HAVE_STD_STRINGSTREAM
std::istringstream ss(s);
-#else
- std::ostrstream ss(s.c_str());
-#endif
#ifdef HAVE_STD_NUMERIC_LIMITS
static const int max_int = std::numeric_limits<int>::max();
const std::string test_string (name.begin()+position,
name.end());
-#ifdef HAVE_STD_STRINGSTREAM
std::istringstream str(test_string);
-#else
- std::istrstream str(test_string.c_str());
-#endif
int i;
if (str >> i)
std::time_t time1= std::time (0);
std::tm *time = std::localtime(&time1);
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream o;
-#else
- std::ostrstream o;
-#endif
o << time->tm_hour << ":"
<< (time->tm_min < 10 ? "0" : "") << time->tm_min << ":"
<< (time->tm_sec < 10 ? "0" : "") << time->tm_sec;
-#ifndef HAVE_STD_STRINGSTREAM
- o << std::ends;
-#endif
+
return o.str();
}
#include <lac/vector_memory.h>
#include <numerics/data_out.h>
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
-
+#include <sstream>
#include <iomanip>
#include <fstream>
out.add_data_vector(r, "residual");
out.add_data_vector(d, "update");
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream filename;
-#else
- std::ostrstream filename;
-#endif
-
filename << basename
<< std::setw(3) << std::setfill('0') << step
<< out.default_suffix();
-#ifndef HAVE_STD_STRINGSTREAM
- filename << std::ends;
-#endif
-
const std::string fname = filename.str();
deallog << "Writing file:" << fname << std::endl;
// $Id$
// Version: $Name$
//
-// Copyright (C) 2002, 2003, 2004, 2005 by the deal.II authors
+// Copyright (C) 2002, 2003, 2004, 2005, 2006 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
#include <fe/fe_dgp.h>
#include <fe/fe_tools.h>
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
+#include <sstream>
template <int dim>
// this function returns, so they
// have to be kept in synch
-#ifdef HAVE_STD_STRINGSTREAM
- std::ostringstream namebuf;
-#else
- std::ostrstream namebuf;
-#endif
-
+ std::ostringstream namebuf;
namebuf << "FE_DGP<" << dim << ">(" << this->degree << ")";
-#ifndef HAVE_STD_STRINGSTREAM
- namebuf << std::ends;
-#endif
return namebuf.str();
}
// $Id$
// Version: $Name$
//
-// Copyright (C) 2004, 2005 by the deal.II authors
+// Copyright (C) 2004, 2005, 2006 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
#include <fe/fe_dgp_monomial.h>
#include <fe/fe_tools.h>
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
+#include <sstream>
// namespace for some functions that are used in this file.
// this function returns, so they
// have to be kept in synch
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream namebuf;
-#else
- std::ostrstream namebuf;
-#endif
-
namebuf << "FE_DGPMonomial<" << dim << ">(" << this->degree << ")";
-#ifndef HAVE_STD_STRINGSTREAM
- namebuf << std::ends;
-#endif
return namebuf.str();
}
#include <fe/fe_dgp_nonparametric.h>
#include <fe/fe_values.h>
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
+#include <sstream>
template <int dim>
// this function returns, so they
// have to be kept in synch
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream namebuf;
-#else
- std::ostrstream namebuf;
-#endif
-
namebuf << "FE_DGPNonparametric<" << dim << ">(" << degree << ")";
-#ifndef HAVE_STD_STRINGSTREAM
- namebuf << std::ends;
-#endif
return namebuf.str();
}
#include <iostream>
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
+#include <sstream>
// this function returns, so they
// have to be kept in synch
-#ifdef HAVE_STD_STRINGSTREAM
- std::ostringstream namebuf;
-#else
- std::ostrstream namebuf;
-#endif
-
+ std::ostringstream namebuf;
namebuf << "FE_DGQ<" << dim << ">(" << this->degree << ")";
-#ifndef HAVE_STD_STRINGSTREAM
- namebuf << std::ends;
-#endif
return namebuf.str();
}
#include <fe/fe_nedelec.h>
#include <fe/fe_values.h>
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
+#include <sstream>
// this function returns, so they
// have to be kept in synch
-#ifdef HAVE_STD_STRINGSTREAM
- std::ostringstream namebuf;
-#else
- std::ostrstream namebuf;
-#endif
-
+ std::ostringstream namebuf;
namebuf << "FE_Nedelec<" << dim << ">(" << degree << ")";
-#ifndef HAVE_STD_STRINGSTREAM
- namebuf << std::ends;
-#endif
return namebuf.str();
}
#include <vector>
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
+#include <sstream>
// namespace for some functions that are used in this file. they are
// this function returns, so they
// have to be kept in synch
-#ifdef HAVE_STD_STRINGSTREAM
- std::ostringstream namebuf;
-#else
- std::ostrstream namebuf;
-#endif
-
+ std::ostringstream namebuf;
namebuf << "FE_Q<" << dim << ">(" << this->degree << ")";
-#ifndef HAVE_STD_STRINGSTREAM
- namebuf << std::ends;
-#endif
return namebuf.str();
}
#include <fe/fe_q_hierarchical.h>
#include <cmath>
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
+#include <sstream>
namespace
// this function returns, so they
// have to be kept in synch
-#ifdef HAVE_STD_STRINGSTREAM
- std::ostringstream namebuf;
-#else
- std::ostrstream namebuf;
-#endif
-
+ std::ostringstream namebuf;
namebuf << "FE_Q_Hierarchical<" << dim << ">(" << this->degree << ")";
-#ifndef HAVE_STD_STRINGSTREAM
- namebuf << std::ends;
-#endif
return namebuf.str();
}
#include <fe/fe_values.h>
#include <fe/fe_tools.h>
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
-
+#include <sstream>
#include <iostream>
-using namespace std;
template <int dim>
// this function returns, so they
// have to be kept in synch
-#ifdef HAVE_STD_STRINGSTREAM
- std::ostringstream namebuf;
-#else
- std::ostrstream namebuf;
-#endif
-
+ std::ostringstream namebuf;
namebuf << "FE_RaviartThomas<" << dim << ">(" << rt_order << ")";
-#ifndef HAVE_STD_STRINGSTREAM
- namebuf << std::ends;
-#endif
return namebuf.str();
}
#include <fe/fe_values.h>
#include <fe/fe_tools.h>
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
+#include <sstream>
template <int dim>
FE_RaviartThomasNodal<dim>::FE_RaviartThomasNodal (const unsigned int deg)
// this function returns, so they
// have to be kept in synch
-#ifdef HAVE_STD_STRINGSTREAM
- std::ostringstream namebuf;
-#else
- std::ostrstream namebuf;
-#endif
-
+ std::ostringstream namebuf;
namebuf << "FE_RaviartThomasNodal<" << dim << ">(" << this->degree-1 << ")";
-#ifndef HAVE_STD_STRINGSTREAM
- namebuf << std::ends;
-#endif
return namebuf.str();
}
#include <fe/mapping.h>
#include <fe/fe_system.h>
#include <fe/fe_values.h>
+
#include <iostream>
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
+#include <sstream>
/* ----------------------- FESystem::InternalData ------------------- */
// this function returns, so they
// have to be kept in synch
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream namebuf;
-#else
- std::ostrstream namebuf;
-#endif
namebuf << "FESystem<" << dim << ">[";
for (unsigned int i=0; i<n_base_elements(); ++i)
}
namebuf << ']';
-#ifndef HAVE_STD_STRINGSTREAM
- namebuf << std::ends;
-#endif
return namebuf.str();
}
// $Id$
// Version: $Name$
//
-// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
#include <boost/shared_ptr.hpp>
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
-
namespace
#include <fe/mapping_q1.h>
#include <fe/select_fe_values.h>
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
+#include <sstream>
names.resize (n_components);
for (unsigned int i=0; i<n_components; ++i)
{
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream namebuf;
-#else
- std::ostrstream namebuf;
-#endif
namebuf << '_' << i;
-#ifndef HAVE_STD_STRINGSTREAM
- namebuf << std::ends;
-#endif
names[i] = name + namebuf.str();
- };
- };
+ }
+ }
add_data_vector (vec, names, type);
}
#include <fe/select_fe_values.h>
#include <fe/mapping_q1.h>
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
+#include <sstream>
+
template <int dim, template <int> class DH>
unsigned int
names.resize (n_components);
for (unsigned int i=0; i<n_components; ++i)
{
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream namebuf;
-#else
- std::ostrstream namebuf;
-#endif
namebuf << '_' << i;
-#ifndef HAVE_STD_STRINGSTREAM
- namebuf << std::ends;
-#endif
names[i] = name + namebuf.str();
}
}
<ol>
+ <li> <p>
+ Removed: Support for gcc2.95 in particular, and all compilers that do
+ not support the <code>std::ostringstream</code> class in general,
+ has been removed.
+ <br>
+ (WB 2006/02/03)
+ </p>
+
<li> <p>
Changed: Several classes related to the storage of data in the
Triangulation and DoFHandler classes have been moved into internal
developed and tested on Unix or Unix-like systems only. It can be
used positively on
<ul>
- <li>Linux on x86, with gcc 2.95, 3.0, 3.1/3.2, 3.3, 3.4, and 4.0; and
+ <li>Linux on x86, with gcc 3.0, 3.1/3.2, 3.3, 3.4, and 4.0; and
Intel ICC 6.0, 7.0, 7.1, 8.0, and 8.1;
<li>Linux on x86_64 (Opterons, AMD64, and Intel EM64T chips) using gcc
3.3, 3.4, and 4.0;
- <li>Sun Solaris 2.5, 2.6, 7, 8, and 9 on Sparc, with gcc 2.95,
+ <li>Sun Solaris 2.5, 2.6, 7, 8, and 9 on Sparc, with
gcc 3.0, and gcc 3.1/3.2;
<li>Sun Solaris 9 on Sparc in 64bit mode, with gcc 3.1.1/3.2;
- <li>Sun Solaris 8 on x86, with gcc 2.95;
- <li>FreeBSD 4.5 on x86, with gcc 2.95;
+ <li>FreeBSD 4.5 on x86, with gcc newer than 2.95;
<li>IBM AIX 5.1 on Power4, with gcc 3.2 and gcc 3.3;
- <li>IBM AIX 4.2, with gcc 2.95 (with some restrictions on
+ <li>IBM AIX 4.2, with gcc newer than 2.95 (with some restrictions on
the use of shared libraries);
<li>SGI IRIX64, with MIPSpro 7.41;
<li>Linux on IA-64 (Itanium), using gcc 3.4.2 and ICC 8.1;
- <li>Linux on HP/Compaq Alpha with gcc 2.95 (courtesy of
+ <li>Linux on HP/Compaq Alpha with gcc newer than 2.95 (courtesy of
<a href="http://testdrive.hp.com">testdrive.hp.com</a>);
<li>Linux on HPPA PA-RISC with gcc 3.0 (with some restrictions on
the use of shared libraries; courtesy of
our experiences on separate pages:
<ul>
<li> <a href="platforms/sgi-irix.html" target="body">SGI
- IRIX64</a> with gcc 2.95.x, 3.2, 3.3 and 3.4, and with MIPSpro 7.41;
+ IRIX64</a> with gcc 3.2, 3.3 and 3.4, and with MIPSpro 7.41;
<li> <a href="platforms/dec-osf5.html" target="body">OSF1 V5.3 on
- Alpha</a> with gcc 2.95.x (the same notes probably also apply
- to Linux on DEC Alpha) and using DEC's cxx compiler version
+ Alpha</a> with gcc newer than 2.95.x (the same notes probably also
+ apply to Linux on DEC Alpha) and using DEC's cxx compiler version
6.3; for older systems with OSF1 4.0 and cxx6.0 please see
<a href="platforms/dec-osf.html" target="body">this page</a>.
<ul>
<li> <p>
A fairly complete C++ compiler. We usually use
- <a href="http://gcc.gnu.org" target="_top">gcc2.95 or
- gcc3.x</a> but also some others. Various working compilers
+ <a href="http://gcc.gnu.org" target="_top">gcc3.x</a> but also some
+ others. Various working compilers
are listed above. egcs1.x and older gcc versions will not
work, however. For gcc 2.96, see the <a href="faq.html#gcc296"
target="body">Frequently Asked Questions</a>. Also, Sun
/* $Id$ */
/* Version: $Name$ */
/* */
-/* Copyright (C) 2001, 2002, 2003, 2004 by the deal.II authors */
+/* Copyright (C) 2001, 2002, 2003, 2004, 2006 by the deal.II authors */
/* */
/* This file is subject to QPL and may not be distributed */
/* without copyright and license information. Please refer */
#include <iostream>
#include <fstream>
#include <list>
-
- // Just as in the step-5 example
- // program (see there for a lengthy
- // discussion of the subject), we
- // have to work around some
- // historical confusion with the
- // files declaring the stringstream
- // classes:
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
+#include <sstream>
// @sect3{Evaluation of the solution}
// value of the format descriptor
// passed as second argument.
//
- // The somewhat complicated use of
- // the stringstream class,
- // involving support from the
- // preprocessor, is as already
- // explained in the step-5 example
- // program.
- //
// Also note that we have to prefix
// ``this->'' to access a member
// variable of the template
data_out.add_data_vector (solution, "solution");
data_out.build_patches ();
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream filename;
-#else
- std::ostrstream filename;
-#endif
filename << output_name_base << "-"
<< this->refinement_cycle
<< data_out.default_suffix (output_format)
<< std::ends;
-#ifdef HAVE_STD_STRINGSTREAM
std::ofstream out (filename.str().c_str());
-#else
- std::ofstream out (filename.str());
-#endif
data_out.write (out, output_format);
}
/* $Id$ */
/* Version: $Name$ */
/* */
-/* Copyright (C) 2002, 2003, 2004, 2005 by the deal.II authors */
+/* Copyright (C) 2002, 2003, 2004, 2005, 2006 by the deal.II authors */
/* */
/* This file is subject to QPL and may not be distributed */
/* without copyright and license information. Please refer */
#include <list>
#include <algorithm>
#include <numeric>
-
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
+#include <sstream>
// @sect3{Evaluating the solution}
GridOutput<dim>::operator () (const DoFHandler<dim> &dof_handler,
const Vector<double> &/*solution*/) const
{
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream filename;
-#else
- std::ostrstream filename;
-#endif
filename << output_name_base << "-"
<< this->refinement_cycle
<< ".eps"
<< std::ends;
-#ifdef HAVE_STD_STRINGSTREAM
- std::ofstream out (filename.str().c_str());
-#else
- std::ofstream out (filename.str());
-#endif
+ std::ofstream out (filename.str().c_str());
GridOut().write_eps (dof_handler.get_tria(), out);
}
}
data_out.add_data_vector (this->solution, "solution");
data_out.build_patches ();
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream filename;
-#else
- std::ostrstream filename;
-#endif
filename << "solution-"
<< this->refinement_cycle
<< ".gnuplot"
<< std::ends;
-#ifdef HAVE_STD_STRINGSTREAM
- std::ofstream out (filename.str().c_str());
-#else
- std::ofstream out (filename.str());
-#endif
+ std::ofstream out (filename.str().c_str());
data_out.write (out, DataOut<dim>::gnuplot);
}
data_out.build_patches ();
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream filename;
-#else
- std::ostrstream filename;
-#endif
filename << "solution-"
<< this->refinement_cycle
<< ".gnuplot"
<< std::ends;
-#ifdef HAVE_STD_STRINGSTREAM
- std::ofstream out (filename.str().c_str());
-#else
- std::ofstream out (filename.str());
-#endif
+ std::ofstream out (filename.str().c_str());
data_out.write (out, DataOut<dim>::gnuplot);
}
/* $Id$ */
/* Version: $Name$ */
/* */
-/* Copyright (C) 2002, 2003, 2004 by the deal.II authors */
+/* Copyright (C) 2002, 2003, 2004, 2006 by the deal.II authors */
/* */
/* This file is subject to QPL and may not be distributed */
/* without copyright and license information. Please refer */
// header files:
#include <fstream>
#include <iostream>
-
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
+#include <sstream>
// The first thing we have here is a helper
data_out.add_data_vector (present_solution, "solution");
data_out.build_patches ();
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream filename;
-#else
- std::ostrstream filename;
-#endif
filename << "solution-"
<< run_number
<< ".gnuplot"
<< std::ends;
-#ifdef HAVE_STD_STRINGSTREAM
- std::ofstream out (filename.str().c_str());
-#else
- std::ofstream out (filename.str());
-#endif
+ std::ofstream out (filename.str().c_str());
data_out.write_gnuplot (out);
}
/* $Id$ */
/* Version: $Name$ */
/* */
-/* Copyright (C) 2003, 2004, 2005 by the deal.II authors */
+/* Copyright (C) 2003, 2004, 2005, 2006 by the deal.II authors */
/* */
/* This file is subject to QPL and may not be distributed */
/* without copyright and license information. Please refer */
#include <multigrid/mg_smoother.h>
#include <multigrid/mg_matrix.h>
- // This is C++ ... see step 5 for
- // further comments.
+ // This is C++:
#include <fstream>
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
+#include <sstream>
// This class is based on the same
// The following block generates
// the file name and opens the
- // file. This looks awkward because
- // of a change in the handling of
- // string streams (See step 5 for explanation).
-
-#ifdef HAVE_STD_STRINGSTREAM
+ // file:
std::ostringstream filename;
-#else
- std::ostrstream filename;
-#endif
filename << "solution-"
<< cycle
<< ".gnuplot";
-#ifndef HAVE_STD_STRINGSTREAM
- filename << std::ends;
-#endif
-
-#ifdef HAVE_STD_STRINGSTREAM
std::ofstream output (filename.str().c_str());
-#else
- std::ofstream output (filename.str());
-#endif
-
data_out.write_gnuplot (output);
}
/* $Id$ */
/* Version: $Name$ */
/* */
-/* Copyright (C) 2000, 2004, 2005 by the deal.II authors */
+/* Copyright (C) 2000, 2004, 2005, 2006 by the deal.II authors */
/* */
/* This file is subject to QPL and may not be distributed */
/* without copyright and license information. Please refer */
// And this is simply C++ again:
#include <fstream>
#include <iostream>
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
+#include <sstream>
// Now, here comes the declaration of the
// with setting up the output file as in
// step-8, and attaching the (localized)
// solution vector to the output
- // object. (The code to generate the output
+ // object:. (The code to generate the output
// file name is stolen and slightly
// modified from step-5, since we expect
// that we can do a number of cycles
// what the code in step-8 could handle.)
if (this_mpi_process == 0)
{
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream filename;
filename << "solution-" << cycle << ".gmv";
+
std::ofstream output (filename.str().c_str());
-#else
- std::ostrstream filename;
- filename << "solution-" << cycle << ".gmv";
- std::ofstream output (filename.str());
-#endif
DataOut<dim> data_out;
data_out.attach_dof_handler (dof_handler);
/* $Id$ */
/* Version: $Name$ */
/* */
-/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 by the deal.II authors */
+/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2006 by the deal.II authors */
/* */
/* This file is subject to QPL and may not be distributed */
/* without copyright and license information. Please refer */
// ... and this is too: We will
// convert integers to strings using
// the C++ stringstream class
- // ``ostringstream''. One annoying
- // complication arises here in that
- // the classes ``std::istringstream''
- // and ``std::ostringstream'' (with
- // these names) have not been part of
- // standard libraries of C++
- // compilers for long. They have only
- // been part of C++ compilers since
- // around the time the C++ standard
- // was made in 1999. For example, the
- // gcc compiler up to and including
- // version 2.95.2 did not have them,
- // but instead provided classes
- // ``istrstream'' and ``ostrstream''
- // with a similar, but nevertheless
- // slightly different
- // interface. Furthermore, they were
- // declared in the include file
- // ``<strstream>'', while the new
- // standards conforming classes are
- // declared in ``<sstream>''. Many
- // other compilers followed the gcc
- // scheme, so whenever we want to
- // support versions of compilers that
- // appeared before approximately
- // 2000/2001, we have to support
- // these old classes.
- //
- // Since we do want to support these
- // compilers, the ``./configure''
- // script you run as the very first
- // step of installing the library
- // determines whether the compiler
- // you want to use supports the new
- // classes, or whether we have to
- // fall back on the old ones. If the
- // new classes are supported, then
- // the preprocessor variable
- // ``HAVE_STD_STRINGSTREAM'' is set
- // in the ``base/config.h'' include
- // file, that all include files in
- // the library also include. Since we
- // have included quite a number of
- // files from the library at this
- // point, the definition or
- // non-definition of this
- // preprocessor variable can now be
- // used to decide whether old or new
- // header names have to be used to
- // import string stream classes:
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
+ // ``ostringstream'':
+#include <sstream>
// @sect3{The ``LaplaceProblem'' class template}
// strings, and one could as well
// use stream modifiers such as
// ``setw'', ``setprecision'', and
- // so on.
- //
- // In C++, you can do this by using
- // the so-called stringstream
- // classes. As already discussed at
- // the point of inclusion of the
- // respective header file above,
- // there is some historical
- // confusion we have to work around
- // here, since the class we'd like
- // to use used to be called
- // ``ostrstream'', but now is named
- // ``ostringstream''. In the same
- // way as done above in deciding
- // which file to include, we here
- // decide which class name to use:
-#ifdef HAVE_STD_STRINGSTREAM
+ // so on. In C++, you can do this
+ // by using the so-called stringstream
+ // classes:
std::ostringstream filename;
-#else
- std::ostrstream filename;
-#endif
- // Fortunately, the interface of
- // the two classes which we might
- // now be using, depending on which
- // one is available, is close
- // enough that we need to take care
- // about the differences only once
- // below, so we can use them in a
- // rather straightforward way, even
- // if they are not identical.
// In order to now actually
// generate a filename, we fill the
filename << "solution-"
<< cycle
<< ".eps";
-
- // For the old string stream
- // classes, we have to append the
- // final '\0' that appears at the
- // end of ``char *''
- // variables. This is done by the
- // following construct:
-#ifndef HAVE_STD_STRINGSTREAM
- filename << std::ends;
-#endif
- // We can get whatever we wrote to
- // the stream using the ``str()''
- // function. If the new
- // stringstream classes are used,
- // then the result is a string
- // which we have to convert to a
- // char* using the ``c_str()''
- // function, otherwise the result
- // is a char* right away. Use that
- // as filename for the output
- // stream and then write the data
- // to the file:
-#ifdef HAVE_STD_STRINGSTREAM
+
+ // We can get whatever we wrote to the
+ // stream using the ``str()'' function. The
+ // result is a string which we have to
+ // convert to a char* using the ``c_str()''
+ // function. Use that as filename for the
+ // output stream and then write the data to
+ // the file:
std::ofstream output (filename.str().c_str());
-#else
- std::ofstream output (filename.str());
-#endif
data_out.write_eps (output);
}
#include <map>
#include <string>
#include <memory>
-
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
+#include <sstream>
template <typename> class BlockVector;
matrix_names.insert(
std::pair<const PointerMatrixBase<Vector<number> >*, std::string> (m->matrix,
std::string("M")));
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream stream;
-#else
- std::ostrstream stream;
-#endif
-
stream << matrix_number++;
-
-#ifndef HAVE_STD_STRINGSTREAM
- stream << std::ends;
-#endif
- x.first->second += stream.str();
+
+ x.first->second += stream.str();
}
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream stream;
-#else
- std::ostrstream stream;
-#endif
+
if (array(m->row, m->col) != "" && m->prefix >= 0)
stream << "+";
if (m->prefix != 1.)
if (m->transpose)
stream << "^T";
-#ifndef HAVE_STD_STRINGSTREAM
- stream << std::ends;
-#endif
array(m->row, m->col) += stream.str();
}
for (unsigned int i=0;i<n_block_rows();++i)
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 by the deal.II authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
#include <lac/solver_control.h>
#include <cmath>
-
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
+#include <sstream>
/*----------------------- SolverControl ---------------------------------*/
static std::string description;
// convert the messages printed by the
// exceptions into a std::string
-#ifdef HAVE_STD_STRINGSTREAM
std::ostringstream out;
-#else
- std::ostrstream out;
-#endif
-
out << "Iterative method reported convergence failure in step "
<< last_step << " with residual " << last_residual;
-#ifndef HAVE_STD_STRINGSTREAM
- out << std::ends;
-#endif
description = out.str();
return description.c_str();
// $Id$
-// Copyright (C) 2005 by the deal.II authors
+// Copyright (C) 2005, 2006 by the deal.II authors
//
// Computes measure, center and barycenter on a variety of cells
#include <grid/grid_generator.h>
#include <fstream>
-
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-# define SSTREAM std::ostringstream
-# define ENDSTRING
-#else
-# include <strstream>
-# define SSTREAM std::ostrstream
-# define ENDSTRING << std::ends
-#endif
-
#define PRECISION 5
char fname[50];
// mapping.cc,v 1.19 2004/01/30 09:56:19 hartmann Exp
-// Copyright (C) 2001, 2002, 2003, 2004, 2005 Ralf Hartmann
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Ralf Hartmann
//
// Shows the shape functions implemented and computes the area of cells.
#include <fstream>
#include <string>
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-# define SSTREAM std::ostringstream
-# define ENDSTRING
-#else
-# include <strstream>
-# define SSTREAM std::ostrstream
-# define ENDSTRING << std::ends
-#endif
+#include <sstream>
#define PRECISION 2
{
if (true)
{
- SSTREAM ost;
+ std::ostringstream ost;
ost << "Mapping" << dim << "d-" << i << '-'
- << mapping_strings[j] ENDSTRING;
+ << mapping_strings[j];
deallog << ost.str() << std::endl;
plot_transformation(*mapping_ptr[j], fe_q4, cell, ost.str());
compute_area(*mapping_ptr[j], fe_q4, cell);
if (dim>1)
{
- SSTREAM ost;
+ std::ostringstream ost;
ost << "MappingFace" << dim << "d-" << i << '-'
- << mapping_strings[j] ENDSTRING;
+ << mapping_strings[j];
deallog << ost.str() << std::endl;
plot_faces(*mapping_ptr[j], fe_q4, cell, ost.str());
}
if (dim>1)
{
- SSTREAM ost;
+ std::ostringstream ost;
ost << "MappingSubface" << dim << "d-" << i << '-'
- << mapping_strings[j] ENDSTRING;
+ << mapping_strings[j];
deallog << ost.str() << std::endl;
plot_subfaces(*mapping_ptr[j], fe_q4, cell, ost.str());
}
#include <fstream>
#include <string>
-#ifdef HAVE_STD_STRINGSTREAM
-# include <sstream>
-#else
-# include <strstream>
-#endif
template <int dim>
void performance (Triangulation<dim>& tr,