DiaDes  0.1
DIAgnosis of Discrete-Event System
StreamTools.hh
Go to the documentation of this file.
1 
8 #ifndef __DIADES__UTILS__STREAMTOOLS__HH__
9 #define __DIADES__UTILS__STREAMTOOLS__HH__
10 
11 #include<istream>
12 #include<iostream>
13 #include<unordered_set>
14 
15 namespace Diades {
16  namespace Utils {
17 
25  template<typename CharT>
26  bool
27  readChars(std::basic_istream<CharT> & is,
28  const std::unordered_set<CharT> & characters, CharT & next) {
29  bool result = false;
30  while (!result && (is >> next)) {
31  result = characters.find(next) == characters.end();
32  }
33  return result;
34  }
35 
36 
37 
38 
39  }
40 }
41 
42 
43 
44 #endif /* __DIADES__UTILS__STREAMTOOLS__HH__ */
45 
Namespace of the Diades project.
Definition: Run.cc:86
bool readChars(std::basic_istream< CharT > &is, const std::unordered_set< CharT > &characters, CharT &next)
Definition: StreamTools.hh:27