ATLAS Offline Software
Loading...
Searching...
No Matches
CSVWrapper.h
Go to the documentation of this file.
1#ifndef CSV_WRAPPER_H
2#define CSV_WRAPPER_H
3
4#include <vector>
5#include <memory>
6#include <fstream>
7
8class CSVWrapper {
9 public:
10 using tableline = std::vector<std::string>;
11 //Empty Constructor For initialisation
13 //Constructor
14 CSVWrapper(std::ifstream& inputfile);
15 std::shared_ptr<tableline> FindLine(const std::vector<std::pair<int,std::string>>&
16 argumentpairs);
17 std::vector<std::shared_ptr<tableline>> FindLines(const std::vector<std::pair<int,std::string>>&
18 argumentpairs);
19
20 tableline GetLine(const int element) const;
21 void PrintTable(bool sample = false) const;
22 private:
23 std::vector<CSVWrapper::tableline> QueryTable(const std::vector<std::pair<int,std::string>>&
24 argumentpairs);
25 std::vector<bool> ComparePreviousSearch(const std::vector<std::pair<int,std::string>>&
26 argumentpairs);
27 bool m_valid;
29 std::vector<tableline> m_table;
31 std::vector<std::pair<int,std::string>> m_prevsearch;
32 std::vector<std::vector<tableline>> m_previousresults;
33};
34#endif
std::vector< tableline > m_table
Definition CSVWrapper.h:29
bool m_valid
Definition CSVWrapper.h:27
std::vector< std::shared_ptr< tableline > > FindLines(const std::vector< std::pair< int, std::string > > &argumentpairs)
std::vector< CSVWrapper::tableline > QueryTable(const std::vector< std::pair< int, std::string > > &argumentpairs)
void PrintTable(bool sample=false) const
tableline GetLine(const int element) const
std::vector< std::pair< int, std::string > > m_prevsearch
Definition CSVWrapper.h:31
size_t m_columnwidth
Definition CSVWrapper.h:30
std::vector< std::string > tableline
Definition CSVWrapper.h:10
std::vector< bool > ComparePreviousSearch(const std::vector< std::pair< int, std::string > > &argumentpairs)
std::vector< std::vector< tableline > > m_previousresults
Definition CSVWrapper.h:32
bool m_firstsearch
Definition CSVWrapper.h:28
std::shared_ptr< tableline > FindLine(const std::vector< std::pair< int, std::string > > &argumentpairs)