PSCF v1.1
ioUtil.h
1#ifndef UTIL_IO_UTIL_H
2#define UTIL_IO_UTIL_H
3
4/*
5* Util Package - C++ Utilities for Scientific Computation
6*
7* Copyright 2010 - 2017, The Regents of the University of Minnesota
8* Distributed under the terms of the GNU General Public License.
9*/
10
11#include <string>
12#include <iostream>
13#include <sstream>
14
15namespace Util
16{
17
25 std::string toString(int n);
26
35 int rStrip(std::string& string);
36
47 void checkString(std::istream& in, const std::string& expected);
48
59 bool getLine(std::istream& in, std::stringstream& line);
60
72 bool getNextLine(std::istream& in, std::string& line);
73
85 bool getNextLine(std::istream& in, std::stringstream& line);
86
94 void checkRequiredIstream(std::istream& in);
95
96}
97#endif
void checkString(std::istream &in, const std::string &expected)
Extract string from stream, and compare to expected value.
Definition: ioUtil.cpp:37
bool getNextLine(std::istream &in, std::string &line)
Read the next non-empty line into a string, strip trailing whitespace.
Definition: ioUtil.cpp:79
std::string toString(int n)
Return string representation of an integer.
Definition: ioUtil.cpp:52
int rStrip(std::string &str)
Strip trailing whitespace from a string.
Definition: ioUtil.cpp:18
bool getLine(std::istream &in, std::stringstream &line)
Read the next line into a stringstream.
Definition: ioUtil.cpp:62
Utility classes for scientific computation.
Definition: accumulators.mod:1
void checkRequiredIstream(std::istream &in)
Check status of a std::istream just before reading required variable.
Definition: ioUtil.cpp:124