Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

QSafeDataStream.cpp

Go to the documentation of this file.
00001 #include "QSafeDataStream.h"
00002 
00003 #include <qstring.h>
00004 #include <qstringlist.h>
00005 #include <qdatetime.h>
00006 
00007 QSafeDataStream &QSafeDataStream::operator>>( Q_INT8 &i )
00008 {
00009         if(atEnd()){
00010                 i = 0;
00011                 return *this;
00012         } else {
00013                 return (QSafeDataStream&)QDataStream::operator>>(i);
00014         }
00015 }
00016 
00017 QSafeDataStream &QSafeDataStream::operator>>( Q_UINT8 &i )
00018 {
00019         if(atEnd()){
00020                 i = 0;
00021                 return *this;
00022         } else {
00023                 return (QSafeDataStream&)QDataStream::operator>>(i);
00024         }
00025 }
00026 
00027 QSafeDataStream &QSafeDataStream::operator>>( Q_INT16 &i )
00028 {
00029         if(atEnd()){
00030                 i = 0;
00031                 return *this;
00032         } else {
00033                 return (QSafeDataStream&)QDataStream::operator>>(i);
00034         }
00035 }
00036 
00037 QSafeDataStream &QSafeDataStream::operator>>( Q_UINT16 &i )
00038 {
00039         if(atEnd()){
00040                 i = 0;
00041                 return *this;
00042         } else {
00043                 return (QSafeDataStream&)QDataStream::operator>>(i);
00044         }
00045 }
00046 
00047 QSafeDataStream &QSafeDataStream::operator>>( Q_INT32 &i )
00048 {
00049         if(atEnd()){
00050                 i = 0;
00051                 return *this;
00052         } else {
00053                 return (QSafeDataStream&)QDataStream::operator>>(i);
00054         }
00055 }
00056 
00057 QSafeDataStream &QSafeDataStream::operator>>( Q_UINT32 &i )
00058 {
00059         if(atEnd()){
00060                 i = 0;
00061                 return *this;
00062         } else {
00063                 return (QSafeDataStream&)QDataStream::operator>>(i);
00064         }
00065 }
00066 
00067 QSafeDataStream &QSafeDataStream::operator>>( Q_INT64 &i )
00068 {
00069         if(atEnd()){
00070                 i = 0;
00071                 return *this;
00072         } else {
00073                 return (QSafeDataStream&)QDataStream::operator>>(i);
00074         }
00075 }
00076 
00077 QSafeDataStream &QSafeDataStream::operator>>( Q_UINT64 &i )
00078 {
00079         if(atEnd()){
00080                 i = 0;
00081                 return *this;
00082         } else {
00083                 return (QSafeDataStream&)QDataStream::operator>>(i);
00084         }
00085 }
00086 
00087 
00088 QSafeDataStream &QSafeDataStream::operator>>( float &f )
00089 {
00090         if(atEnd()){
00091                 f = 0;
00092                 return *this;
00093         } else {
00094                 return (QSafeDataStream&)QDataStream::operator>>(f);
00095         }
00096 }
00097 
00098 QSafeDataStream &QSafeDataStream::operator>>( double &f )
00099 {
00100         if(atEnd()){
00101                 f = 0;
00102                 return *this;
00103         } else {
00104                 return (QSafeDataStream&)QDataStream::operator>>(f);
00105         }
00106 }
00107 
00108 QSafeDataStream &QSafeDataStream::operator>>( char *&str )
00109 {
00110         if(atEnd()){
00111                 str = 0;
00112                 return *this;
00113         } else {
00114                 return (QSafeDataStream&)QDataStream::operator>>(str);
00115         }
00116 }
00117 
00118 QSafeDataStream &QSafeDataStream::readBytes( char *&s, uint &len )
00119 {
00120         if(atEnd()){
00121                 s = 0;
00122                 len = 0;
00123                 return *this;
00124         } else {
00125                 return (QSafeDataStream&)QDataStream::readBytes(s, len);
00126         }
00127 }
00128 
00129 QSafeDataStream &QSafeDataStream::readRawBytes( char *s, uint len )
00130 {
00131         if(atEnd()){
00132                 return *this;
00133         } else {
00134                 return (QSafeDataStream&)QDataStream::readRawBytes(s, len);
00135         }
00136 }
00137 
00138 QSafeDataStream &QSafeDataStream::operator>>( QString& s )
00139 {
00140         if(atEnd()){
00141                 s = QString::null;
00142                 return *this;
00143         } else {
00144                 return (QSafeDataStream&)(*((QDataStream*)this) >> s);
00145         }
00146 }
00147 
00148 QSafeDataStream &QSafeDataStream::operator>>( QStringList& list )
00149 {
00150         if(atEnd()){
00151                 list.clear();
00152                 return *this;
00153         } else {
00154                 return (QSafeDataStream&)(*((QDataStream*)this) >> list);
00155         }
00156 }
00157 
00158 QSafeDataStream &QSafeDataStream::operator>>( QByteArray& a )
00159 {
00160         if(atEnd()){
00161                 a.resize(0);
00162                 return *this;
00163         } else {
00164                 return (QSafeDataStream&)(*((QDataStream*)this) >> a);
00165         }
00166 }
00167 
00168 QSafeDataStream &QSafeDataStream::operator>>( QCString& s )
00169 {
00170         if(atEnd()){
00171                 s.resize(0);
00172                 return *this;
00173         } else {
00174                 return (QSafeDataStream&)(*((QDataStream*)this) >> s);
00175         }
00176 }
00177 
00178 QSafeDataStream &QSafeDataStream::operator>>( QDate& d )
00179 {
00180         if(atEnd()){
00181                 return *this;
00182         } else {
00183                 return (QSafeDataStream&)(*((QDataStream*)this) >> d);
00184         }
00185 }
00186 
00187 QSafeDataStream &QSafeDataStream::operator>>( QTime& t )
00188 {
00189         if(atEnd()){
00190                 return *this;
00191         } else {
00192                 return (QSafeDataStream&)(*((QDataStream*)this) >> t);
00193         }
00194 }
00195 
00196 QSafeDataStream &QSafeDataStream::operator>>( QDateTime& dt )
00197 {
00198         if(atEnd()){
00199                 return *this;
00200         } else {
00201                 return (QSafeDataStream&)(*((QDataStream*)this) >> dt);
00202         }
00203 }

Generated on Sat Nov 5 16:16:42 2005 for OPIE by  doxygen 1.4.2