9 #ifndef ThePEG_PersistentOStream_H
10 #define ThePEG_PersistentOStream_H
13 #include "ThePEG/Config/ThePEG.h"
14 #include "ThePEG/Utilities/ClassDescription.h"
15 #include "ThePEG/Utilities/Exception.h"
16 #include "ThePEG/Utilities/Debug.h"
17 #include "PersistentOStream.fh"
18 #include "PersistentOStream.xh"
104 template <
typename T>
114 template <
typename T>
124 template <
typename T>
136 for ( string::const_iterator i = s.begin(); i < s.end(); ++i )
escape(*i);
154 return (*
this) <<
static_cast<char>(c);
161 return (*
this) <<
static_cast<char>(c);
222 if ( isnan(d) || isinf(d) )
224 <<
"Tried to write a NaN or Inf double to a persistent stream."
226 os() << setprecision(18) << d;
235 if ( isnan(f) || isinf(f) )
237 <<
"Tried to write a NaN or Inf float to a persistent stream."
239 os() << setprecision(9) << f;
270 *
this << z.real() << z.imag();
278 template <
typename Container>
281 for (
typename Container::const_iterator it = c.begin();
282 it != c.end() &&
good() ; ++it )
331 operator bool()
const {
return good(); }
344 struct MissingClass:
public Exception {};
348 struct WriteError:
public Exception {};
406 static const char tNo =
'n';
484 void init(
const vector<string> & libs);
566 template <
typename T1,
typename T2>
568 const pair<T1,T2> & p) {
569 return os << p.first << p.second;
575 template <
typename Key,
typename T,
typename Cmp,
typename A>
577 const multimap<Key,T,Cmp,A> & m) {
585 template <
typename Key,
typename T,
typename Cmp,
typename A>
587 const map<Key,T,Cmp,A> & m) {
595 template <
typename Key,
typename Cmp,
typename A>
597 const set<Key,Cmp,A> & s) {
606 template <
typename Key,
typename Cmp,
typename A>
608 const multiset<Key,Cmp,A> & s) {
617 template <
typename T,
typename A>
619 const list<T,A> & l) {
628 template <
typename T,
typename A>
630 const vector<T,A> & v) {
638 template <
typename T,
typename A>
640 const deque<T,A> & d) {