author | llornkcor <llornkcor> | 2003-07-10 02:40:10 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-07-10 02:40:10 (UTC) |
commit | 155d68c1e7d7dc0fed2534ac43d6d77ce2781f55 (patch) (unidiff) | |
tree | e6edaa5a7040fe6c224c3943d1094dcf02e4f74c /qmake/tools/qtextstream.cpp | |
parent | 86703e8a5527ef114facd02c005b6b3a7e62e263 (diff) | |
download | opie-155d68c1e7d7dc0fed2534ac43d6d77ce2781f55.zip opie-155d68c1e7d7dc0fed2534ac43d6d77ce2781f55.tar.gz opie-155d68c1e7d7dc0fed2534ac43d6d77ce2781f55.tar.bz2 |
update qmake to 1.05a
-rw-r--r-- | qmake/tools/qtextstream.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/qmake/tools/qtextstream.cpp b/qmake/tools/qtextstream.cpp index 75c6531..ddca5bd 100644 --- a/qmake/tools/qtextstream.cpp +++ b/qmake/tools/qtextstream.cpp | |||
@@ -1044,97 +1044,97 @@ QTextStream &QTextStream::readRawBytes( char *s, uint len ) | |||
1044 | Note that no encoding is done by this function. | 1044 | Note that no encoding is done by this function. |
1045 | 1045 | ||
1046 | \sa QIODevice::writeBlock() | 1046 | \sa QIODevice::writeBlock() |
1047 | */ | 1047 | */ |
1048 | 1048 | ||
1049 | QTextStream &QTextStream::writeRawBytes( const char* s, uint len ) | 1049 | QTextStream &QTextStream::writeRawBytes( const char* s, uint len ) |
1050 | { | 1050 | { |
1051 | dev->writeBlock( s, len ); | 1051 | dev->writeBlock( s, len ); |
1052 | return *this; | 1052 | return *this; |
1053 | } | 1053 | } |
1054 | 1054 | ||
1055 | 1055 | ||
1056 | QTextStream &QTextStream::writeBlock( const char* p, uint len ) | 1056 | QTextStream &QTextStream::writeBlock( const char* p, uint len ) |
1057 | { | 1057 | { |
1058 | if ( doUnicodeHeader ) { | 1058 | if ( doUnicodeHeader ) { |
1059 | doUnicodeHeader = FALSE; | 1059 | doUnicodeHeader = FALSE; |
1060 | if ( !mapper && !latin1 ) | 1060 | if ( !mapper && !latin1 ) |
1061 | ts_putc( QChar::byteOrderMark ); | 1061 | ts_putc( QChar::byteOrderMark ); |
1062 | } | 1062 | } |
1063 | // QCString and const char * are treated as Latin-1 | 1063 | // QCString and const char * are treated as Latin-1 |
1064 | if ( !mapper && latin1 ) { | 1064 | if ( !mapper && latin1 ) { |
1065 | dev->writeBlock( p, len ); | 1065 | dev->writeBlock( p, len ); |
1066 | } else if ( !mapper && internalOrder ) { | 1066 | } else if ( !mapper && internalOrder ) { |
1067 | QChar *u = new QChar[len]; | 1067 | QChar *u = new QChar[len]; |
1068 | for ( uint i = 0; i < len; i++ ) | 1068 | for ( uint i = 0; i < len; i++ ) |
1069 | u[i] = p[i]; | 1069 | u[i] = p[i]; |
1070 | dev->writeBlock( (char*)u, len * sizeof(QChar) ); | 1070 | dev->writeBlock( (char*)u, len * sizeof(QChar) ); |
1071 | delete [] u; | 1071 | delete [] u; |
1072 | } else { | 1072 | } else { |
1073 | for ( uint i = 0; i < len; i++ ) | 1073 | for ( uint i = 0; i < len; i++ ) |
1074 | ts_putc( (uchar)p[i] ); | 1074 | ts_putc( (uchar)p[i] ); |
1075 | } | 1075 | } |
1076 | return *this; | 1076 | return *this; |
1077 | } | 1077 | } |
1078 | 1078 | ||
1079 | QTextStream &QTextStream::writeBlock( const QChar* p, uint len ) | 1079 | QTextStream &QTextStream::writeBlock( const QChar* p, uint len ) |
1080 | { | 1080 | { |
1081 | #ifndef QT_NO_TEXTCODEC | 1081 | #ifndef QT_NO_TEXTCODEC |
1082 | if ( mapper ) { | 1082 | if ( mapper ) { |
1083 | if ( !d->encoder ) | 1083 | if ( !d->encoder ) |
1084 | d->encoder = mapper->makeEncoder(); | 1084 | d->encoder = mapper->makeEncoder(); |
1085 | QConstString s( p, len ); | 1085 | QConstString s( p, len ); |
1086 | int l = len; | 1086 | int l = len; |
1087 | QCString block = d->encoder->fromUnicode( s.string(), l ); | 1087 | QCString block = d->encoder->fromUnicode( s.string(), l ); |
1088 | dev->writeBlock( block, l ); | 1088 | dev->writeBlock( block, l ); |
1089 | } else | 1089 | } else |
1090 | #endif | 1090 | #endif |
1091 | if ( latin1 ) { | 1091 | if ( latin1 ) { |
1092 | char *str = QString::unicodeToAscii( p, len ); | 1092 | char *str = QString::unicodeToLatin1( p, len ); |
1093 | dev->writeBlock( str, len ); | 1093 | dev->writeBlock( str, len ); |
1094 | delete [] str; | 1094 | delete [] str; |
1095 | } else if ( internalOrder ) { | 1095 | } else if ( internalOrder ) { |
1096 | if ( doUnicodeHeader ) { | 1096 | if ( doUnicodeHeader ) { |
1097 | doUnicodeHeader = FALSE; | 1097 | doUnicodeHeader = FALSE; |
1098 | ts_putc( QChar::byteOrderMark ); | 1098 | ts_putc( QChar::byteOrderMark ); |
1099 | } | 1099 | } |
1100 | dev->writeBlock( (char*)p, sizeof(QChar)*len ); | 1100 | dev->writeBlock( (char*)p, sizeof(QChar)*len ); |
1101 | } else { | 1101 | } else { |
1102 | for (uint i=0; i<len; i++) | 1102 | for (uint i=0; i<len; i++) |
1103 | ts_putc( p[i] ); | 1103 | ts_putc( p[i] ); |
1104 | } | 1104 | } |
1105 | return *this; | 1105 | return *this; |
1106 | } | 1106 | } |
1107 | 1107 | ||
1108 | /*! | 1108 | /*! |
1109 | Resets the text stream. | 1109 | Resets the text stream. |
1110 | 1110 | ||
1111 | \list | 1111 | \list |
1112 | \i All flags are set to 0. | 1112 | \i All flags are set to 0. |
1113 | \i The field width is set to 0. | 1113 | \i The field width is set to 0. |
1114 | \i The fill character is set to ' ' (Space). | 1114 | \i The fill character is set to ' ' (Space). |
1115 | \i The precision is set to 6. | 1115 | \i The precision is set to 6. |
1116 | \endlist | 1116 | \endlist |
1117 | 1117 | ||
1118 | \sa setf(), width(), fill(), precision() | 1118 | \sa setf(), width(), fill(), precision() |
1119 | */ | 1119 | */ |
1120 | 1120 | ||
1121 | void QTextStream::reset() | 1121 | void QTextStream::reset() |
1122 | { | 1122 | { |
1123 | fflags = 0; | 1123 | fflags = 0; |
1124 | fwidth = 0; | 1124 | fwidth = 0; |
1125 | fillchar = ' '; | 1125 | fillchar = ' '; |
1126 | fprec = 6; | 1126 | fprec = 6; |
1127 | } | 1127 | } |
1128 | 1128 | ||
1129 | /*! | 1129 | /*! |
1130 | \fn QIODevice *QTextStream::device() const | 1130 | \fn QIODevice *QTextStream::device() const |
1131 | 1131 | ||
1132 | Returns the IO device currently set. | 1132 | Returns the IO device currently set. |
1133 | 1133 | ||
1134 | \sa setDevice(), unsetDevice() | 1134 | \sa setDevice(), unsetDevice() |
1135 | */ | 1135 | */ |
1136 | 1136 | ||
1137 | /*! | 1137 | /*! |
1138 | Sets the IO device to \a iod. | 1138 | Sets the IO device to \a iod. |
1139 | 1139 | ||
1140 | \sa device(), unsetDevice() | 1140 | \sa device(), unsetDevice() |