Belle II Software  release-06-01-15
HTML.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #pragma once
9 
10 #include <TMatrixFBasefwd.h>
11 #include <TMatrixDBasefwd.h>
12 
13 #include <string>
14 
15 class TVector3;
16 
17 namespace Belle2 {
26  namespace HTML {
33  std::string getString(const TMatrixFBase& matrix, int precision = 2, bool color = true);
34 
41  std::string getString(const TMatrixDBase& matrix, int precision = 2, bool color = true);
42 
47  std::string getString(const TVector3& vec, int precision = 2);
48 
56  std::string getStringConvertToUnit(const TVector3& vec, int precision = 2,
57  const std::string& unitType = "cm");
58 
62  std::string chooseUnitOfLength(const TVector3& vec);
63 
69  std::string getHexDump(const int* buf, int length);
70 
72  std::string htmlToPlainText(const std::string& html);
73 
75  std::string escape(const std::string& str);
77  std::string unescape(const std::string& str);
78  }
80 }
std::string escape(const std::string &str)
Convert &, <, > etc.
Definition: HTML.cc:160
std::string getHexDump(const int *buf, int length)
Create hexdump of given buffer.
Definition: HTML.cc:122
std::string chooseUnitOfLength(const TVector3 &vec)
get a string with a unit type to convert a vector, so that it is easily readable.
Definition: HTML.cc:103
std::string unescape(const std::string &str)
inverse of escape()
Definition: HTML.cc:170
std::string getStringConvertToUnit(const TVector3 &vec, int precision=2, const std::string &unitType="cm")
get a string with vector coordinates: (x, y, z).
Definition: HTML.cc:86
std::string getString(const TMatrixFBase &matrix, int precision=2, bool color=true)
get HTML table representing a matrix.
Definition: HTML.cc:25
std::string htmlToPlainText(const std::string &html)
Reformat given HTML string into terminal-friendly plain text.
Definition: HTML.cc:139
Abstract base class for different kinds of events.