bool QGStringBuffer::open( int m ) { if ( !m_str ) { #if defined(CHECK_STATE) qWarning( "QGStringBuffer::open: No string" ); #endif return FALSE; } if ( isOpen() ) { // buffer already open #if defined(CHECK_STATE) qWarning( "QGStringBuffer::open: Buffer already open" ); #endif return FALSE; } setMode( m ); if ( m & IO_Truncate ) { // truncate buffer m_str->truncate( 0 ); } if ( m & IO_Append ) { // append to end of buffer ioIndex = m_str->length(); } else { ioIndex = 0; } setState( IO_Open ); setStatus( 0 ); return TRUE; }
bool QGStringBuffer::at( int pos ) { #if defined(CHECK_STATE) if ( !isOpen() ) { qWarning( "QGStringBuffer::at: Buffer is not open" ); return FALSE; } #endif if ( (uint)pos >= m_str->length() ) { #if defined(CHECK_RANGE) qWarning( "QGStringBuffer::at: Index %d out of range", pos ); #endif return FALSE; } ioIndex = pos; return TRUE; }
void marshalQGString(StorageIntf *s,const QGString &str) { uint l=str.length(); marshalUInt(s,l); if (l>0) s->write(str.data(),l); }
uint QGStringBuffer::size() const { return m_str ? m_str->length() : 0; }