Eneboo - Documentación para desarrolladores
src/flbase/aqsobjects/AQSTextStream_p.h
Ir a la documentación de este archivo.
00001 /***************************************************************************
00002  AQSTextStream_p.h
00003  -------------------
00004  begin                : 05/04/2011
00005  copyright            : (C) 2003-2011 by InfoSiAL S.L.
00006  email                : mail@infosial.com
00007  ***************************************************************************/
00008 /***************************************************************************
00009  *   This program is free software; you can redistribute it and/or modify  *
00010  *   it under the terms of the GNU General Public License as published by  *
00011  *   the Free Software Foundation; version 2 of the License.               *
00012  ***************************************************************************/
00013 /***************************************************************************
00014  Este  programa es software libre. Puede redistribuirlo y/o modificarlo
00015  bajo  los  términos  de  la  Licencia  Pública General de GNU   en  su
00016  versión 2, publicada  por  la  Free  Software Foundation.
00017  ***************************************************************************/
00018 
00019 #ifndef AQSTEXTSTREAM_P_H_
00020 #define AQSTEXTSTREAM_P_H_
00021 
00022 #include "AQSIODevice_p.h"
00023 #include "AQSByteArray_p.h"
00024 #include "AQSTextCodec_p.h"
00025 #include <qtextstream.h>
00026 
00027 // @AQ_PTR_INDIRECTION@
00028 
00029 class AQSTextStream : public AQSVoidPtr
00030 {
00031   Q_OBJECT
00032 
00033   AQ_DECLARE_AQS_VOID(TextStream, VoidPtr);
00034 
00035 protected:
00036   void specializedInternalFinish() {
00037     if (!wrap_)
00038       delete o_;
00039   }
00040 
00041 public slots:
00042   QString opOutString() const {
00043     QString ret;
00044     if (!o_)
00045       return ret;
00046     (*o_) >> ret;
00047     return ret;
00048   }
00049 
00050   int opOutInt() const {
00051     int ret = 0;
00052     if (!o_)
00053       return ret;
00054     (*o_) >> ret;
00055     return ret;
00056   }
00057 
00058   float opOutFloat() const {
00059     float ret = 0;
00060     if (!o_)
00061       return ret;
00062     (*o_) >> ret;
00063     return ret;
00064   }
00065 
00066   void opIn(const QString &str) {
00067     if (o_)
00068       (*o_) << str;
00069   }
00070 
00071   void opIn(int i) {
00072     if (o_)
00073       (*o_) << i;
00074   }
00075 
00076   void opIn(float f) {
00077     if (o_)
00078       (*o_) << f;
00079   }
00080 
00081   //@AQ_BEGIN_DEF_PUB_SLOTS@
00082 public slots:
00083   void setEncoding(uint);
00084   void setCodec(QTextCodec *);
00085   void setCodec(AQSTextCodec *);
00086   QTextCodec *codec();
00087   QIODevice *device() const;
00088   void setDevice(QIODevice *);
00089   void setDevice(AQSIODevice *);
00090   void unsetDevice();
00091   bool atEnd() const;
00092   QString readLine();
00093   QString read();
00094   void skipWhiteSpace();
00095   int flags() const;
00096   int flags(int);
00097   int setf(int);
00098   int setf(int, int);
00099   int unsetf(int);
00100   void reset();
00101   int width() const;
00102   int width(int);
00103   int fill() const;
00104   int fill(int);
00105   int precision() const;
00106   int precision(int);
00107 
00108 protected:
00109   static void *construct(const QSArgumentList &args) {
00110     QMap<int, QStringList> candidates;
00111     candidates[0].append(QString::null);
00112     candidates[1].append(QString::fromLatin1("QIODevice*"));
00113     candidates[2].append(QString::fromLatin1("QByteArray*,int"));
00114     QString sgt(castArgsSignature(args, candidates));
00115     if (sgt.isEmpty())
00116       return new QTextStream;
00117     if (sgt == QString::fromLatin1("QIODevice*"))
00118       return new QTextStream(argValue<QIODevice *>(args[0]));
00119     if (sgt == QString::fromLatin1("QByteArray*,int"))
00120       return new QTextStream(*argValue<QByteArray *>(args[0]),
00121                              args[1].variant().toInt());
00122     return 0;
00123   }
00124 
00125 public:
00126   static QMap<int, QStringList> candidateConstructors() {
00127     QMap<int, QStringList> candidates;
00128     candidates[0].append(QString::null);
00129     candidates[1].append(QString::fromLatin1("QIODevice*"));
00130     candidates[2].append(QString::fromLatin1("QByteArray*,int"));
00131     return candidates;
00132   }
00133   //@AQ_END_DEF_PUB_SLOTS@
00134 };
00135 
00136 //@AQ_BEGIN_IMP_PUB_SLOTS@
00137 inline void AQSTextStream::setEncoding(uint arg0)
00138 {
00139   AQ_CALL_VOID(setEncoding(static_cast<QTextStream::Encoding>(arg0)));
00140 }
00141 inline void AQSTextStream::setCodec(QTextCodec *arg0)
00142 {
00143   AQ_CALL_VOID(setCodec(arg0));
00144 }
00145 inline void AQSTextStream::setCodec(AQSTextCodec *arg0)
00146 {
00147   AQ_CALL_VOID(setCodec(*arg0));
00148 }
00149 inline QTextCodec *AQSTextStream::codec()
00150 {
00151   AQ_CALL_RET(codec());
00152 }
00153 inline QIODevice *AQSTextStream::device() const
00154 {
00155   AQ_CALL_RET(device());
00156 }
00157 inline void AQSTextStream::setDevice(QIODevice *arg0)
00158 {
00159   AQ_CALL_VOID(setDevice(arg0));
00160 }
00161 inline void AQSTextStream::setDevice(AQSIODevice *arg0)
00162 {
00163   AQ_CALL_VOID(setDevice(*arg0));
00164 }
00165 inline void AQSTextStream::unsetDevice()
00166 {
00167   AQ_CALL_VOID(unsetDevice());
00168 }
00169 inline bool AQSTextStream::atEnd() const
00170 {
00171   AQ_CALL_RET_V(atEnd(), bool);
00172 }
00173 inline QString AQSTextStream::readLine()
00174 {
00175   AQ_CALL_RET_V(readLine(), QString);
00176 }
00177 inline QString AQSTextStream::read()
00178 {
00179   AQ_CALL_RET_V(read(), QString);
00180 }
00181 inline void AQSTextStream::skipWhiteSpace()
00182 {
00183   AQ_CALL_VOID(skipWhiteSpace());
00184 }
00185 inline int AQSTextStream::flags() const
00186 {
00187   AQ_CALL_RET_V(flags(), int);
00188 }
00189 inline int AQSTextStream::flags(int arg0)
00190 {
00191   AQ_CALL_RET_V(flags(arg0), int);
00192 }
00193 inline int AQSTextStream::setf(int arg0)
00194 {
00195   AQ_CALL_RET_V(setf(arg0), int);
00196 }
00197 inline int AQSTextStream::setf(int arg0,  int arg1)
00198 {
00199   AQ_CALL_RET_V(setf(arg0, arg1), int);
00200 }
00201 inline int AQSTextStream::unsetf(int arg0)
00202 {
00203   AQ_CALL_RET_V(unsetf(arg0), int);
00204 }
00205 inline void AQSTextStream::reset()
00206 {
00207   AQ_CALL_VOID(reset());
00208 }
00209 inline int AQSTextStream::width() const
00210 {
00211   AQ_CALL_RET_V(width(), int);
00212 }
00213 inline int AQSTextStream::width(int arg0)
00214 {
00215   AQ_CALL_RET_V(width(arg0), int);
00216 }
00217 inline int AQSTextStream::fill() const
00218 {
00219   AQ_CALL_RET_V(fill(), int);
00220 }
00221 inline int AQSTextStream::fill(int arg0)
00222 {
00223   AQ_CALL_RET_V(fill(arg0), int);
00224 }
00225 inline int AQSTextStream::precision() const
00226 {
00227   AQ_CALL_RET_V(precision(), int);
00228 }
00229 inline int AQSTextStream::precision(int arg0)
00230 {
00231   AQ_CALL_RET_V(precision(arg0), int);
00232 }
00233 //@AQ_END_IMP_PUB_SLOTS@
00234 
00235 #endif /* AQSTEXTSTREAM_P_H_ */
00236 // @AQSVOIDPTR@
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'