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

KWBuffer Class Reference

#include </home/clem/local/src/opie/noncore/apps/tinykate/libkate/document/katebuffer.h>

Collaboration diagram for KWBuffer:

Collaboration graph
[legend]
List of all members.

Signals

void textChanged ()
void linesChanged (int lines)
void needHighlight (long, long)

Public Member Functions

 KWBuffer ()
void insertFile (int line, const QString &file, QTextCodec *codec)
void insertData (int line, const QByteArray &data, QTextCodec *codec)
int count ()
TextLine::Ptr line (int i)
void insertLine (int i, TextLine::Ptr line)
void removeLine (int i)
void changeLine (int i)
void clear ()

Protected Slots

void slotLoadFile ()

Protected Member Functions

void loadBlock (KWBufBlock *buf)
void parseBlock (KWBufBlock *buf)
void dirtyBlock (KWBufBlock *buf)
KWBufBlock * findBlock (int i)
void loadFilePart ()
void seek (int i)

Protected Attributes

TextLine::List m_stringList
TextLine::List::Iterator m_stringListIt
int m_stringListCurrent
int m_lineCount

Detailed Description

The KWBuffer class maintains a collections of lines. It allows to maintain state information in a lazy way. It handles swapping out of data using secondary storage.

It is designed to handle large amounts of text-data efficiently with respect to CPU and memory usage.

Author:
Waldo Bastian <bastian@kde.org>

Definition at line 44 of file katebuffer.h.


Constructor & Destructor Documentation

KWBuffer::KWBuffer  ) 
 

Create an empty buffer.

Definition at line 48 of file katebuffer.cpp.

References clear().


Member Function Documentation

void KWBuffer::changeLine int  i  ) 
 

Change line i

Definition at line 177 of file katebuffer.cpp.

Referenced by KateDocument::doDelLine(), KateDocument::doNewLine(), KateDocument::doReplace(), KateDocument::doWordUnWrap(), KateDocument::doWordWrap(), and KateDocument::recordReplace().

void KWBuffer::clear  ) 
 

Clear the buffer.

Definition at line 54 of file katebuffer.cpp.

References FastValueList< T >::append(), QValueList< T >::clear(), m_lineCount, m_stringList, m_stringListCurrent, and m_stringListIt.

Referenced by KateDocument::clear(), insertFile(), KWBuffer(), and KateDocument::openURL().

int KWBuffer::count  ) 
 

Return the total number of lines in the buffer.

Definition at line 123 of file katebuffer.cpp.

References QValueList< T >::count(), m_lineCount, m_stringList, odebug, and oendl.

Referenced by insertFile(), and KateDocument::numLines().

void KWBuffer::dirtyBlock KWBufBlock *  buf  )  [protected]
 

Mark buf dirty.

KWBufBlock* KWBuffer::findBlock int  i  )  [protected]
 

Find the block containing line i

void KWBuffer::insertData int  line,
const QByteArray data,
QTextCodec codec
 

Insert a block of data at line line in the buffer. Using codec to decode the file.

Definition at line 107 of file katebuffer.cpp.

void KWBuffer::insertFile int  line,
const QString file,
QTextCodec codec
 

Insert a file at line line in the buffer. Using codec to decode the file.

Definition at line 67 of file katebuffer.cpp.

References FastValueList< T >::append(), clear(), count(), IO_ReadOnly, QString::length(), m_lineCount, m_stringList, m_stringListCurrent, m_stringListIt, QString::null, odebug, oendl, QFile::open(), QTextStream::readLine(), QTextStream::setCodec(), stream, and QString::unicode().

Referenced by KateDocument::openURL().

void KWBuffer::insertLine int  i,
TextLine::Ptr  line
 

Insert line in front of line i

Definition at line 158 of file katebuffer.cpp.

References FastValueList< T >::insert(), m_lineCount, m_stringList, m_stringListCurrent, m_stringListIt, and seek().

Referenced by KateDocument::doInsLine(), KateDocument::doNewLine(), KateDocument::insert_Line(), KateDocument::setText(), and KateDocument::wrapText().

TextLine::Ptr KWBuffer::line int  i  ) 
 

Return line i

Definition at line 150 of file katebuffer.cpp.

References QValueList< T >::count(), m_stringList, m_stringListIt, and seek().

Referenced by KateDocument::clear(), KateDocument::getTextLine(), KateDocument::setTabWidth(), KateDocument::setText(), KateDocument::text(), and KateDocument::updateLines().

void KWBuffer::linesChanged int  lines  )  [signal]
 

Emitted during loading.

Referenced by slotLoadFile().

void KWBuffer::loadBlock KWBufBlock *  buf  )  [protected]
 

Make sure buf gets loaded.

void KWBuffer::loadFilePart  )  [protected]
 

Load a part of the file that is currently loading.

Definition at line 101 of file katebuffer.cpp.

Referenced by slotLoadFile().

void KWBuffer::needHighlight long  ,
long 
[signal]
 

void KWBuffer::parseBlock KWBufBlock *  buf  )  [protected]
 

Make sure buf gets parsed.

void KWBuffer::removeLine int  i  ) 
 

Remove line i

Definition at line 168 of file katebuffer.cpp.

References m_lineCount, m_stringList, m_stringListCurrent, m_stringListIt, FastValueList< T >::remove(), and seek().

Referenced by KateDocument::doDelLine(), KateDocument::doKillLine(), and KateDocument::remove_Line().

void KWBuffer::seek int  i  )  [protected]
 

Definition at line 132 of file katebuffer.cpp.

References m_stringListCurrent, and m_stringListIt.

Referenced by insertLine(), line(), and removeLine().

void KWBuffer::slotLoadFile  )  [protected, slot]
 

Definition at line 112 of file katebuffer.cpp.

References linesChanged(), and loadFilePart().

void KWBuffer::textChanged  )  [signal]
 


Member Data Documentation

int KWBuffer::m_lineCount [protected]
 

Definition at line 137 of file katebuffer.h.

Referenced by clear(), count(), insertFile(), insertLine(), and removeLine().

TextLine::List KWBuffer::m_stringList [protected]
 

Definition at line 134 of file katebuffer.h.

Referenced by clear(), count(), insertFile(), insertLine(), line(), and removeLine().

int KWBuffer::m_stringListCurrent [protected]
 

Definition at line 136 of file katebuffer.h.

Referenced by clear(), insertFile(), insertLine(), removeLine(), and seek().

TextLine::List::Iterator KWBuffer::m_stringListIt [protected]
 

Definition at line 135 of file katebuffer.h.

Referenced by clear(), insertFile(), insertLine(), line(), removeLine(), and seek().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:38:11 2005 for OPIE by  doxygen 1.4.2