29 using namespace pwiz::util;
30 using namespace pwiz::minimxml;
37 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
38 "<root name1=\"value1\" name2=\"420\" name3=\"0.666\">\n"
39 " <record name=\"nixon\"\n"
42 " <quote>I'm not a crook.</quote>\n"
45 " <record name=\""Penn & Teller"\">\n"
46 " <quote>'Bull<shit!'</quote>\n"
48 " <record name=\"clinton\"\n"
51 " <quote>I did <em>not</em> have sexual relations with that woman.</quote>\n"
54 " <record name=\"bush\"\n"
57 " <quote>Mission accomplished.</quote>\n"
64 virtual void update(
const string& output)
87 const char* piData =
"version=\"1.0\" encoding=\"UTF-8\"";
93 attributes.push_back(make_pair(
"name1",
"value1"));
94 attributes.push_back(make_pair(
"name2",
"420"));
95 attributes.push_back(make_pair(
"name3",
"0.666"));
102 attributes.push_back(make_pair(
"name",
"nixon"));
103 attributes.push_back(make_pair(
"color",
"red"));
104 attributes.push_back(make_pair(
"number",
"37"));
105 writer.
pushStyle(XMLWriter::StyleFlag_AttributesOnMultipleLines);
117 attributes.push_back(make_pair(
"name",
"\"Penn & Teller\""));
127 attributes.push_back(make_pair(
"name",
"clinton"));
128 attributes.push_back(make_pair(
"color",
"blue"));
129 attributes.push_back(make_pair(
"number",
"42"));
130 writer.
pushStyle(XMLWriter::StyleFlag_AttributesOnMultipleLines);
141 writer.
characters(
" have sexual relations with that woman.");
149 attributes.push_back(make_pair(
"name",
"bush"));
150 attributes.push_back(make_pair(
"color",
"red"));
151 attributes.push_back(make_pair(
"number",
"43"));
152 writer.
pushStyle(XMLWriter::StyleFlag_AttributesOnMultipleLines);
164 if (
os_) *
os_ <<
"test: (" << oss.str().size() <<
")\n" << oss.str() << endl;
170 if (
os_) *
os_ <<
"outputObserver cache:\n" << outputObserver.
cache << endl;
176 string id1(
"1invalid ID");
181 string id2(
"_invalid-ID_#2_<3>");
185 string crazyId(
"!!!");
191 #ifndef __APPLE__ // TODO: how to test that this works with Darwin's compiler?
194 attributes.
add(
"1", 2.2250738585072014
e-309);
195 attributes.
add(
"2", -2.2250738585072014
e-309);
202 int main(
int argc,
const char* argv[])
208 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;