Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ------------------------------------------------------------------------------------
- String File::ReadWord()
- {
- String word;
- UByte letter;
- Bool done = false;
- // Trim any spaces possibly preceeding the actual text
- while(!End && !done)
- {
- letter = Read<UByte>();
- if(std::isalnum(letter))
- {
- // Append the letter and begin parsing the rest of the word
- word += letter;
- done = true;
- }
- else
- {
- // Discard this letter by not doing anything
- }
- }
- done = false;
- while(!End && !done)
- {
- letter = Read<UByte>();
- if(std::isalnum(letter))
- {
- // Append the letter and continue parsing the rest of the word
- word += letter;
- }
- else
- {
- // Character past the end of the word means we're done
- done = true;
- }
- }
- return word;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement