PcapPlusPlus  Next
TablePrinter.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 
7 
10 namespace pcpp
11 {
12 
15  {
16  public:
20  TablePrinter(std::vector<std::string> columnNames, std::vector<int> columnWidths);
21 
23  virtual ~TablePrinter();
24 
32  bool printRow(const std::string& values, char delimiter);
33 
38  bool printRow(std::vector<std::string> values);
39 
42 
45  void closeTable();
46 
47  private:
48  std::vector<std::string> m_ColumnNames;
49  std::vector<int> m_ColumnWidths;
50  bool m_FirstRow;
51  bool m_TableClosed;
52 
54  void printHeadline();
55  };
56 
57 } // namespace pcpp
A class for printing tables in command-line.
Definition: TablePrinter.h:15
virtual ~TablePrinter()
A d'tor for this class. Closes the table if not closed.
TablePrinter(std::vector< std::string > columnNames, std::vector< int > columnWidths)
void printSeparator()
Print a separator line.
bool printRow(const std::string &values, char delimiter)
bool printRow(std::vector< std::string > values)
The main namespace for the PcapPlusPlus lib.