Canorus
0.7
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
core
archive.h
Go to the documentation of this file.
1
8
#ifndef ARCHIVE_H_
9
#define ARCHIVE_H_
10
11
#include <QBuffer>
12
#include "
core/tar.h
"
13
#include <iostream>
14
15
class
QByteArray;
16
class
QString;
17
18
class
CAArchive
{
19
public
:
20
CAArchive
();
21
CAArchive
(QIODevice& arch);
22
qint64
write
(QIODevice& dest);
23
virtual
~CAArchive
();
24
25
// interface to CATar
26
inline
bool
addFile
(
const
QString& filename, QIODevice& data) {
if
(!
error
())
return
_tar
->
addFile
(filename, data);
else
return
false
; }
27
inline
bool
addFile
(
const
QString& filename, QByteArray data) {
if
(!
error
())
return
_tar
->
addFile
(filename, data);
else
return
false
; }
28
inline
void
removeFile
(
const
QString& filename) {
if
(!
error
())
_tar
->
removeFile
(filename); }
29
inline
CAIOPtr
file
(
const
QString& filename) {
if
(!
error
())
return
_tar
->
file
(filename);
else
return
CAIOPtr
(
new
QBuffer()); }
30
inline
bool
error
() {
return
_err
||
_tar
->
error
(); }
31
inline
const
QString&
version
() {
return
_version
; }
32
protected
:
33
static
const
int
CHUNK
;
34
static
const
QString
COMMENT
;
35
36
QString
_version
;
37
bool
_err
;
38
void
parse
(QIODevice&);
39
int
getOS
();
40
41
CATar
*
_tar
;
42
};
43
44
#endif
/* ARCHIVE_H_ */
Generated on Fri Jan 11 2013 14:40:12 for Canorus by
1.8.3