diff options
-rw-r--r-- | Carpet/CarpetLib/src/defs.cc | 9 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/defs.hh | 5 |
2 files changed, 12 insertions, 2 deletions
diff --git a/Carpet/CarpetLib/src/defs.cc b/Carpet/CarpetLib/src/defs.cc index 09a078141..f912d28a0 100644 --- a/Carpet/CarpetLib/src/defs.cc +++ b/Carpet/CarpetLib/src/defs.cc @@ -71,6 +71,15 @@ void consume (istream& is, const char c) { +void consume (istream& is, const char * const s) { + for (const char * p = s; * p; ++ p) { + expect (is, * p); + is.get(); + } +} + + + // Vector input template<class T> istream& input (istream& is, vector<T>& v) { diff --git a/Carpet/CarpetLib/src/defs.hh b/Carpet/CarpetLib/src/defs.hh index 3e2bc1734..3ad0becec 100644 --- a/Carpet/CarpetLib/src/defs.hh +++ b/Carpet/CarpetLib/src/defs.hh @@ -70,8 +70,9 @@ T ipow (T x, int y); // Input streams struct input_error { }; void skipws (istream& is); -void expect (istream& is, const char c); -void consume (istream& is, const char c); +void expect (istream& is, char c); +void consume (istream& is, char c); +void consume (istream& is, char const * c); |