Blame view

src/PostProcessing/ZipPostProcessing.hh 1.13 KB
fbe3c2bb   Benjamin Renard   First commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
 * ZipPostProcessing.hh
 *
 *  Created on: 25 sept. 2013
 *      Author: CS
 */

#ifndef ZIPPOSTPROCESSING_HH_
#define ZIPPOSTPROCESSING_HH_

#include <fstream>
#include <vector>
#include "PostProcessing.hh"

namespace postprocessing {

class ZipPostProcessing: public PostProcessing {
public:
	ZipPostProcessing();
	ZipPostProcessing(const std::string& pParentName);
	virtual ~ZipPostProcessing();

	/**
	 * Applies post-processing.
	 */
	void apply(PostProcessingAble* pOutput);

	/**
	 * Compresses a list of files.
	 */
	static std::string zip(const std::vector<std::string>& pFiles, const std::string& pPrefix = std::string(),
			const std::string& pOutDir = std::string());

	/**
	 * Registers related node and process.
	 */
	void registerChildList(
			std::map<std::string,
					boost::shared_ptr<AMDA::XMLConfigurator::NodeCfg>>& childList);

private:

	/**
	 * Artificial attribute to force self-registering to post-processing factory
	 */
	static std::string _key;
	
	/**
	 * Output file extension
	 */
	static const std::string EXTENSION;

	std::string _parentName;

};

} /* namespace postprocessing */
#endif /* ZIPPOSTPROCESSING_HH_ */