TarReader.h
1/* Copyright (C) 2008 Marc Boris Duerner
2 SPDX-License-Identifier: LGPL-2.1-or-later WITH mif-exception
3*/
4
5#ifndef PT_SYSTEM_TAR_READER_H
6#define PT_SYSTEM_TAR_READER_H
7
8#include <Pt/System/Api.h>
9#include <Pt/System/TarEntry.h>
10
11#include <istream>
12#include <ios>
13#include <cstddef>
14
15namespace Pt {
16
17namespace System {
18
89class PT_SYSTEM_API TarReader
90{
91 public:
92 using Entry = TarEntry;
93
94 public:
98
101 explicit TarReader(std::istream& is);
102
106
112 void attach(std::istream& is);
113
119 void detach();
120
123 void reset();
124
129 void reset(std::istream& is);
130
149 const TarEntry* advance(std::streamsize importSize = 0);
150
153 bool isEnd() const;
154
155 private:
156 TarReader(const TarReader&);
157
158 TarReader& operator=(const TarReader&);
159
160 private:
161 class TarReaderImpl* _impl;
162};
163
164} // namespace System
165
166} // namespace Pt
167
168#endif // PT_SYSTEM_TAR_READER_H
One entry in a tar archive.
Definition TarEntry.h:72
TarReader(std::istream &is)
Creates a reader that parses is.
void reset(std::istream &is)
Clears the parse state and attaches is.
~TarReader()
Destructor.
const TarEntry * advance(std::streamsize importSize=0)
Parses the next header or delivers the next content chunk.
void attach(std::istream &is)
Attaches is as the source.
void detach()
Detaches the current source.
TarReader()
Creates a reader with no stream attached.
void reset()
Clears the parse state and detaches the source.
bool isEnd() const
Returns true after the end-of-archive marker has been read.
System programming
Definition Connection.h:26
Core module.
Definition Allocator.h:33