-void notify(){
- m_entityKeyValueChanged();
- KeyObservers::reverse_iterator i = m_observers.rbegin();
- while ( i != m_observers.rend() )
- {
- ( *i++ )( c_str() );
+ void attach( const KeyObserver& observer ){
+ ( *m_observers.insert ( observer ) )( c_str() );
+ }
+ void detach( const KeyObserver& observer ){
+ observer( m_empty );
+ m_observers.erase( observer );
+ }
+ const char* c_str() const {
+ if ( string_empty( m_string.c_str() ) ) {
+ return m_empty;
+ }
+ return m_string.c_str();
+ }
+ void assign( const char* other ){
+ if ( !string_equal( m_string.c_str(), other ) ) {
+ m_undo.save();
+ m_string = other;
+ notify();
+ }
+ }
+
+ void notify(){
+ m_entityKeyValueChanged();
+ KeyObservers::reverse_iterator i = m_observers.rbegin();
+ while ( i != m_observers.rend() )
+ {
+ ( *i++ )( c_str() );
+ }