EPANET  3.0
EPANET Development Project
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
InputReader Class Reference

Reads lines of project input data from a text file. More...

#include <inputreader.h>

Public Types

enum  Section {
  TITLE, JUNCTION, RESERVOIR, TANK,
  PIPE, PUMP, VALVE, PATTERN,
  CURVE, CONTROL, RULE, EMITTER,
  DEMAND, STATUS, ROUGHNESS, LEAKAGE,
  ENERGY, QUALITY, SOURCE, REACTION,
  MIXING, OPTION, TIME, REPORT,
  COORD, VERTICES, LABEL, MAP,
  BACKDROP, TAG, END
}
 

Public Member Functions

void readFile (const char *inpFile, Network *network)
 

Protected Member Functions

void parseFile (std::istream &fin, InputParser &parser)
 
void trimLine (std::string &line)
 
void findSection (std::string &token)
 

Protected Attributes

std::istringstream sin
 string stream containing a line of input
 
int errcount
 error count
 
int section
 file section being processed
 

Detailed Description

Reads lines of project input data from a text file.

The reader makes two passes through the project's input file - once using the ObjectParser to identify and create each element (node, link, pattern, etc.) in the network and then using the PropertyParser to read the properties assigned to each of these elements. This two-pass approach allows the description of the elements to appear in any order in the file.


The documentation for this class was generated from the following files: