kate Library API Documentation

KateBuffer Class Reference

The KateBuffer class maintains a collections of lines. More...

#include <katebuffer.h>

Inheritance diagram for KateBuffer:

QObject List of all members.

Public Slots

void setLineVisible (unsigned int lineNr, bool visible)

Signals

void codeFoldingUpdated ()
void tagLines (int start, int end)

Public Member Functions

 KateBuffer (KateDocument *doc)
 ~KateBuffer ()
void editStart ()
void editEnd ()
void clear ()
bool openFile (const QString &m_file)
bool loadingBorked () const
bool canEncode ()
bool saveFile (const QString &m_file)
KateTextLine::Ptr line (uint i)
KateTextLine::Ptr plainLine (uint i)
uint count () const
void changeLine (uint i)
void insertLine (uint i, KateTextLine::Ptr line)
void removeLine (uint i)
uint countVisible ()
uint lineNumber (uint visibleLine)
uint lineVisibleNumber (uint line)
void lineInfo (KateLineInfo *info, unsigned int line)
uint tabWidth () const
KVMAllocatorvm ()
void setTabWidth (uint w)
void setHighlight (KateHighlighting *highlight)
KateHighlighting * highlight ()
void invalidateHighlighting ()
KateCodeFoldingTree * foldingTree ()

Static Public Member Functions

uint maxLoadedBlocks ()
void setMaxLoadedBlocks (uint count)

Friends

class KateBufBlock

Detailed Description

The KateBuffer 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>

Christoph Cullmann <cullmann@kde.org>

Definition at line 341 of file katebuffer.h.


Constructor & Destructor Documentation

KateBuffer::KateBuffer KateDocument *  doc  ) 
 

Create an empty buffer.

Parameters:
doc parent document

Definition at line 247 of file katebuffer.cpp.

References clear(), and setLineVisible().

KateBuffer::~KateBuffer  ) 
 

Goodbye buffer.

Definition at line 275 of file katebuffer.cpp.


Member Function Documentation

uint KateBuffer::maxLoadedBlocks  )  [inline, static]
 

maximal loaded block count

Returns:
max loaded blocks

Definition at line 352 of file katebuffer.h.

Referenced by KateBufBlock::KateBufBlock().

void KateBuffer::setMaxLoadedBlocks uint  count  )  [static]
 

modifier for max loaded blocks limit

Parameters:
count new limit

Definition at line 77 of file katebuffer.cpp.

References KMAX.

void KateBuffer::editStart  ) 
 

start some editing action

Definition at line 282 of file katebuffer.cpp.

void KateBuffer::editEnd  ) 
 

finish some editing action

Definition at line 295 of file katebuffer.cpp.

References KateBufBlock::endLine(), and KateBufBlock::startLine().

void KateBuffer::clear  ) 
 

Clear the buffer.

Definition at line 375 of file katebuffer.cpp.

References KateBufBlock::lines().

Referenced by KateBuffer(), and openFile().

bool KateBuffer::openFile const QString m_file  ) 
 

Open a file, use the given filename.

Parameters:
m_file filename to open
Returns:
success

Definition at line 401 of file katebuffer.cpp.

References clear(), KateBufBlock::endLine(), and KateBufBlock::lines().

bool KateBuffer::loadingBorked  )  const [inline]
 

was the last loading broken because of not enough tmp disk space ? (will be reseted on successful save of the file, user gets warning if he really wants to do it)

Returns:
was loading borked?

Definition at line 447 of file katebuffer.h.

bool KateBuffer::canEncode  ) 
 

Can the current codec handle all chars.

Returns:
chars can be encoded

Definition at line 478 of file katebuffer.cpp.

References kdDebug(), and plainLine().

bool KateBuffer::saveFile const QString m_file  ) 
 

Save the buffer to a file, use the given filename + codec + end of line chars (internal use of qtextstream).

Parameters:
m_file filename to save to
Returns:
success

Definition at line 502 of file katebuffer.cpp.

References plainLine(), and KateTextLine::Ptr.

KateTextLine::Ptr KateBuffer::line uint  i  )  [inline]
 

Return line i.

Definition at line 466 of file katebuffer.h.

References KateBufBlock::line(), KateTextLine::Ptr, and KateBufBlock::startLine().

KateTextLine::Ptr KateBuffer::plainLine uint  i  )  [inline]
 

Return line i without triggering highlighting.

Definition at line 488 of file katebuffer.h.

References KateBufBlock::line(), KateTextLine::Ptr, and KateBufBlock::startLine().

Referenced by canEncode(), and saveFile().

uint KateBuffer::count  )  const [inline]
 

Return the total number of lines in the buffer.

Definition at line 500 of file katebuffer.h.

void KateBuffer::changeLine uint  i  ) 
 

Mark line i as changed !

Definition at line 668 of file katebuffer.cpp.

References KateBufBlock::markDirty().

void KateBuffer::insertLine uint  i,
KateTextLine::Ptr  line
 

Insert line in front of line i.

Definition at line 678 of file katebuffer.cpp.

References KateBufBlock::insertLine(), KateTextLine::Ptr, and KateBufBlock::startLine().

void KateBuffer::removeLine uint  i  ) 
 

Remove line i.

Definition at line 713 of file katebuffer.cpp.

References KateBufBlock::endLine(), KateBufBlock::lines(), KateBufBlock::next(), KateBufBlock::prev(), KateBufBlock::removeLine(), KateBufBlock::setStartLine(), and KateBufBlock::startLine().

void KateBuffer::setHighlight KateHighlighting *  highlight  ) 
 

Use highlight for highlighting.

highlight may be 0 in which case highlighting will be disabled.

Definition at line 779 of file katebuffer.cpp.

References invalidateHighlighting().

void KateBuffer::invalidateHighlighting  ) 
 

Invalidate highlighting of whole buffer.

Definition at line 785 of file katebuffer.cpp.

Referenced by setHighlight().

void KateBuffer::setLineVisible unsigned int  lineNr,
bool  visible
[slot]
 

change the visibility of a given line

Definition at line 1023 of file katebuffer.cpp.

References KateBufBlock::line(), KateBufBlock::markDirty(), KateTextLine::Ptr, and KateBufBlock::startLine().

Referenced by KateBuffer().

void KateBuffer::codeFoldingUpdated  )  [signal]
 

Emittend if codefolding returned with a changed list.

void KateBuffer::tagLines int  start,
int  end
[signal]
 

Emitted when the highlighting of a certain range has changed.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kate Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Nov 27 13:52:50 2004 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003