clockUtils  1.1
Compression.h
Go to the documentation of this file.
1 /*
2  * clockUtils
3  * Copyright (2015) Michael Baer, Daniel Bonrath, All rights reserved.
4  *
5  * This file is part of clockUtils; clockUtils is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
25 #ifndef __CLOCKUTILS_COMPRESSION_COMPRESSION_H__
26 #define __CLOCKUTILS_COMPRESSION_COMPRESSION_H__
27 
28 #include <string>
29 
30 namespace clockUtils {
31 
32  enum class ClockError;
33 
34 namespace compression {
35 
39  template<typename Algorithm>
40  class Compression {
41  public:
45  ClockError compress(const std::string & uncompressed, std::string & compressed) const {
46  return Algorithm::compress(uncompressed, compressed);
47  }
48 
52  ClockError decompress(const std::string & compressed, std::string & decompressed) const {
53  return Algorithm::decompress(compressed, decompressed);
54  }
55  };
56 
57 } /* namespace compression */
58 } /* namespace clockUtils */
59 
60 #endif /* __CLOCKUTILS_COMPRESSION_COMPRESSION_H__ */
61 
ClockError decompress(const std::string &compressed, std::string &decompressed) const
decompresses the given string and returns result
Definition: Compression.h:52
class for string compression and decompression using Algorithm as template parameter ...
Definition: Compression.h:40
ClockError compress(const std::string &uncompressed, std::string &compressed) const
compresses the given string and returns result
Definition: Compression.h:45
ClockError
Definition: errors.h:30