diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 2bda8f7717adf28da4af0d34fb82f63d2868c31d (patch) | |
tree | 8d927b7b47a90c4adb646482a52613f58acd6f8c /khexedit/lib/kwrappingrobuffer.h | |
download | tdeutils-2bda8f7717adf28da4af0d34fb82f63d2868c31d.tar.gz tdeutils-2bda8f7717adf28da4af0d34fb82f63d2868c31d.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeutils@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'khexedit/lib/kwrappingrobuffer.h')
-rw-r--r-- | khexedit/lib/kwrappingrobuffer.h | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/khexedit/lib/kwrappingrobuffer.h b/khexedit/lib/kwrappingrobuffer.h new file mode 100644 index 0000000..51ee7b8 --- /dev/null +++ b/khexedit/lib/kwrappingrobuffer.h @@ -0,0 +1,85 @@ +/*************************************************************************** + kwrappingrobuffer.h - description + ------------------- + begin : Mit Mai 14 2003 + copyright : (C) 2003 by Friedrich W. H. Kossebau + email : Friedrich.W.H@Kossebau.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License version 2 as published by the Free Software Foundation. * + * * + ***************************************************************************/ + + +#ifndef KHE_KWRAPPINGROBUFFER_H +#define KHE_KWRAPPINGROBUFFER_H + +#include "kreadonlybuffer.h" + +namespace KHE +{ + +/** + *@author Friedrich W. H. Kossebau + */ + +class KWrappingROBuffer : public KReadOnlyBuffer +{ + public: + static const int NothingFound = -1; + + public: + KWrappingROBuffer(); + KWrappingROBuffer( const char* D, int L ); + virtual ~KWrappingROBuffer(); + + + public: // KDataBuffer API + virtual bool prepareRange( KSection Range ) const; + virtual const char *dataSet( KSection S ) const; + virtual char datum( unsigned int Offset ) const; + virtual int size() const; + virtual bool isModified() const; + + virtual int insert( int Pos, const char*, int Length ); + virtual int remove( KSection S ); + virtual unsigned int replace( KSection S, const char*, unsigned int Length ); + virtual int fill( const char FillChar, int, int ); + virtual void setDatum( unsigned int Offset, const char Char ); + + virtual void setModified( bool M ); + + virtual int find( const char*KeyData, int Length, KSection Section ) const; + virtual int rfind( const char*, int Length, int Pos = -1 ) const; + + + public: // + void set( const char* D, int L ); + + protected: + const char* Data; + int Size; + bool Modified; +}; + +inline int KWrappingROBuffer::size() const { return Size; } + +inline bool KWrappingROBuffer::isModified() const { return Modified; } + +inline bool KWrappingROBuffer::prepareRange( KSection ) const { return true; } +inline char KWrappingROBuffer::datum( unsigned int Offset ) const { return Data[Offset]; } + +inline int KWrappingROBuffer::insert( int, const char*, int ) { return 0; } +inline int KWrappingROBuffer::remove( KSection ) { return 0; } +inline unsigned int KWrappingROBuffer::replace( KSection, const char*, unsigned int ) { return 0; } +inline int KWrappingROBuffer::fill( const char , int, int ) { return 0; } +inline void KWrappingROBuffer::setDatum( unsigned int, const char ) {} + +inline void KWrappingROBuffer::setModified( bool M ) { Modified = M; } +} + +#endif |