home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / sctextstream.h < prev    next >
Encoding:
C/C++ Source or Header  |  2009-05-17  |  1.2 KB  |  52 lines

  1. //
  2. // C++ Interface: sclocale
  3. //
  4. // Description: 
  5. //
  6. //
  7. // Author: Pierre Marchand <pierremarc@oep-h.com>, (C) 2009
  8. //
  9. // Copyright: See COPYING file that comes with this distribution
  10. //
  11. //
  12.  
  13. #ifndef SCTEXTSTREAM_H
  14. #define SCTEXTSTREAM_H
  15.  
  16. #include <QString>
  17. #include <QTextStream>
  18.  
  19. #include "scribusapi.h"
  20.  
  21. /**
  22.     This class fixes a bug in QTextStream up to version Qt 4.4: using locale-aware strtod() for parsing double/float arguments
  23.  */
  24. class SCRIBUS_API ScTextStream
  25. {
  26. private:
  27.     QTextStream qts;
  28.  
  29. public:
  30.     ScTextStream() : qts() {}
  31.     ScTextStream(QIODevice* device) : qts(device) {}
  32.     ScTextStream(QString * string, QIODevice::OpenMode openMode = QIODevice::ReadWrite) : qts(string, openMode) {}
  33.     ScTextStream(QByteArray * array, QIODevice::OpenMode openMode = QIODevice::ReadWrite ) : qts(array, openMode) {}
  34.  
  35.     ScTextStream & operator<< ( const QString & val );
  36.     ScTextStream & operator<< ( double val );
  37.  
  38.     ScTextStream & operator>> ( QString & val );
  39.     ScTextStream & operator>> ( double & val );
  40.     ScTextStream & operator>> ( float & val );
  41.     ScTextStream & operator>> ( int & val );
  42.  
  43.     QString readAll ();
  44.     QString readLine ( qint64 maxlen = 0 );
  45.  
  46.     bool atEnd () const;
  47. };
  48.  
  49. #endif // SCTEXTSTREAM_H
  50.  
  51.  
  52.