antioch-0.4.0
input_utils.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // Antioch - A Gas Dynamics Thermochemistry Library
5 //
6 // Copyright (C) 2014-2016 Paul T. Bauman, Benjamin S. Kirk,
7 // Sylvain Plessis, Roy H. Stonger
8 //
9 // Copyright (C) 2013 The PECOS Development Team
10 //
11 // This library is free software; you can redistribute it and/or
12 // modify it under the terms of the Version 2.1 GNU Lesser General
13 // Public License as published by the Free Software Foundation.
14 //
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
23 // Boston, MA 02110-1301 USA
24 //
25 //-----------------------------------------------------------------------el-
26 
27 #ifndef ANTIOCH_INPUT_UTILS_H
28 #define ANTIOCH_INPUT_UTILS_H
29 
30 #include <istream>
31 #include <locale> // isblank
32 
33 namespace Antioch
34 {
43  void skip_comment_lines( std::istream &in, const char comment_start);
44 
45  inline
46  void skip_comment_lines( std::istream &in, const char comment_start)
47  {
48  char c, line[256];
49 
50  in.get(c);
51  while(std::isblank(c))in.get(c);
52 
53  in.putback(c);
54 
55  while (in.get(c), c==comment_start)
56  in.getline (line, 255);
57 
58  // put back first character of
59  // first non-comment line
60  in.putback (c);
61  }
62 
63 } // end namespace Antioch
64 
65 #endif //ANTIOCH_INPUT_UTILS_H
The parameters are reduced parameters.
void skip_comment_lines(std::istream &in, const char comment_start)
Skip comment lines in the header of an ASCII text file prefixed with the comment character 'comment_s...
Definition: input_utils.h:46

Generated on Thu Jul 7 2016 11:09:46 for antioch-0.4.0 by  doxygen 1.8.8