Tinman  1.0
parser.h
Go to the documentation of this file.
1 // -*- coding:utf-8; tab-width:4; mode:cpp -*-
2 #ifndef _PARSER_H_
3 #define _PARSER_H_
4 #include <iostream>
5 #include <fstream>
6 #include <regex>
7 #include <string>
8 #include <vector>
9 
10 class Parser {
11  std::ifstream file_;
12  std::regex pattern_;
13  public:
14  typedef std::vector<std::string> Match;
15  typedef std::vector<Match> Results;
16 
17  Parser();
18  virtual ~Parser();
19 
20  void open(std::string file);
21  void inject(std::string pattern);
22  Results get_results();
23 
24  private:
25  void close();
26 };
27 
28 #endif /* _PARSER_H_ */
std::ifstream file_
Definition: parser.h:11
Results get_results()
Definition: parser.cpp:42
virtual ~Parser()
Definition: parser.cpp:8
std::vector< std::string > Match
Definition: parser.h:14
Parser()
Definition: parser.cpp:4
void open(std::string file)
Definition: parser.cpp:13
void inject(std::string pattern)
Definition: parser.cpp:29
void close()
Definition: parser.cpp:24
Definition: parser.h:10
std::regex pattern_
Definition: parser.h:12
std::vector< Match > Results
Definition: parser.h:15