diff options
| author | craig <craig@11d20701-8431-0410-a711-e3c959e3b870> | 2012-01-01 11:40:09 +0000 |
|---|---|---|
| committer | craig <craig@11d20701-8431-0410-a711-e3c959e3b870> | 2012-01-01 11:40:09 +0000 |
| commit | 7ed83b6c6666eb8b6b104c211ae7e52907350372 (patch) | |
| tree | 4430b556abac0ad660a0aacf1887d77f85d8be02 /scribus/sctextstream.h | |
| download | scribus-7ed83b6c6666eb8b6b104c211ae7e52907350372.tar.gz scribus-7ed83b6c6666eb8b6b104c211ae7e52907350372.tar.xz scribus-7ed83b6c6666eb8b6b104c211ae7e52907350372.zip | |
Branch 1.3.5 tree to 1.4.x tree, goodbye 1.3.x
git-svn-id: svn://scribus.net/branches/Version14x/Scribus@17163 11d20701-8431-0410-a711-e3c959e3b870
Diffstat (limited to 'scribus/sctextstream.h')
| -rw-r--r-- | scribus/sctextstream.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/scribus/sctextstream.h b/scribus/sctextstream.h new file mode 100644 index 0000000..b909f24 --- /dev/null +++ b/scribus/sctextstream.h @@ -0,0 +1,51 @@ +// +// C++ Interface: sclocale +// +// Description: +// +// +// Author: Pierre Marchand <pierremarc@oep-h.com>, (C) 2009 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#ifndef SCTEXTSTREAM_H +#define SCTEXTSTREAM_H + +#include <QString> +#include <QTextStream> + +#include "scribusapi.h" + +/** + This class fixes a bug in QTextStream up to version Qt 4.4: using locale-aware strtod() for parsing double/float arguments + */ +class SCRIBUS_API ScTextStream +{ +private: + QTextStream qts; + +public: + ScTextStream() : qts() {} + ScTextStream(QIODevice* device) : qts(device) {} + ScTextStream(QString * string, QIODevice::OpenMode openMode = QIODevice::ReadWrite) : qts(string, openMode) {} + ScTextStream(QByteArray * array, QIODevice::OpenMode openMode = QIODevice::ReadWrite ) : qts(array, openMode) {} + + ScTextStream & operator<< ( const QString & val ); + ScTextStream & operator<< ( double val ); + + ScTextStream & operator>> ( QString & val ); + ScTextStream & operator>> ( double & val ); + ScTextStream & operator>> ( float & val ); + ScTextStream & operator>> ( int & val ); + + QString readAll (); + QString readLine ( qint64 maxlen = 0 ); + + bool atEnd () const; +}; + +#endif // SCTEXTSTREAM_H + + |
