aboutsummaryrefslogtreecommitdiff
path: root/src/unstable/archivestream.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2014-10-03 15:54:36 +0000
committerMike Buland <eichlan@xagasoft.com>2014-10-03 15:54:36 +0000
commit0f26ab693e82d1c56ea0be653a8cd670abeb8f89 (patch)
tree34006fd7690a23a7ec49160398390d6c31e642e8 /src/unstable/archivestream.h
parentc5f69c22ca51510da1674bf56982f8f1e3ca4a40 (diff)
downloadlibbu++-0f26ab693e82d1c56ea0be653a8cd670abeb8f89.tar.gz
libbu++-0f26ab693e82d1c56ea0be653a8cd670abeb8f89.tar.bz2
libbu++-0f26ab693e82d1c56ea0be653a8cd670abeb8f89.tar.xz
libbu++-0f26ab693e82d1c56ea0be653a8cd670abeb8f89.zip
Tweaked Bu::Uuid loading to pad it's data more cleanly. This will help ensure
that we don't get valgrind errors, and is probably safer in general. Added Bu::ArchiveStream. It could use some tweaks, but as a quick hack it's handy to allow systems that can only read/write from/to streams to work with archives.
Diffstat (limited to '')
-rw-r--r--src/unstable/archivestream.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/unstable/archivestream.h b/src/unstable/archivestream.h
new file mode 100644
index 0000000..a8ef903
--- /dev/null
+++ b/src/unstable/archivestream.h
@@ -0,0 +1,49 @@
1/*
2 * Copyright (C) 2007-2014 Xagasoft, All rights reserved.
3 *
4 * This file is part of the libbu++ library and is released under the
5 * terms of the license contained in the file LICENSE.
6 */
7#ifndef BU_ARCHIVE_STREAM_H
8#define BU_ARCHIVE_STREAM_H
9
10#include "bu/archivebase.h"
11#include "bu/stream.h"
12
13namespace Bu
14{
15 class ArchiveStream : public Stream
16 {
17 public:
18 ArchiveStream( Bu::ArchiveBase &ar );
19 virtual ~ArchiveStream();
20
21 virtual void close();
22 virtual size read( void *pBuf, size iBytes );
23 virtual size write( const void *pBuf, size iBytes );
24 virtual size tell();
25 virtual void seek( size offset );
26 virtual void setPos( size pos );
27 virtual void setPosEnd( size pos );
28 virtual bool isEos();
29 virtual bool isOpen();
30 virtual void flush();
31 virtual bool canRead();
32 virtual bool canWrite();
33 virtual bool isReadable();
34 virtual bool isWritable();
35 virtual bool isSeekable();
36 virtual bool isBlocking();
37 virtual void setBlocking( bool bBlocking=true );
38 virtual void setSize( size iSize );
39 virtual size getSize() const;
40 virtual size getBlockSize() const;
41 virtual Bu::String getLocation() const;
42
43 private:
44 Bu::ArchiveBase &ar;
45 size iPos;
46 };
47}
48
49#endif