Krita Source Code Documentation
Loading...
Searching...
No Matches
KoStore.cpp File Reference
#include "KoStore.h"
#include "KoStore_p.h"
#include "KoQuaZipStore.h"
#include "KoDirectoryStore.h"
#include <QBuffer>
#include <QFileInfo>
#include <QFile>
#include <QUrl>
#include <StoreDebug.h>
#include <KConfig>
#include <KSharedConfig>
#include <KConfigGroup>

Go to the source code of this file.

Macros

#define DefaultFormat   KoStore::Zip
 

Functions

static KoStore::Backend determineBackend (QIODevice *dev)
 

Macro Definition Documentation

◆ DefaultFormat

#define DefaultFormat   KoStore::Zip

Definition at line 27 of file KoStore.cpp.

Function Documentation

◆ determineBackend()

static KoStore::Backend determineBackend ( QIODevice * dev)
static

Definition at line 29 of file KoStore.cpp.

30{
31 unsigned char buf[5];
32 if (dev->read((char *)buf, 4) < 4)
33 return DefaultFormat; // will create a "bad" store (bad()==true)
34 if (buf[0] == 'P' && buf[1] == 'K' && buf[2] == 3 && buf[3] == 4)
35 return KoStore::Zip;
36 return DefaultFormat; // fallback
37}
#define DefaultFormat
Definition KoStore.cpp:27
@ Zip
Definition KoStore.h:30

References DefaultFormat, and KoStore::Zip.