// qtextstream.sip generated by MetaSIP on Fri Feb 10 10:35:12 2012
//
// This file is part of the QtCore Python extension module.
//
// Copyright (c) 2011 Riverbank Computing Limited <info@riverbankcomputing.com>
// 
// This file is part of PyQt.
// 
// This file may be used under the terms of the GNU General Public
// License versions 2.0 or 3.0 as published by the Free Software
// Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
// included in the packaging of this file.  Alternatively you may (at
// your option) use any later version of the GNU General Public
// License if such license has been publicly approved by Riverbank
// Computing Limited (or its successors, if any) and the KDE Free Qt
// Foundation. In addition, as a special exception, Riverbank gives you
// certain additional rights. These rights are described in the Riverbank
// GPL Exception version 1.1, which can be found in the file
// GPL_EXCEPTION.txt in this package.
// 
// If you are unsure which license is appropriate for your use, please
// contact the sales department at sales@riverbankcomputing.com.
// 
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.


%ModuleCode
#include <qtextstream.h>
%End

class QTextStream
{
%TypeHeaderCode
#include <qtextstream.h>
%End

public:
    enum RealNumberNotation
    {
        SmartNotation,
        FixedNotation,
        ScientificNotation,
    };

    enum FieldAlignment
    {
        AlignLeft,
        AlignRight,
        AlignCenter,
        AlignAccountingStyle,
    };

    enum NumberFlag
    {
        ShowBase,
        ForcePoint,
        ForceSign,
        UppercaseBase,
        UppercaseDigits,
    };

    enum Status
    {
        Ok,
        ReadPastEnd,
        ReadCorruptData,
%If (Qt_4_8_0 -)
        WriteFailed,
%End
    };

    typedef QFlags<QTextStream::NumberFlag> NumberFlags;
    QTextStream();
    explicit QTextStream(QIODevice *device);
    QTextStream(QString *string /Constrained/, QFlags<QIODevice::OpenModeFlag> mode = QIODevice::ReadWrite) /API=QString: - 2/;
    QTextStream(QByteArray *array /Constrained/, QFlags<QIODevice::OpenModeFlag> mode = QIODevice::ReadWrite);
    virtual ~QTextStream();
    void setCodec(QTextCodec *codec /KeepReference/);
    void setCodec(const char *codecName);
    QTextCodec *codec() const;
    void setAutoDetectUnicode(bool enabled);
    bool autoDetectUnicode() const;
    void setGenerateByteOrderMark(bool generate);
    bool generateByteOrderMark() const;
    void setDevice(QIODevice *device);
    QIODevice *device() const;
    void setString(QString *string /Constrained/, QFlags<QIODevice::OpenModeFlag> mode = QIODevice::ReadWrite) /API=QString: - 2/;
    QString *string() const /API=QString: - 2/;
    bool atEnd() const;
    void reset();
    void flush() /ReleaseGIL/;
    bool seek(qint64 pos);
    void skipWhiteSpace();
    QString read(qint64 maxlen) /ReleaseGIL/;
    QString readLine(qint64 maxLength = 0) /ReleaseGIL/;
    QString readAll() /ReleaseGIL/;
    void setFieldAlignment(QTextStream::FieldAlignment alignment);
    QTextStream::FieldAlignment fieldAlignment() const;
    void setPadChar(QChar ch);
    QChar padChar() const;
    void setFieldWidth(int width);
    int fieldWidth() const;
    void setNumberFlags(QFlags<QTextStream::NumberFlag> flags);
    QFlags<QTextStream::NumberFlag> numberFlags() const;
    void setIntegerBase(int base);
    int integerBase() const;
    void setRealNumberNotation(QTextStream::RealNumberNotation notation);
    QTextStream::RealNumberNotation realNumberNotation() const;
    void setRealNumberPrecision(int precision);
    int realNumberPrecision() const;
    QTextStream::Status status() const;
    void setStatus(QTextStream::Status status);
    void resetStatus();
%If (Qt_4_2_0 -)
    qint64 pos() const;
%End
    QTextStream &operator>>(QChar &ch /Constrained/) /API=QString: - 2/;
    QTextStream &operator>>(QString &s /Constrained/) /API=QString: - 2/;
    QTextStream &operator>>(QByteArray &array /Constrained/);
    QTextStream &operator<<(double f /Constrained/);
    QTextStream &operator<<(bool b /Constrained/) [QTextStream & (QBool b)];
    QTextStream &operator<<(int i /Constrained/);
    QTextStream &operator<<(qlonglong i);
    QTextStream &operator<<(qulonglong i);
    QTextStream &operator<<(const QString &s);
    QTextStream &operator<<(const QByteArray &array);
%If (Qt_4_5_0 -)
    void setLocale(const QLocale &locale);
%End
%If (Qt_4_5_0 -)
    QLocale locale() const;
%End

private:
    QTextStream(const QTextStream &);
};

QFlags<QTextStream::NumberFlag> operator|(QTextStream::NumberFlag f1, QFlags<QTextStream::NumberFlag> f2);
class QTextStreamManipulator;
QTextStream &operator<<(QTextStream &s, QTextStreamManipulator m);
QTextStream &bin(QTextStream &s) /API=QTextStream: - 2/;
QTextStream &bin(QTextStream &s) /API=QTextStream:2 - , PyName=bin_/;
QTextStream &oct(QTextStream &s) /API=QTextStream: - 2/;
QTextStream &oct(QTextStream &s) /API=QTextStream:2 - , PyName=oct_/;
QTextStream &dec(QTextStream &s);
QTextStream &hex(QTextStream &s) /API=QTextStream: - 2/;
QTextStream &hex(QTextStream &s) /API=QTextStream:2 - , PyName=hex_/;
QTextStream &showbase(QTextStream &s);
QTextStream &forcesign(QTextStream &s);
QTextStream &forcepoint(QTextStream &s);
QTextStream &noshowbase(QTextStream &s);
QTextStream &noforcesign(QTextStream &s);
QTextStream &noforcepoint(QTextStream &s);
QTextStream &uppercasebase(QTextStream &s);
QTextStream &uppercasedigits(QTextStream &s);
QTextStream &lowercasebase(QTextStream &s);
QTextStream &lowercasedigits(QTextStream &s);
QTextStream &fixed(QTextStream &s);
QTextStream &scientific(QTextStream &s);
QTextStream &left(QTextStream &s);
QTextStream &right(QTextStream &s);
QTextStream &center(QTextStream &s);
QTextStream &endl(QTextStream &s);
QTextStream &flush(QTextStream &s);
QTextStream &reset(QTextStream &s);
QTextStream &bom(QTextStream &s);
QTextStream &ws(QTextStream &s);
QTextStreamManipulator qSetFieldWidth(int width);
QTextStreamManipulator qSetPadChar(QChar ch);
QTextStreamManipulator qSetRealNumberPrecision(int precision);
