Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef CODE_HPP
- #define CODE_HPP
- #include <map>
- #include <queue>
- #include <fstream>
- #include <cstdint>
- #include "node.hpp"
- #include "tree.hpp"
- enum struct opentype: bool
- {
- BINARY,
- PLAIN
- };
- class compr
- {
- public:
- compr(std::string &infile_, const opentype opentype_);
- virtual ~compr() = 0;
- protected:
- std::ifstream infile;
- std::map<char, int> histog;
- };
- class compress: public compr
- {
- public:
- compress(std::string infile_);
- void write(const std::string outfile_);
- };
- class decompress: public compr
- {
- public:
- decompress(std::string infile_);
- std::string plaintext() const;
- private:
- uint16_t stream_offset;
- std::string ptext;
- void getplain(const tree &hc);
- };
- #endif // CODE_HPP
Advertisement
Add Comment
Please, Sign In to add comment