Clean out some bugs in sender

This commit is contained in:
Keith Winstein
2011-08-09 02:34:20 -04:00
parent cae526fceb
commit 188c44f5be
10 changed files with 142 additions and 46 deletions
+12 -4
View File
@@ -1,6 +1,7 @@
#ifndef KEYSTROKE_HPP
#define KEYSTROKE_HPP
#include <deque>
#include <string>
#include <assert.h>
@@ -9,10 +10,17 @@ using namespace std;
class KeyStroke
{
public:
void subtract( KeyStroke * const ) {}
string diff_from( KeyStroke const &, int ) { return ""; }
void apply_string( string ) {}
bool operator==( KeyStroke const & ) const { return true; }
deque<char> user_bytes;
KeyStroke() : user_bytes() {}
void key_hit( char x ) { user_bytes.push_back( x ); }
/* interface for Network::Transport */
void subtract( KeyStroke * const prefix );
string diff_from( KeyStroke const & existing, int length_limit );
void apply_string( string diff );
bool operator==( KeyStroke const &x ) const { return user_bytes == x.user_bytes; }
};
#endif