ATLAS Offline Software
Loading...
Searching...
No Matches
AsciiInput.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ASCIIIOINPUT_H
6#define ASCIIIOINPUT_H
7
8#include <string>
9#include <vector>
10#include <fstream>
11
19 public:
20 AsciiInput(const std::string& fileName);
22
25 int open();
26
29 int close();
30
35 std::vector<std::string> readRow();
36
39 static std::vector<std::string> strToStrVec(const std::string& inputString);
40
42 static long strToLong(const std::string& inputString);
43
45 static double strToDouble(const std::string& inputString);
46
47 private:
48
50 std::string m_fileName;
51
53 std::ifstream m_file;
54
56 static const int MAX_LINE_LENGTH = 500;
57
60};
61
62#endif
static long strToLong(const std::string &inputString)
A helper function to convert a string to a long value.
static std::vector< std::string > strToStrVec(const std::string &inputString)
A helper function to convert a string into a string vector, by using any number of space or tab chara...
std::ifstream m_file
Input file stream.
Definition AsciiInput.h:53
static const int MAX_LINE_LENGTH
Size of the character buffers.
Definition AsciiInput.h:56
int close()
Close the input file.
static double strToDouble(const std::string &inputString)
A helper function to convert a string to a double value.
AsciiInput(const std::string &fileName)
Definition AsciiInput.cxx:9
std::vector< std::string > readRow()
Read one line of the input text file into a vector of strings.
int open()
Open the input file.
std::string m_fileName
Input file name.
Definition AsciiInput.h:50
char m_lineBuffer[MAX_LINE_LENGTH]
Character buffers used while parsing the input file.
Definition AsciiInput.h:59