a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
CommentedTextParser.cpp
Go to the documentation of this file.
1/*
2 * CommentedTextParser.cpp
3 *
4 * Created on: Jan 22, 2012
5 * Author: Ben O'Leary (benjamin.oleary@gmail.com)
6 *
7 * This file is part of BOLlib, released under the
8 * GNU General Public License. Please see the accompanying
9 * README.BOLlib.txt file for a full list of files, brief documentation
10 * on how to use these classes, and further details on the license.
11 */
12
14
15namespace BOL
16{
17 std::string const CommentedTextParser::trimmingChars( " \t\r" );
18
19 CommentedTextParser::CommentedTextParser( std::string const& commentMarker,
20 bool const isVerbose ) :
21 isVerbose( isVerbose ),
22 commentMarkerSet( 1 ),
23 parsedText(),
24 parsedLine( "",
25 "" ),
26 textAsLines(),
27 lineBeingRead( "" ),
28 linesOfFileRemain( false ),
29 inputFile()
30 {
31 commentMarkerSet.getFront().assign( commentMarker );
32 }
33
35 VectorlikeArray< std::string > const& commentMarkerSet,
36 bool const isVerbose ) :
37 isVerbose( isVerbose ),
38 commentMarkerSet( commentMarkerSet ),
39 parsedText(),
40 parsedLine( "",
41 "" ),
42 textAsLines(),
43 lineBeingRead( "" ),
44 linesOfFileRemain( false ),
45 inputFile()
46 {
47 // just an initialization list.
48 }
49
51 {
52 if( inputFile.is_open() )
53 {
54 inputFile.close();
55 }
56 }
57
58}
VectorlikeArray< std::string > commentMarkerSet
CommentedTextParser(std::string const &commentMarker, bool const isVerbose)
static std::string const trimmingChars