Changeset 1313 for code/branches/console/src/core/InputBuffer.h
- Timestamp:
- May 17, 2008, 3:58:19 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/console/src/core/InputBuffer.h
r1312 r1313 102 102 } 103 103 104 void set(const std::string& input); 105 void append(const std::string& input); 106 void append(const char& input); 107 void removeLast(); 108 void clear(); 104 void unregisterListener(InputBufferListener* listener); 105 106 void set(const std::string& input, bool update = true); 107 void insert(const std::string& input, bool update = true); 108 void insert(const char& input, bool update = true); 109 void clear(bool update = true); 110 void removeAtCursor(bool update = true); 111 void removeBehindCursor(bool update = true); 109 112 110 113 void updated(); … … 113 116 inline std::string get() const 114 117 { return this->buffer_; } 118 inline unsigned int getSize() const 119 { return this->buffer_.size(); } 120 121 inline unsigned int getCursorPosition() const 122 { return this->cursor_; } 123 inline void setCursorPosition(unsigned int cursor) 124 { if (cursor <= this->buffer_.size()) { this->cursor_ = cursor; } } 125 inline void setCursorToEnd() 126 { this->cursor_ = this->buffer_.size(); } 127 inline void setCursorToBegin() 128 { this->cursor_ = 0; } 129 inline void increaseCursor() 130 { if (this->cursor_ < this->buffer_.size()) { ++this->cursor_; } } 131 inline void decreaseCursor() 132 { if (this->cursor_ > 0) { --this->cursor_; } } 115 133 116 134 private: … … 124 142 std::list<InputBufferListenerTuple> listeners_; 125 143 std::string allowedChars_; 144 unsigned int cursor_; 126 145 }; 127 146 }
Note: See TracChangeset
for help on using the changeset viewer.