Krita Source Code Documentation
Loading...
Searching...
No Matches
KoStoreDevice Class Reference

#include <KoStoreDevice.h>

+ Inheritance diagram for KoStoreDevice:

Public Member Functions

bool atEnd () const override
 
void close () override
 
bool isSequential () const override
 
 KoStoreDevice (KoStore *store)
 Note: KoStore::open() should be called before calling this.
 
bool open (OpenMode m) override
 
qint64 pos () const override
 
bool seek (qint64 pos) override
 
qint64 size () const override
 
 ~KoStoreDevice () override
 

Protected Member Functions

qint64 readData (char *data, qint64 maxlen) override
 
qint64 writeData (const char *data, qint64 len) override
 

Protected Attributes

KoStorem_store
 

Detailed Description

This class implements a QIODevice around KoStore, so that it can be used to create a QDomDocument from it, to be written or read using QDataStream or to be written using QTextStream

Definition at line 19 of file KoStoreDevice.h.

Constructor & Destructor Documentation

◆ KoStoreDevice()

KoStoreDevice::KoStoreDevice ( KoStore * store)
inlineexplicit

Note: KoStore::open() should be called before calling this.

Definition at line 24 of file KoStoreDevice.h.

24 : m_store(store) {
25 // calligra-1.x behavior compat: a KoStoreDevice is automatically open
26 setOpenMode(m_store->mode() == KoStore::Read ? QIODevice::ReadOnly : QIODevice::WriteOnly);
27 }
KoStore * m_store
@ Read
Definition KoStore.h:29
Mode mode() const
Definition KoStore.cpp:420

References KoStore::Read.

◆ ~KoStoreDevice()

KoStoreDevice::~KoStoreDevice ( )
override

Definition at line 9 of file KoStoreDevice.cpp.

10{
11}

Member Function Documentation

◆ atEnd()

bool KoStoreDevice::atEnd ( ) const
inlineoverride

Definition at line 58 of file KoStoreDevice.h.

58 {
59 return m_store->atEnd();
60 }
bool atEnd() const
Definition KoStore.cpp:353

◆ close()

void KoStoreDevice::close ( )
inlineoverride

Definition at line 42 of file KoStoreDevice.h.

42{}

◆ isSequential()

bool KoStoreDevice::isSequential ( ) const
inlineoverride

Definition at line 30 of file KoStoreDevice.h.

30 {
31 return true;
32 }

◆ open()

bool KoStoreDevice::open ( OpenMode m)
inlineoverride

Definition at line 34 of file KoStoreDevice.h.

34 {
35 setOpenMode(m);
36 if (m & QIODevice::ReadOnly)
37 return (m_store->mode() == KoStore::Read);
38 if (m & QIODevice::WriteOnly)
39 return (m_store->mode() == KoStore::Write);
40 return false;
41 }
@ Write
Definition KoStore.h:29

References KoStore::Read, and KoStore::Write.

◆ pos()

qint64 KoStoreDevice::pos ( ) const
inlineoverride

Definition at line 52 of file KoStoreDevice.h.

52 {
53 return m_store->pos();
54 }
qint64 pos() const
Definition KoStore.cpp:347

◆ readData()

qint64 KoStoreDevice::readData ( char * data,
qint64 maxlen )
inlineoverrideprotected

Definition at line 65 of file KoStoreDevice.h.

65 {
66 return m_store->read(data, maxlen);
67 }
QByteArray read(qint64 max)
Definition KoStore.cpp:181

References KoStore::read().

◆ seek()

bool KoStoreDevice::seek ( qint64 pos)
inlineoverride

Definition at line 55 of file KoStoreDevice.h.

55 {
56 return m_store->seek(pos);
57 }
qint64 pos() const override
bool seek(qint64 pos)
See QIODevice.
Definition KoStore.cpp:341

◆ size()

qint64 KoStoreDevice::size ( ) const
inlineoverride

Definition at line 44 of file KoStoreDevice.h.

44 {
45 if (m_store->mode() == KoStore::Read)
46 return m_store->size();
47 else
48 return 0xffffffff;
49 }
qint64 size() const
Definition KoStore.cpp:239

References KoStore::Read.

◆ writeData()

qint64 KoStoreDevice::writeData ( const char * data,
qint64 len )
inlineoverrideprotected

Definition at line 69 of file KoStoreDevice.h.

69 {
70 return m_store->write(data, len);
71 }
qint64 write(const QByteArray &data)
Definition KoStore.cpp:198

References KoStore::write().

Member Data Documentation

◆ m_store

KoStore* KoStoreDevice::m_store
protected

Definition at line 63 of file KoStoreDevice.h.


The documentation for this class was generated from the following files: