2#ifndef CHEPREP_BHEPREPWRITER_H
3#define CHEPREP_BHEPREPWRITER_H
27 void openDoc(std::string version =
"BinaryHepRep/1.0", std::string
encoding =
"UTF-8",
bool standalone =
false);
34 void setAttribute(std::string name, std::vector<double> value);
57 static const unsigned char WBXML_VERSION = 0x03;
58 static const unsigned char UNKNOWN_PID = 0x01;
59 static const unsigned char UTF8 = 0x6a;
62 static const unsigned char SWITCH_PAGE = 0x00;
63 static const unsigned char END = 0x01;
64 static const unsigned char ENTITY = 0x02;
65 static const unsigned char STR_I = 0x03;
66 static const unsigned char LITERAL = 0x04;
68 static const unsigned char CONTENT = 0x40;
69 static const unsigned char EXT_I_0 = 0x40;
70 static const unsigned char EXT_I_1 = 0x41;
71 static const unsigned char EXT_I_2 = 0x42;
72 static const unsigned char PI = 0x43;
73 static const unsigned char LITERAL_C = 0x44;
75 static const unsigned char ATTRIBUTE = 0x80;
76 static const unsigned char EXT_T_0 = 0x80;
77 static const unsigned char EXT_T_1 = 0x81;
78 static const unsigned char EXT_T_2 = 0x82;
79 static const unsigned char STR_T = 0x83;
80 static const unsigned char LITERAL_A = 0x84;
82 static const unsigned char EXT_0 = 0xC0;
83 static const unsigned char EXT_1 = 0xC1;
84 static const unsigned char EXT_2 = 0xC2;
85 static const unsigned char OPAQUE = 0xC3;
86 static const unsigned char LITERAL_AC = 0xC4;
89 static const unsigned char STR_D = EXT_I_0;
90 static const unsigned char STR_R = EXT_T_0;
93 static std::map<std::string, unsigned char> tags;
94 static std::map<std::string, unsigned char> attributes;
95 static std::map<std::string, unsigned char> values;
103 std::map<std::string, unsigned int> stringValues;
106 std::map<std::string, std::string> stringAttributes;
107 std::map<std::string, std::vector<double> > colorAttributes;
108 std::map<std::string, int64> longAttributes;
109 std::map<std::string, int> intAttributes;
110 std::map<std::string, bool> booleanAttributes;
111 std::map<std::string, double> doubleAttributes;
114 std::vector<double> points;
117 void writeTag(std::string name,
bool content =
false);
119 void writeStringDefine(std::string s);
120 void writeMultiByteInt(
unsigned int ui);
121 void writeReal(
double ui);
122 void writeLong(
int64 i);
123 void writeInt(
int i);
124 void writeByte(
unsigned char b);
125 void writeString(std::string s);
std::string defaultNameSpace
void setAttribute(std::string name, char *value)
void printTag(std::string ns, std::string name)
void openTag(std::string name)
void printTag(std::string name)
void openDoc(std::string version="BinaryHepRep/1.0", std::string encoding="UTF-8", bool standalone=false)
void setAttribute(std::string ns, std::string name, double value)
void setAttribute(std::string ns, std::string name, std::string value)
void openTag(std::string ns, std::string name)
void closeDoc(bool force=false)