/usr/include/titan/XmlReader.hh is in eclipse-titan 6.3.1-1build1.
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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | /******************************************************************************
* Copyright (c) 2000-2017 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Balasko, Jeno
* Raduly, Csaba
* Szabo, Bence Janos
*
******************************************************************************/
#ifndef XML_READER_HH_
#define XML_READER_HH_
#ifdef __XML_XMLREADER_H__
// The real xmlreader.h is included; hide our "lite" version in a namespace.
namespace xmlreader_lite {
#endif
// "lite" version of xmlreader.h
typedef void * xmlTextReaderPtr;
typedef void * xmlTextReaderLocatorPtr;
typedef unsigned char xmlChar;
typedef enum {
XML_PARSER_SEVERITY_VALIDITY_WARNING = 1,
XML_PARSER_SEVERITY_VALIDITY_ERROR = 2,
XML_PARSER_SEVERITY_WARNING = 3,
XML_PARSER_SEVERITY_ERROR = 4
} xmlParserSeverities;
typedef enum {
XML_READER_TYPE_NONE = 0,
XML_READER_TYPE_ELEMENT = 1,
XML_READER_TYPE_ATTRIBUTE = 2,
XML_READER_TYPE_TEXT = 3,
XML_READER_TYPE_CDATA = 4,
XML_READER_TYPE_ENTITY_REFERENCE = 5,
XML_READER_TYPE_ENTITY = 6,
XML_READER_TYPE_PROCESSING_INSTRUCTION = 7,
XML_READER_TYPE_COMMENT = 8,
XML_READER_TYPE_DOCUMENT = 9,
XML_READER_TYPE_DOCUMENT_TYPE = 10,
XML_READER_TYPE_DOCUMENT_FRAGMENT = 11,
XML_READER_TYPE_NOTATION = 12,
XML_READER_TYPE_WHITESPACE = 13,
XML_READER_TYPE_SIGNIFICANT_WHITESPACE = 14,
XML_READER_TYPE_END_ELEMENT = 15,
XML_READER_TYPE_END_ENTITY = 16,
XML_READER_TYPE_XML_DECLARATION = 17
} xmlReaderTypes;
typedef void (*xmlFreeFunc)(void *mem);
extern "C" xmlFreeFunc xmlFree;
#ifdef __XML_XMLREADER_H__
} // end namespace
#endif
class TTCN_Buffer;
/** Wrapper for xmlTextReader... methods */
class XmlReaderWrap {
xmlTextReaderPtr my_reader; ///< the my_reader instance
int last_status; ///< the success code of the last read operation
static void errorhandler(void * arg, const char * msg,
xmlParserSeverities severity, xmlTextReaderLocatorPtr locator);
/// Copy constructor disabled
XmlReaderWrap(const XmlReaderWrap&);
/// Assignment disabled
XmlReaderWrap& operator=(const XmlReaderWrap&);
public:
XmlReaderWrap(TTCN_Buffer& buf);
~XmlReaderWrap();
//int Setup( xmlParserInputBufferPtr input, const char *URL, const char *encoding, int options)
//{ return xmlTextReaderSetup(my_reader,input,URL,encoding,options); }
/** Move the read position to the next node.
* @return 1 on success, 0 if no more nodes to read, -1 on error */
int Read();
int ReadDbg(const char *where);
#if 0
/** Return the child nodes of the current node.
*
* This does not include the element itself, only its children.
*
* @return a newly allocated string. The caller must deallocate the string
* using \c xmlFree.
*/
xmlChar * ReadInnerXml();
#endif
/** Return the contents of the current node, including child nodes and markup.
*
* This includes the element itself.
*
* @return a newly allocated string. The caller must deallocate the string
* using \c xmlFree.
*/
xmlChar * ReadOuterXml();
/** Reads the contents of an element or a text node as a string.
*
* @return a newly allocated string containing the contents of the Element
* or Text node, or NULL if the my_reader is positioned on any other type
* of node. The caller must deallocate the string using \c xmlFree.
*/
xmlChar * ReadString();
#if 0
int ReadAttributeValue();
int AttributeCount();
int HasAttributes();
int HasValue();
int IsDefault();
#endif
int Depth();
int IsEmptyElement();
int NodeType();
#if 0
int QuoteChar();
int ReadState();
#endif
inline int Ok()
{ return last_status > 0; }
int IsNamespaceDecl();
/** @name Properties
*
* @{
* These return constant strings; the caller must not modify or free them */
#if 0
const xmlChar * BaseUri();
#endif
/// Return the unqualified name of the node. It is "#text" for text nodes.
const xmlChar * LocalName();
/// Return the qualified name of the node (Prefix + ':' + LocalName)
const xmlChar * Name();
/// Return the URI defining the namespace associated with the node
const xmlChar * NamespaceUri();
/// Return the namespace prefix associated with the node
const xmlChar * Prefix();
#if 0
const xmlChar * XmlLang();
#endif
/// Return the text value of the node, if present
const xmlChar * Value();
/** Returns a newly allocated string containing Value.
* The caller must deallocate the string with xmlFree() */
xmlChar * NewValue();
/** @} */
/** Resolves a namespace prefix in the scope of the current element
*
* @param prefix to resolve. Use NULL for the default namespace.
* @return a newly allocated string containing the namespace URI.
* It must be deallocated by the caller. */
xmlChar * LookupNamespace( const xmlChar *prefix);
#if 0
int Close();
xmlChar * GetAttributeNo( int no);
xmlChar * GetAttribute( const xmlChar *name);
xmlChar * GetAttributeNs( const xmlChar *localName, const xmlChar *namespaceURI);
/** Moves the read position to the attribute with the specified index.
*
* @param no zero-based index of the attribute
* @return 1 for success, -1 for error, 0 if not found
*/
int MoveToAttributeNo( int no);
#endif
/** Moves the read position to the attribute with the specified name.
*
* @param name: the qualified name of the attribute
* @return 1 for success, -1 for error, 0 if not found
*/
int MoveToAttribute(const xmlChar *name);
/** Moves the read position to the attribute with the specified name.
*
* @param localName local name of the attribute
* @param namespaceURI namespace URI of the attribute
* @return 1 for success, -1 for error, 0 if not found
*/
int MoveToAttributeNs(const xmlChar *localName, const xmlChar *namespaceURI);
/** Moves the read position to the first attribute of the current node.
*
* @return 1 for success, -1 for error, 0 if not found
*/
int MoveToFirstAttribute();
int MoveToFirstAttributeDbg(const char *where);
/** Moves the read position to the next attribute of the current node.
*
* @return 1 for success, -1 for error, 0 if not found
*/
int MoveToNextAttribute();
int MoveToNextAttributeDbg(const char *where);
/** Moves the read position to the node that contains the current Attribute node.
*
* @return 1 for success, -1 for error, 0 if not moved
*/
int MoveToElement();
int MoveToElementDbg(const char *where);
/** Utility function for navigating attributes.
* Calls MoveToNextAttribute(). If there are no more attributes,
* it calls MoveToElement() to stop iterating over attributes.
*
* @return 1 for success, -1 for error, 0 if no more attributes
* (MoveToElement was called and didn't fail) */
int AdvanceAttribute();
int AdvanceAttributeDbg(const char *where);
#if 0
int GetParserLineNumber();
int GetParserColumnNumber();
int Next();
int NextSibling();
int Normalization();
int SetParserProp( int prop, int value);
int GetParserProp( int prop);
xmlParserInputBufferPtr GetRemainder();
xmlNodePtr CurrentNode();
xmlNodePtr Preserve();
int PreservePattern( const xmlChar *pattern, const xmlChar **namespaces);
xmlDocPtr CurrentDoc();
xmlNodePtr Expand();
int IsValid();
int RelaxNGValidate( const char *rng);
int RelaxNGSetSchema( xmlRelaxNGPtr schema);
int SchemaValidate( const char *xsd);
int SchemaValidateCtxt( xmlSchemaValidCtxtPtr ctxt, int options);
int SetSchema( xmlSchemaPtr schema);
#endif
int Standalone();
long ByteConsumed();
int LocatorLineNumber(xmlTextReaderLocatorPtr locator);
xmlChar * LocatorBaseURI(xmlTextReaderLocatorPtr locator);
#if 0
void SetErrorHandler( xmlTextReaderErrorFunc f, void *arg);
void SetStructuredErrorHandler( xmlStructuredErrorFunc f, void *arg);
void GetErrorHandler( xmlTextReaderErrorFunc *f, void **arg);
#endif
#if defined(__GNUC__) && !defined(NDEBUG)
#define Read() ReadDbg(__PRETTY_FUNCTION__)
#define MoveToFirstAttribute() MoveToFirstAttributeDbg(__PRETTY_FUNCTION__)
#define MoveToNextAttribute() MoveToNextAttributeDbg(__PRETTY_FUNCTION__)
#define AdvanceAttribute() AdvanceAttributeDbg(__PRETTY_FUNCTION__)
#endif
#ifndef NDEBUG
void Status();
#endif
};
#endif
|