1 |
< |
#include <iostream.h> |
2 |
< |
#include <string.h> |
1 |
> |
#include <iostream> |
2 |
> |
#include <string> |
3 |
|
|
4 |
+ |
using std::string; |
5 |
+ |
|
6 |
|
class XMLFormatter { |
7 |
|
|
8 |
|
public: |
9 |
|
// public variables |
10 |
|
// public methods |
11 |
< |
void XMLFormatter( char* newHostInfo ); |
11 |
> |
XMLFormatter( string newHostInfo ); |
12 |
> |
XMLFormatter(); |
13 |
> |
XMLFormatter( string newHostInfo, string attributes); |
14 |
|
|
15 |
< |
char* returnXML(); |
15 |
> |
string returnXML(); |
16 |
|
void closeNest(); |
17 |
< |
void addNest(char* nest); |
18 |
< |
void addElement(char* element); |
17 |
> |
void addNest(string nest); |
18 |
> |
void addElement(string element, string value); |
19 |
> |
void addElement(string element, string attribute, string value); |
20 |
> |
void addString(string text){ xmlData += text; }; |
21 |
|
|
22 |
|
private: |
23 |
|
// private variables |
24 |
< |
char* xmlData; |
25 |
< |
char* hostInfo; |
24 |
> |
string xmlData; |
25 |
> |
string hostInfo; |
26 |
> |
string stack[50]; |
27 |
> |
int stackPointer; |
28 |
|
|
29 |
|
}; // end class |