KDevelop API Documentation

CharInputBuffer Class Reference

CharInputBuffer.hpp provides an InputBuffer for plain character arrays (buffers). More...

#include <CharInputBuffer.hpp>

Inheritance diagram for CharInputBuffer:

Inheritance graph
[legend]
Collaboration diagram for CharInputBuffer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CharInputBuffer (unsigned char *buf, size_t size, bool owner=false)
 Construct a CharInputBuffer.hpp object with a char* buffer of 'size' if 'owner' is true, then the buffer will be delete[]-ed on destruction.
 ~CharInputBuffer (void)
 Destructor.
virtual void reset (void)
 Reset the CharInputBuffer to initial state Called from LexerInputState::reset.
virtual int getChar (void)
 Override this in subclasses to get the next character.

Protected Attributes

unsigned char * buffer
 the buffer with data
unsigned char * ptr
 position ptr into the buffer
unsigned char * end
 end sentry for buffer
bool delete_buffer
 flag signifying if we have to delete the buffer

Detailed Description

CharInputBuffer.hpp provides an InputBuffer for plain character arrays (buffers).

Definition at line 26 of file CharInputBuffer.hpp.


Constructor & Destructor Documentation

CharInputBuffer::CharInputBuffer unsigned char *  buf,
size_t  size,
bool  owner = false
[inline]
 

Construct a CharInputBuffer.hpp object with a char* buffer of 'size' if 'owner' is true, then the buffer will be delete[]-ed on destruction.

Note:
it is assumed the buffer was allocated with new[]!

Definition at line 33 of file CharInputBuffer.hpp.

References buffer, delete_buffer, end, ptr, and size.

CharInputBuffer::~CharInputBuffer void   )  [inline]
 

Destructor.

Note:
If you're using malloced data, then you probably need to change this destructor. Or better use this class as template for your own.

Definition at line 45 of file CharInputBuffer.hpp.

References delete_buffer.


Member Function Documentation

virtual int CharInputBuffer::getChar void   )  [inline, virtual]
 

Override this in subclasses to get the next character.

Implements InputBuffer.

Definition at line 61 of file CharInputBuffer.hpp.

References ptr.

virtual void CharInputBuffer::reset void   )  [inline, virtual]
 

Reset the CharInputBuffer to initial state Called from LexerInputState::reset.

See also:
LexerInputState

Reimplemented from InputBuffer.

Definition at line 55 of file CharInputBuffer.hpp.

References ptr, and InputBuffer::reset().


Member Data Documentation

unsigned char* CharInputBuffer::buffer [protected]
 

the buffer with data

Definition at line 67 of file CharInputBuffer.hpp.

Referenced by CharInputBuffer().

bool CharInputBuffer::delete_buffer [protected]
 

flag signifying if we have to delete the buffer

Definition at line 70 of file CharInputBuffer.hpp.

Referenced by CharInputBuffer(), and ~CharInputBuffer().

unsigned char* CharInputBuffer::end [protected]
 

end sentry for buffer

Definition at line 69 of file CharInputBuffer.hpp.

Referenced by CharInputBuffer().

unsigned char* CharInputBuffer::ptr [protected]
 

position ptr into the buffer

Definition at line 68 of file CharInputBuffer.hpp.

Referenced by CharInputBuffer(), getChar(), and reset().


The documentation for this class was generated from the following file:
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Feb 22 09:37:32 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003