2#ifndef CHEPREP_BHEPREPWRITER_H
3#define CHEPREP_BHEPREPWRITER_H
28 void openDoc(std::string version =
"BinaryHepRep/1.0", std::string
encoding =
"UTF-8",
bool standalone =
false);
35 void setAttribute(std::string name, std::vector<double> value);
58 static const unsigned char WBXML_VERSION = 0x03;
59 static const unsigned char UNKNOWN_PID = 0x01;
60 static const unsigned char UTF8 = 0x6a;
63 static const unsigned char SWITCH_PAGE = 0x00;
64 static const unsigned char END = 0x01;
65 static const unsigned char ENTITY = 0x02;
66 static const unsigned char STR_I = 0x03;
67 static const unsigned char LITERAL = 0x04;
69 static const unsigned char CONTENT = 0x40;
70 static const unsigned char EXT_I_0 = 0x40;
71 static const unsigned char EXT_I_1 = 0x41;
72 static const unsigned char EXT_I_2 = 0x42;
73 static const unsigned char PI = 0x43;
74 static const unsigned char LITERAL_C = 0x44;
76 static const unsigned char ATTRIBUTE = 0x80;
77 static const unsigned char EXT_T_0 = 0x80;
78 static const unsigned char EXT_T_1 = 0x81;
79 static const unsigned char EXT_T_2 = 0x82;
80 static const unsigned char STR_T = 0x83;
81 static const unsigned char LITERAL_A = 0x84;
83 static const unsigned char EXT_0 = 0xC0;
84 static const unsigned char EXT_1 = 0xC1;
85 static const unsigned char EXT_2 = 0xC2;
86 static const unsigned char OPAQUE = 0xC3;
87 static const unsigned char LITERAL_AC = 0xC4;
90 static const unsigned char STR_D = EXT_I_0;
91 static const unsigned char STR_R = EXT_T_0;
94 static std::map<std::string, unsigned char> tags;
95 static std::map<std::string, unsigned char> attributes;
96 static std::map<std::string, unsigned char> values;
100 bool singlePrecision;
104 std::map<std::string, unsigned int> stringValues;
107 std::map<std::string, std::string> stringAttributes;
108 std::map<std::string, std::vector<double> > colorAttributes;
109 std::map<std::string, int64> longAttributes;
110 std::map<std::string, int> intAttributes;
111 std::map<std::string, bool> booleanAttributes;
112 std::map<std::string, double> doubleAttributes;
115 std::vector<double> points;
118 void writeTag(std::string name,
bool content =
false);
120 void writeStringDefine(std::string s);
121 void writeMultiByteInt(
unsigned int ui);
122 void writeReal(
double ui);
123 void writeLong(
int64 i);
124 void writeInt(
int i);
125 void writeByte(
unsigned char b);
126 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)