/usr/include/pbseq/alignment/utils/SimpleXMLUtils.hpp is in libblasr-dev 0~20161219-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | #ifndef _BLASR_SIMPLE_XML_UTILS_HPP_
#define _BLASR_SIMPLE_XML_UTILS_HPP_
#include <string>
#include <sstream>
/*
* WARNING !!! The functions here use TONS of temoprary variables and are
* very slow. Do not use for high-throughput xml generation.
*/
/*
* none of this is really used... just the keyword value pair items.
*/
template<typename T_String, typename T_Value>
int OutputKeywordValuePair(T_String title, T_Value value, std::ostream out) {
out << title << "=\"" << value << "\" ";
return out.good();
}
template<typename T_String>
int OutputBeginElement(T_String title, std::ostream out) {
out << "<" << title << " ";
return 1;
}
template<typename T_String>
int OutputEndElement(T_String title, std::ostream out) {
out << "/" << title;
return 1;
}
template<typename T_String>
int OutputElement(T_String title, std::ostream out) {
out << "<" << title << " ";
return 1;
}
inline
void OutputEnd(std::ostream out) {
out << "/>";
}
template<typename T_String, typename T_Value>
T_String CreateKeywordValuePair(T_String title, T_Value value) {
T_String keywordPair;
std::stringstream sstrm;
sstrm << title << "=\"" << value << "\"";
keywordPair = sstrm.str();
return keywordPair;
}
template<typename T_String>
T_String BeginDataEntry(T_String id, T_String data) {
T_String entry;
entry += "<";
entry += id;
entry += " ";
entry += data;
entry += ">";
return entry;
}
template<typename T_String>
T_String EndDataEntry(T_String id) {
T_String entry;
entry = "<" + id + ">/";
return entry;
}
template<typename T_String>
T_String CreateDataEntry(T_String id, T_String data) {
T_String entry;
entry += "<";
entry += id;
entry += " ";
entry += data;
entry += " />";
return entry;
}
template<typename T_String>
T_String CreateStartEntry(T_String id, T_String data) {
T_String entry;
entry = "<" + id + " " + data + ">";
return entry;
}
template<typename T_String>
T_String CreateEndEntry(T_String id) {
T_String entry;
entry = "<" + id + "/>";
return entry;
}
#endif
|