1 #ifndef _QG_TEXT_FILE_HANDLER_HH_
2 #define _QG_TEXT_FILE_HANDLER_HH_
26 void AppendLine(std::string key =
"", std::string value =
"");
41 std::string
GetValue(std::string key);
51 std::pair<std::string, std::string>
ParseLine(
const std::string& line);
54 std::string
BuildLine(
const std::pair<std::string, std::string>& parsedLine);
60 std::vector<std::pair<std::string, std::string> >
fFileLines;
Class to handle input and output for text files.
const std::vector< std::pair< std::string, std::string > > & GetLines()
Get the lines of the file as key, value pairs.
std::string GetValue(std::string key)
Retrieve value associated with a key.
void AppendLine(std::string key, Double_t value)
Append a key and (Double_t) value to the file.
std::pair< std::string, std::string > ParseLine(const std::string &line)
Parse a line of a text file, splitting at a delimiter.
bool ReadFile(std::string filename)
Read file, returns true if successful.
std::vector< std::pair< std::string, std::string > > fFileLines
Contents of text file, line by line.
std::string BuildLine(const std::pair< std::string, std::string > &parsedLine)
Build a line from a key and value, inserting a delimiter.
void AppendLine(std::string key, Int_t value)
Append a key and (Int_t) value to the file.
std::map< std::string, std::string > fFileMap
Contents of text file, useful for unique keys.
bool WriteFile(std::string filename)
Write file, returns true if successful.
bool DoesKeyExist(std::string key)
Return true if key exists.
void AppendLine(std::string key="", std::string value="")
Append a key and value to the file.
QGTextFileHandler()
Constructor.
virtual ~QGTextFileHandler()
Destructor.