summaryrefslogtreecommitdiff
path: root/qmake/tools/qbuffer.cpp
Unidiff
Diffstat (limited to 'qmake/tools/qbuffer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--qmake/tools/qbuffer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/qmake/tools/qbuffer.cpp b/qmake/tools/qbuffer.cpp
index b213dd9..0fc90e4 100644
--- a/qmake/tools/qbuffer.cpp
+++ b/qmake/tools/qbuffer.cpp
@@ -151,98 +151,98 @@ bool QBuffer::setBuffer( QByteArray buf )
151#endif 151#endif
152 return FALSE; 152 return FALSE;
153 } 153 }
154 a = buf; 154 a = buf;
155 a_len = a.size(); 155 a_len = a.size();
156 a_inc = (a_len > 512) ? 512 : a_len; // initial increment 156 a_inc = (a_len > 512) ? 512 : a_len; // initial increment
157 if ( a_inc < 16 ) 157 if ( a_inc < 16 )
158 a_inc = 16; 158 a_inc = 16;
159 ioIndex = 0; 159 ioIndex = 0;
160 return TRUE; 160 return TRUE;
161} 161}
162 162
163/*! 163/*!
164 \fn QByteArray QBuffer::buffer() const 164 \fn QByteArray QBuffer::buffer() const
165 165
166 Returns this buffer's byte array. 166 Returns this buffer's byte array.
167 167
168 \sa setBuffer() 168 \sa setBuffer()
169*/ 169*/
170 170
171/*! 171/*!
172 \reimp 172 \reimp
173 173
174 Opens the buffer in mode \a m. Returns TRUE if successful; 174 Opens the buffer in mode \a m. Returns TRUE if successful;
175 otherwise returns FALSE. The buffer must be opened before use. 175 otherwise returns FALSE. The buffer must be opened before use.
176 176
177 The mode parameter \a m must be a combination of the following flags. 177 The mode parameter \a m must be a combination of the following flags.
178 \list 178 \list
179 \i \c IO_ReadOnly opens the buffer in read-only mode. 179 \i \c IO_ReadOnly opens the buffer in read-only mode.
180 \i \c IO_WriteOnly opens the buffer in write-only mode. 180 \i \c IO_WriteOnly opens the buffer in write-only mode.
181 \i \c IO_ReadWrite opens the buffer in read/write mode. 181 \i \c IO_ReadWrite opens the buffer in read/write mode.
182 \i \c IO_Append sets the buffer index to the end of the buffer. 182 \i \c IO_Append sets the buffer index to the end of the buffer.
183 \i \c IO_Truncate truncates the buffer. 183 \i \c IO_Truncate truncates the buffer.
184 \endlist 184 \endlist
185 185
186 \sa close(), isOpen() 186 \sa close(), isOpen()
187*/ 187*/
188 188
189bool QBuffer::open( int m ) 189bool QBuffer::open( int m )
190{ 190{
191 if ( isOpen() ) { // buffer already open 191 if ( isOpen() ) { // buffer already open
192#if defined(QT_CHECK_STATE) 192#if defined(QT_CHECK_STATE)
193 qWarning( "QBuffer::open: Buffer already open" ); 193 qWarning( "QBuffer::open: Buffer already open" );
194#endif 194#endif
195 return FALSE; 195 return FALSE;
196 } 196 }
197 setMode( m ); 197 setMode( m );
198 if ( m & IO_Truncate ) { // truncate buffer 198 if ( m & IO_Truncate ) { // truncate buffer
199 a.resize( 0 ); 199 a.resize( 1 );
200 a_len = 0; 200 a_len = 1;
201 } 201 }
202 if ( m & IO_Append ) { // append to end of buffer 202 if ( m & IO_Append ) { // append to end of buffer
203 ioIndex = a.size(); 203 ioIndex = a.size();
204 } else { 204 } else {
205 ioIndex = 0; 205 ioIndex = 0;
206 } 206 }
207 a_inc = 16; 207 a_inc = 16;
208 setState( IO_Open ); 208 setState( IO_Open );
209 setStatus( 0 ); 209 setStatus( 0 );
210 return TRUE; 210 return TRUE;
211} 211}
212 212
213/*! 213/*!
214 \reimp 214 \reimp
215 215
216 Closes an open buffer. 216 Closes an open buffer.
217 217
218 \sa open() 218 \sa open()
219*/ 219*/
220 220
221void QBuffer::close() 221void QBuffer::close()
222{ 222{
223 if ( isOpen() ) { 223 if ( isOpen() ) {
224 setFlags( IO_Direct ); 224 setFlags( IO_Direct );
225 ioIndex = 0; 225 ioIndex = 0;
226 a_inc = 16; 226 a_inc = 16;
227 } 227 }
228} 228}
229 229
230/*! 230/*!
231 \reimp 231 \reimp
232 232
233 The flush function does nothing for a QBuffer. 233 The flush function does nothing for a QBuffer.
234*/ 234*/
235 235
236void QBuffer::flush() 236void QBuffer::flush()
237{ 237{
238 return; 238 return;
239} 239}
240 240
241 241
242/*! 242/*!
243 \fn QIODevice::Offset QBuffer::at() const 243 \fn QIODevice::Offset QBuffer::at() const
244 244
245 \reimp 245 \reimp
246*/ 246*/
247 247
248/*! 248/*!