• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDECore

  • kdecore
  • network
k3iobuffer.h
Go to the documentation of this file.
1/* -*- C++ -*-
2 * Copyright (C) 2003,2005 Thiago Macieira <thiago@kde.org>
3 *
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining
6 * a copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sublicense, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25#ifndef KIOBUFFER_H
26#define KIOBUFFER_H
27
28#include <kdecore_export.h>
29#include <QtCore/QByteArray>
30
31
44class KDECORE_EXPORT_DEPRECATED KIOBufferBase //krazy:exclude=inline (mainly virtual; simple implementations; KDE3 compat)
45{
46public:
50 KIOBufferBase()
51 { }
52
56 KIOBufferBase(const KIOBufferBase& )
57 { }
58
62 virtual ~KIOBufferBase()
63 { }
64
68 KIOBufferBase& operator=(const KIOBufferBase& )
69 { return *this; }
70
74 virtual bool canReadLine() const = 0;
75
79 virtual qint64 readLine(char* data, qint64 maxlen) = 0;
80
87 virtual qint64 length() const = 0;
88
92 inline bool isEmpty() const
93 { return length() == 0; }
94
101 virtual qint64 size() const = 0;
102
106 inline bool isFull() const
107 { return size() != -1 && size() == length(); }
108
116 virtual bool setSize(qint64 size) = 0;
117
125 virtual qint64 feedBuffer(const char *data, qint64 len) = 0;
126
135 virtual qint64 consumeBuffer(char *data, qint64 maxlen, bool discard = true) = 0;
136
140 virtual void clear() = 0;
141};
142
143#endif
KIOBufferBase
base for I/O buffer implementation
Definition: k3iobuffer.h:45
KIOBufferBase::clear
virtual void clear()=0
Clears the buffer.
KIOBufferBase::canReadLine
virtual bool canReadLine() const =0
Returns true if a line can be read from the buffer.
KIOBufferBase::isFull
bool isFull() const
Returns true if the buffer is full (i.e., cannot receive more data)
Definition: k3iobuffer.h:106
KIOBufferBase::KIOBufferBase
KIOBufferBase()
Default constructor.
Definition: k3iobuffer.h:50
KIOBufferBase::isEmpty
bool isEmpty() const
Returns true if the buffer is empty of data.
Definition: k3iobuffer.h:92
KIOBufferBase::operator=
KIOBufferBase & operator=(const KIOBufferBase &)
Assignment operator.
Definition: k3iobuffer.h:68
KIOBufferBase::readLine
virtual qint64 readLine(char *data, qint64 maxlen)=0
Reads a line from the buffer and discards it.
KIOBufferBase::setSize
virtual bool setSize(qint64 size)=0
Sets the size of the buffer, if allowed.
KIOBufferBase::consumeBuffer
virtual qint64 consumeBuffer(char *data, qint64 maxlen, bool discard=true)=0
Consumes data from the beginning of the buffer.
KIOBufferBase::feedBuffer
virtual qint64 feedBuffer(const char *data, qint64 len)=0
Adds data to the end of the buffer.
KIOBufferBase::length
virtual qint64 length() const =0
Returns the number of bytes in the buffer.
KIOBufferBase::size
virtual qint64 size() const =0
Retrieves the buffer size.
KIOBufferBase::~KIOBufferBase
virtual ~KIOBufferBase()
Virtual destructor.
Definition: k3iobuffer.h:62
KIOBufferBase::KIOBufferBase
KIOBufferBase(const KIOBufferBase &)
Copy constructor.
Definition: k3iobuffer.h:56
qint64
kdecore_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal