Table of Contents

 
_EatWhite
 

Purpose

Chomps white space in a file so that long string data doesn't catch leading or trailing spaces

 

Protoype

void CTextMngr::_EatWhite (ifstream& is)

 

Parameters

is the file input stream to extract white space from
 

Description

Some data to be loaded from file comes in a long string format:

this is a whole bunch of text!*

A normal read with the << operator would only extract "this" from that line since the space after "this" would stop the extraction. Therefore GetLine() is used, with an asterisk (*) as the terminating symbol. When line reads are done like this there is the chance that extra spaces may be prepended or appended to the resulting string. This fiunction deals with any extra spaces up to the next character.

 

Use

This is a private member function

 

Prev: Table of Contents
Next: AddFont