- Timestamp:
- Nov 29, 2009, 2:47:54 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/libraries/core/input/InputBuffer.cc
r6105 r6177 41 41 this->buffer_ = ""; 42 42 this->cursor_ = 0; 43 this->maxLength_ = 1024; 43 44 this->allowedChars_ = "abcdefghijklmnopqrstuvwxyz \ 44 45 ABCDEFGHIJKLMNOPQRSTUVWXYZ \ … … 59 60 RegisterRootObject(InputBuffer); 60 61 62 this->maxLength_ = 1024; 61 63 this->allowedChars_ = allowedChars; 62 64 this->buffer_ = ""; … … 93 95 } 94 96 97 void InputBuffer::setMaxLength(unsigned int length) 98 { 99 this->maxLength_ = length; 100 if (this->buffer_.size() > length) 101 this->buffer_.resize(length); 102 } 103 95 104 void InputBuffer::set(const std::string& input, bool update) 96 105 { … … 117 126 if (this->charIsAllowed(input)) 118 127 { 128 if (this->buffer_.size() >= this->maxLength_) 129 return; 119 130 this->buffer_.insert(this->cursor_, 1, input); 120 131 ++this->cursor_;
Note: See TracChangeset
for help on using the changeset viewer.