Compress all instructions (closes #19 github issue)

This commit is contained in:
Keith Winstein
2012-02-26 04:39:13 -05:00
parent f0886a1dda
commit 7a9f92d7f1
7 changed files with 80 additions and 4 deletions
+28
View File
@@ -0,0 +1,28 @@
#ifndef COMPRESSOR_H
#define COMPRESSOR_H
#include <string>
namespace Network {
class Compressor {
private:
static const int BUFFER_SIZE = 2048 * 2048; /* effective limit on terminal size */
unsigned char *buffer;
public:
Compressor() : buffer( NULL ) { buffer = new unsigned char[ BUFFER_SIZE ]; }
~Compressor() { if ( buffer ) { delete[] buffer; } }
std::string compress_str( const std::string input );
std::string uncompress_str( const std::string input );
/* unused */
Compressor( const Compressor & );
Compressor & operator=( const Compressor & );
};
Compressor & get_compressor( void );
}
#endif