/usr/include/htmlcxx/html/Node.h is in libhtmlcxx-dev 0.86-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 | #ifndef __HTML_PARSER_NODE_H
#define __HTML_PARSER_NODE_H
#include <map>
#include <string>
#include <utility>
namespace htmlcxx {
namespace HTML {
class Node {
public:
Node() {}
//Node(const Node &rhs); //uses default
~Node() {}
inline void text(const std::string& text) { this->mText = text; }
inline const std::string& text() const { return this->mText; }
inline void closingText(const std::string &text) { this->mClosingText = text; }
inline const std::string& closingText() const { return mClosingText; }
inline void offset(unsigned int offset) { this->mOffset = offset; }
inline unsigned int offset() const { return this->mOffset; }
inline void length(unsigned int length) { this->mLength = length; }
inline unsigned int length() const { return this->mLength; }
inline void tagName(const std::string& tagname) { this->mTagName = tagname; }
inline const std::string& tagName() const { return this->mTagName; }
bool isTag() const { return this->mIsHtmlTag; }
void isTag(bool is_html_tag){ this->mIsHtmlTag = is_html_tag; }
bool isComment() const { return this->mComment; }
void isComment(bool comment){ this->mComment = comment; }
std::pair<bool, std::string> attribute(const std::string &attr) const
{
std::map<std::string, std::string>::const_iterator i = this->mAttributes.find(attr);
if (i != this->mAttributes.end()) {
return make_pair(true, i->second);
} else {
return make_pair(false, std::string());
}
}
operator std::string() const;
std::ostream &operator<<(std::ostream &stream) const;
const std::map<std::string, std::string>& attributes() const { return this->mAttributes; }
void parseAttributes();
bool operator==(const Node &rhs) const;
protected:
std::string mText;
std::string mClosingText;
unsigned int mOffset;
unsigned int mLength;
std::string mTagName;
std::map<std::string, std::string> mAttributes;
bool mIsHtmlTag;
bool mComment;
};
}
}
#endif
|