1 |
foucault |
27 |
#ifndef CAD4FE_HtmlTextH
|
2 |
|
|
#define CAD4FE_HtmlTextH
|
3 |
|
|
|
4 |
|
|
#include <string>
|
5 |
|
|
#include <vector>
|
6 |
|
|
|
7 |
|
|
#include "CAD4FE_Common_platform.h"
|
8 |
|
|
|
9 |
|
|
namespace CAD4FE {
|
10 |
|
|
|
11 |
|
|
class CAD4FE_COMMON_ITEM HtmlText {
|
12 |
|
|
public:
|
13 |
|
|
virtual std::string GetHtml(){return "";}
|
14 |
|
|
operator std::string () {return GetHtml();}
|
15 |
|
|
};
|
16 |
|
|
|
17 |
|
|
class CAD4FE_COMMON_ITEM HtmlText_Table : public HtmlText {
|
18 |
|
|
public:
|
19 |
|
|
HtmlText_Table(std::vector <std::string> & __head );
|
20 |
|
|
HtmlText_Table (std::vector <std::string> & __head, std::vector < std::vector <std::string> > & __rows);
|
21 |
|
|
void AddRow(std::vector<std::string> & __row );
|
22 |
|
|
void Close();
|
23 |
|
|
virtual std::string GetHtml();
|
24 |
|
|
protected:
|
25 |
|
|
std::string _nbCols;
|
26 |
|
|
std::vector <std::string> _head;
|
27 |
|
|
std::vector< std::vector < std::string> > _rows;
|
28 |
|
|
};
|
29 |
|
|
|
30 |
|
|
class CAD4FE_COMMON_ITEM HtmlText_Page : public HtmlText {
|
31 |
|
|
public:
|
32 |
|
|
HtmlText_Page();
|
33 |
|
|
void operator << (const std::ostringstream & __os);
|
34 |
|
|
void Add(std::string __string);
|
35 |
|
|
void Close();
|
36 |
|
|
virtual std::string GetHtml();
|
37 |
|
|
void Show(std::string __filename);
|
38 |
|
|
void WriteFile(std::string __filename);
|
39 |
|
|
void Clear();
|
40 |
|
|
protected:
|
41 |
|
|
std::string _html;
|
42 |
|
|
};
|
43 |
|
|
|
44 |
|
|
}
|
45 |
|
|
|
46 |
|
|
|
47 |
|
|
#endif
|