![]() |
【转帖】oddbtextiterator with zero-length string
oddbtextiterator with zero-length string
oddbtextiterator with zero-length string hello- it appears to me that if an oddbtextiterator is initialized with a string of zero length, then the current properties field is not initialized correctly. this structure includes a field, blastchar, that can be used to determine if the iterator is at the end of the string. this field is not set upon initialization, and so testing it, then calling nextchar() when blastchar is false, will attempt to read a character (though nextchar() returns 0 and then sets blastchar). shouldn't this field be set upon initialization of the oddbtextiterator? is there something else i am missing? is there a better way to test if an iterator is at its end that is initialized immediately? thanks, mike ryan hello, you are right. the current properties are valid after call nextchar(). it is as design. quote: is there a better way to test if an iterator is at its end that is initialized immediately? you can avoid using textiterator for empty string via test odstring.isempty() befor init it. best regards, sergey z. |
所有的时间均为北京时间。 现在的时间是 07:45 AM. |