Eneboo - Documentación para desarrolladores
|
00001 /*************************************************************************** 00002 AQSFile_p.h 00003 ------------------- 00004 begin : 05/11/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 AQSFILE_P_H_ 00020 #define AQSFILE_P_H_ 00021 00022 #include "AQSIODevice_p.h" 00023 #include <qfile.h> 00024 00025 class AQSFile : public AQSIODevice 00026 { 00027 Q_OBJECT 00028 00029 AQ_DECLARE_AQS_VOID(File, IODevice); 00030 00031 protected: 00032 void specializedInternalFinish() { 00033 if (!wrap_) 00034 delete o_; 00035 } 00036 00037 public slots: 00038 QIODevice *ioDevice() const { 00039 return static_cast<QIODevice *>(o_); 00040 } 00041 00042 //@AQ_BEGIN_DEF_PUB_SLOTS@ 00043 public slots: 00044 QString name() const; 00045 void setName(const QString &); 00046 bool exists() const; 00047 bool remove(); 00048 virtual bool open(int); 00049 bool open(int, int); 00050 virtual void close(); 00051 virtual void flush(); 00052 virtual uint size() const; 00053 virtual bool atEnd() const; 00054 virtual long readLine(char *, ulong); 00055 long readLine(QString &, ulong); 00056 virtual int getch(); 00057 virtual int putch(int); 00058 virtual int ungetch(int); 00059 int handle() const; 00060 QString errorString() const; 00061 00062 protected: 00063 static void *construct(const QSArgumentList &args) { 00064 QMap<int, QStringList> candidates; 00065 candidates[0].append(QString::null); 00066 candidates[1].append(QString::fromLatin1("QString")); 00067 QString sgt(castArgsSignature(args, candidates)); 00068 if (sgt.isEmpty()) 00069 return new QFile; 00070 if (sgt == QString::fromLatin1("QString")) 00071 return new QFile(*(argValue<QString *>(args[0]))); 00072 return 0; 00073 } 00074 00075 public: 00076 static QMap<int, QStringList> candidateConstructors() { 00077 QMap<int, QStringList> candidates; 00078 candidates[0].append(QString::null); 00079 candidates[1].append(QString::fromLatin1("QString")); 00080 return candidates; 00081 } 00082 //@AQ_END_DEF_PUB_SLOTS@ 00083 }; 00084 00085 //@AQ_BEGIN_IMP_PUB_SLOTS@ 00086 inline QString AQSFile::name() const 00087 { 00088 AQ_CALL_RET_V(name(), QString); 00089 } 00090 inline void AQSFile::setName(const QString &arg0) 00091 { 00092 AQ_CALL_VOID(setName(arg0)); 00093 } 00094 inline bool AQSFile::exists() const 00095 { 00096 AQ_CALL_RET_V(exists(), bool); 00097 } 00098 inline bool AQSFile::remove() 00099 { 00100 AQ_CALL_RET_V(remove(), bool); 00101 } 00102 inline bool AQSFile::open(int arg0) 00103 { 00104 AQ_CALL_RET_V(open(arg0), bool); 00105 } 00106 inline bool AQSFile::open(int arg0, int arg1) 00107 { 00108 AQ_CALL_RET_V(open(arg0, arg1), bool); 00109 } 00110 inline void AQSFile::close() 00111 { 00112 AQ_CALL_VOID(close()); 00113 } 00114 inline void AQSFile::flush() 00115 { 00116 AQ_CALL_VOID(flush()); 00117 } 00118 inline uint AQSFile::size() const 00119 { 00120 AQ_CALL_RET_V(size(), uint); 00121 } 00122 inline bool AQSFile::atEnd() const 00123 { 00124 AQ_CALL_RET_V(atEnd(), bool); 00125 } 00126 inline long AQSFile::readLine(char *arg0, ulong arg1) 00127 { 00128 AQ_CALL_RET_V(readLine(arg0, arg1), long); 00129 } 00130 inline long AQSFile::readLine(QString &arg0, ulong arg1) 00131 { 00132 AQ_CALL_RET_V(readLine(arg0, arg1), long); 00133 } 00134 inline int AQSFile::getch() 00135 { 00136 AQ_CALL_RET_V(getch(), int); 00137 } 00138 inline int AQSFile::putch(int arg0) 00139 { 00140 AQ_CALL_RET_V(putch(arg0), int); 00141 } 00142 inline int AQSFile::ungetch(int arg0) 00143 { 00144 AQ_CALL_RET_V(ungetch(arg0), int); 00145 } 00146 inline int AQSFile::handle() const 00147 { 00148 AQ_CALL_RET_V(handle(), int); 00149 } 00150 inline QString AQSFile::errorString() const 00151 { 00152 AQ_CALL_RET_V(errorString(), QString); 00153 } 00154 //@AQ_END_IMP_PUB_SLOTS@ 00155 00156 #endif /* AQSFILE_P_H_ */ 00157 // @AQSVOIDPTR@