diff options
Diffstat (limited to 'src/statesync/user.cc')
-rw-r--r-- | src/statesync/user.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/statesync/user.cc b/src/statesync/user.cc index 3315c4d..b1da825 100644 --- a/src/statesync/user.cc +++ b/src/statesync/user.cc @@ -43,12 +43,12 @@ using namespace ClientBuffers; void UserStream::subtract( const UserStream *prefix ) { - // if we are subtracting ourself from ourself, just clear the deque + // if we are subtracting ourself from ourself, just clear the std::deque if ( this == prefix ) { actions.clear(); return; } - for ( deque<UserEvent>::const_iterator i = prefix->actions.begin(); + for ( std::deque<UserEvent>::const_iterator i = prefix->actions.begin(); i != prefix->actions.end(); i++ ) { assert( this != prefix ); @@ -58,11 +58,11 @@ void UserStream::subtract( const UserStream *prefix ) } } -string UserStream::diff_from( const UserStream &existing ) const +std::string UserStream::diff_from( const UserStream &existing ) const { - deque<UserEvent>::const_iterator my_it = actions.begin(); + std::deque<UserEvent>::const_iterator my_it = actions.begin(); - for ( deque<UserEvent>::const_iterator i = existing.actions.begin(); + for ( std::deque<UserEvent>::const_iterator i = existing.actions.begin(); i != existing.actions.end(); i++ ) { assert( my_it != actions.end() ); @@ -80,7 +80,7 @@ string UserStream::diff_from( const UserStream &existing ) const /* can we combine this with a previous Keystroke? */ if ( (output.instruction_size() > 0) && (output.instruction( output.instruction_size() - 1 ).HasExtension( keystroke )) ) { - output.mutable_instruction( output.instruction_size() - 1 )->MutableExtension( keystroke )->mutable_keys()->append( string( &the_byte, 1 ) ); + output.mutable_instruction( output.instruction_size() - 1 )->MutableExtension( keystroke )->mutable_keys()->append( std::string( &the_byte, 1 ) ); } else { Instruction *new_inst = output.add_instruction(); new_inst->MutableExtension( keystroke )->set_keys( &the_byte, 1 ); @@ -105,14 +105,14 @@ string UserStream::diff_from( const UserStream &existing ) const return output.SerializeAsString(); } -void UserStream::apply_string( const string &diff ) +void UserStream::apply_string( const std::string &diff ) { ClientBuffers::UserMessage input; fatal_assert( input.ParseFromString( diff ) ); for ( int i = 0; i < input.instruction_size(); i++ ) { if ( input.instruction( i ).HasExtension( keystroke ) ) { - string the_bytes = input.instruction( i ).GetExtension( keystroke ).keys(); + std::string the_bytes = input.instruction( i ).GetExtension( keystroke ).keys(); for ( unsigned int loc = 0; loc < the_bytes.size(); loc++ ) { actions.push_back( UserEvent( UserByte( the_bytes.at( loc ) ) ) ); } |