IBR-DTNSuite  0.12
TarUtils.h
Go to the documentation of this file.
1 /*
2  * TarUtils.h
3  *
4  * Copyright (C) 2013 IBR, TU Braunschweig
5  *
6  * Written-by: David Goltzsche <goltzsch@ibr.cs.tu-bs.de>
7  * Johannes Morgenroth <morgenroth@ibr.cs.tu-bs.de>
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  * Created on: Sep 16, 2013
22  */
23 
24 #ifndef TARUTILS_H_
25 #define TARUTILS_H_
26 #include "config.h"
27 #include "io/ObservedFile.h"
28 #include <ibrcommon/data/File.h>
29 #include <set>
30 
31 namespace io
32 {
33  class TarUtils
34  {
35  public:
36  TarUtils();
37  virtual ~TarUtils();
38 
42  static void write( std::ostream &output, const io::ObservedFile &root, const std::set<ObservedFile> &files_to_send );
43 
44  /*
45  * read tar archive from payload block, write to file
46  */
47  static void read( const ibrcommon::File &extract_folder, std::istream &input );
48 
49  private:
50  static std::string rel_filename(const ObservedFile &parent, const ObservedFile&);
51  };
52 }
53 
54 #endif /* TARUTILS_H_ */