MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
InputStream Class Reference

#include <input.h>

Collaboration diagram for InputStream:

Public Member Functions

 InputStream (std::istream &in)
 
 ~InputStream (void)
 
char get (void)
 
std::istream & get (char &ch)
 
InputStreamputback (char ch)
 
unsigned long int GetLineNumber (void) const
 
bool eof (void) const
 
const std::istream & GetStream (void) const
 
std::istream & GetStream (void)
 

Private Attributes

std::istream & iStrm
 
unsigned long uLineNumber
 

Friends

InputStreamoperator>> (InputStream &in, int &i)
 
InputStreamoperator>> (InputStream &in, long int &i)
 
InputStreamoperator>> (InputStream &in, short int &i)
 
InputStreamoperator>> (InputStream &in, unsigned int &i)
 
InputStreamoperator>> (InputStream &in, unsigned long int &i)
 
InputStreamoperator>> (InputStream &in, unsigned short int &i)
 
InputStreamoperator>> (InputStream &in, char &i)
 
InputStreamoperator>> (InputStream &in, float &i)
 
InputStreamoperator>> (InputStream &in, double &i)
 

Detailed Description

Definition at line 44 of file input.h.

Constructor & Destructor Documentation

InputStream::InputStream ( std::istream &  in)

Definition at line 41 of file input.cc.

References NO_OP.

42 : iStrm(in), uLineNumber(1)
43 {
44  NO_OP;
45 }
#define NO_OP
Definition: myassert.h:74
unsigned long uLineNumber
Definition: input.h:57
std::istream & iStrm
Definition: input.h:56
InputStream::~InputStream ( void  )

Definition at line 48 of file input.cc.

References NO_OP.

48  {
49  NO_OP;
50 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

bool InputStream::eof ( void  ) const
inline

Definition at line 139 of file input.h.

References iStrm.

Referenced by HighParser::GetDescription(), HighParser::GetString(), HighParser::GetStringWithDelims(), MathParser::GetToken(), LowParser::PackWords(), MathParser::readplugin(), and skip_remarks().

140 {
141  return iStrm.eof();
142 }
std::istream & iStrm
Definition: input.h:56
char InputStream::get ( void  )
inline

Definition at line 99 of file input.h.

References iStrm, and uLineNumber.

Referenced by HighParser::GetString(), HighParser::GetStringWithDelims(), MathParser::GetToken(), LowParser::PackWords(), HighParser::ParseWord(), MathParser::readplugin(), and skip_remarks().

100 {
101  char ch = iStrm.get();
102  if (ch == '\n') {
103  uLineNumber++;
104  }
105  return ch;
106 }
unsigned long uLineNumber
Definition: input.h:57
std::istream & iStrm
Definition: input.h:56
std::istream & InputStream::get ( char &  ch)
inline

Definition at line 110 of file input.h.

References iStrm, and uLineNumber.

111 {
112  std::istream& i = iStrm.get(ch);
113  if (ch == '\n') {
114  uLineNumber++;
115  }
116  return i;
117 }
unsigned long uLineNumber
Definition: input.h:57
std::istream & iStrm
Definition: input.h:56
unsigned long int InputStream::GetLineNumber ( void  ) const
inline

Definition at line 132 of file input.h.

References uLineNumber.

Referenced by MathParser::GetLineNumber().

133 {
134  return uLineNumber;
135 }
unsigned long uLineNumber
Definition: input.h:57
const std::istream & InputStream::GetStream ( void  ) const
inline

Definition at line 146 of file input.h.

References iStrm.

Referenced by MathParser::GetToken().

147 {
148  return iStrm;
149 }
std::istream & iStrm
Definition: input.h:56
std::istream & InputStream::GetStream ( void  )
inline

Definition at line 152 of file input.h.

References iStrm.

153 {
154  return iStrm;
155 }
std::istream & iStrm
Definition: input.h:56
InputStream & InputStream::putback ( char  ch)
inline

Friends And Related Function Documentation

InputStream& operator>> ( InputStream in,
int i 
)
friend

Definition at line 52 of file input.cc.

53 {
54  in.iStrm >> i;
55  return in;
56 }
std::istream & iStrm
Definition: input.h:56
InputStream& operator>> ( InputStream in,
long int i 
)
friend

Definition at line 58 of file input.cc.

59 {
60  in.iStrm >> i;
61  return in;
62 }
std::istream & iStrm
Definition: input.h:56
InputStream& operator>> ( InputStream in,
short int i 
)
friend

Definition at line 64 of file input.cc.

65 {
66  in.iStrm >> i;
67  return in;
68 }
std::istream & iStrm
Definition: input.h:56
InputStream& operator>> ( InputStream in,
unsigned int i 
)
friend

Definition at line 70 of file input.cc.

71 {
72  in.iStrm >> i;
73  return in;
74 }
std::istream & iStrm
Definition: input.h:56
InputStream& operator>> ( InputStream in,
unsigned long int i 
)
friend

Definition at line 76 of file input.cc.

77 {
78  in.iStrm >> i;
79  return in;
80 }
std::istream & iStrm
Definition: input.h:56
InputStream& operator>> ( InputStream in,
unsigned short int i 
)
friend

Definition at line 82 of file input.cc.

83 {
84  in.iStrm >> i;
85  return in;
86 }
std::istream & iStrm
Definition: input.h:56
InputStream& operator>> ( InputStream in,
char &  i 
)
friend

Definition at line 88 of file input.cc.

89 {
90  in.iStrm >> i;
91  return in;
92 }
std::istream & iStrm
Definition: input.h:56
InputStream& operator>> ( InputStream in,
float &  i 
)
friend

Definition at line 94 of file input.cc.

95 {
96  in.iStrm >> i;
97  return in;
98 }
std::istream & iStrm
Definition: input.h:56
InputStream& operator>> ( InputStream in,
double &  i 
)
friend

Definition at line 100 of file input.cc.

101 {
102  in.iStrm >> i;
103  return in;
104 }
std::istream & iStrm
Definition: input.h:56

Member Data Documentation

std::istream& InputStream::iStrm
private

Definition at line 56 of file input.h.

Referenced by eof(), get(), GetStream(), operator>>(), and putback().

unsigned long InputStream::uLineNumber
private

Definition at line 57 of file input.h.

Referenced by get(), GetLineNumber(), and putback().


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