kate Library API Documentation

KateBufBlock Class Reference

The KateBufBlock class contains an amount of data representing a certain number of lines. More...

#include <katebuffer.h>

Collaboration diagram for KateBufBlock:

Collaboration graph
[legend]
List of all members.

Public Types

enum  State { stateSwapped = 0, stateClean = 1, stateDirty = 2 }

Public Member Functions

 KateBufBlock (KateBuffer *parent, KateBufBlock *prev=0, KateBufBlock *next=0, KateFileLoader *stream=0)
 ~KateBufBlock ()
State state () const
KateTextLine::Ptr line (uint i)
void insertLine (uint i, KateTextLine::Ptr line)
void removeLine (uint i)
void markDirty ()
uint startLine () const
void setStartLine (uint line)
uint endLine () const
uint lines () const
KateBufBlockprev ()
KateBufBlocknext ()

Friends

class KateBufBlockList

Detailed Description

The KateBufBlock class contains an amount of data representing a certain number of lines.

Author:
Waldo Bastian <bastian@kde.org>

Christoph Cullmann <cullmann@kde.org>

Definition at line 49 of file katebuffer.h.


Member Enumeration Documentation

enum KateBufBlock::State
 

state flags

Definition at line 80 of file katebuffer.h.


Constructor & Destructor Documentation

KateBufBlock::KateBufBlock KateBuffer parent,
KateBufBlock prev = 0,
KateBufBlock next = 0,
KateFileLoader *  stream = 0
 

Create an empty block.

(empty == ONE line)

Parameters:
parent buffer the block belongs to
prev previous bufblock in the list
next next bufblock in the list
stream stream to load the content from, if any given

Definition at line 1179 of file katebuffer.cpp.

References KateBufBlockList::append(), KateBufBlockList::count(), endLine(), KateBufBlockList::first(), KateBuffer::m_loadedBlocks, m_next, m_prev, KateBuffer::maxLoadedBlocks(), QValueVector::push_back(), and swapOut().

KateBufBlock::~KateBufBlock  ) 
 

destroy this block and take care of freeing all mem

Definition at line 1227 of file katebuffer.cpp.

References KVMAllocator::free(), m_next, m_prev, KateBufBlockList::remove(), KateFactory::self(), and KateFactory::vm().


Member Function Documentation

State KateBufBlock::state  )  const [inline]
 

returns the current state of this block

Returns:
state

Definition at line 91 of file katebuffer.h.

KateTextLine::Ptr KateBufBlock::line uint  i  ) 
 

return line i The first line of this block is line 0.

if you modifiy this line, please mark the block as dirty

Parameters:
i line to return
Returns:
line pointer

Definition at line 1333 of file katebuffer.cpp.

References KateBufBlockList::append(), KateBufBlockList::isLast(), and KateBuffer::m_loadedBlocks.

Referenced by KateBuffer::line(), and KateBuffer::plainLine().

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

insert line in front of line i marks the block dirty

Parameters:
i where to insert
line line pointer

Definition at line 1346 of file katebuffer.cpp.

References QValueVector::begin(), QValueVector::insert(), and markDirty().

Referenced by KateBuffer::insertLine().

void KateBufBlock::removeLine uint  i  ) 
 

remove line i marks the block dirty

Parameters:
i line to remove

Definition at line 1358 of file katebuffer.cpp.

References QValueVector::begin(), QValueVector::erase(), and markDirty().

Referenced by KateBuffer::removeLine().

void KateBufBlock::markDirty  ) 
 

mark this block as dirty, will invalidate the swap data insert/removeLine will mark the block dirty itself

Definition at line 1370 of file katebuffer.cpp.

References KateBufBlockList::append(), KVMAllocator::free(), KateBufBlockList::isLast(), KateBuffer::m_loadedBlocks, KateFactory::self(), and KateFactory::vm().

Referenced by KateBuffer::changeLine(), insertLine(), and removeLine().

uint KateBufBlock::startLine  )  const [inline]
 

startLine

Returns:
first line in block

Definition at line 129 of file katebuffer.h.

Referenced by KateBuffer::editEnd(), KateBuffer::insertLine(), KateBuffer::line(), KateBuffer::plainLine(), and KateBuffer::removeLine().

void KateBufBlock::setStartLine uint  line  )  [inline]
 

update the first line, needed to keep it up to date

Parameters:
line new startLine

Definition at line 135 of file katebuffer.h.

Referenced by KateBuffer::removeLine().

uint KateBufBlock::endLine  )  const [inline]
 

first line behind this block

Parameters:
line behind block

Definition at line 141 of file katebuffer.h.

Referenced by KateBuffer::editEnd(), KateBufBlock(), KateBuffer::openFile(), and KateBuffer::removeLine().

uint KateBufBlock::lines  )  const [inline]
 

lines in this block

Returns:
lines

Definition at line 147 of file katebuffer.h.

Referenced by KateBuffer::clear(), KateBuffer::openFile(), and KateBuffer::removeLine().

KateBufBlock* KateBufBlock::prev  )  [inline]
 

prev block

Returns:
previous block

Definition at line 153 of file katebuffer.h.

Referenced by KateBuffer::removeLine().

KateBufBlock* KateBufBlock::next  )  [inline]
 

next block

Returns:
next block

Definition at line 159 of file katebuffer.h.

Referenced by KateBuffer::removeLine().


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.4.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun Oct 9 08:12:07 2005 by doxygen 1.4.4 written by Dimitri van Heesch, © 1997-2003