34 #include "dcmtk/config/osconfig.h" 36 #include "dcmtk/ofstd/ofstream.h" 37 #include "dcmtk/dcmsr/dsrtypes.h" 38 #include "dcmtk/dcmsr/dsrxmlc.h" 47 typedef void (*xmlDocPtr);
48 typedef void (*xmlCharEncodingHandlerPtr);
100 const size_t flags = 0);
137 const OFBool required = OFTrue)
const;
145 const char *name)
const;
153 const char *name)
const;
164 const char *name)
const;
180 const OFBool encoding = OFFalse,
181 const OFBool required = OFTrue)
const;
196 const OFBool encoding = OFFalse,
197 const OFBool required = OFTrue)
const;
209 const char *name = NULL,
210 const OFBool encoding = OFFalse,
211 const OFBool clearString = OFTrue)
const;
222 const char *name = NULL,
223 const OFBool encoding = OFFalse)
const;
272 const char *name)
const;
284 const OFBool omitCurrent = OFFalse);
static OFString & getFullNodePath(const DSRXMLCursor &cursor, OFString &stringValue, const OFBool omitCurrent=OFFalse)
get the full path (incl.
abstract base class for all DICOM elements
void printGeneralNodeError(const DSRXMLCursor &cursor, const OFCondition &result) const
print general node error message
E_ValueType getValueTypeFromNode(const DSRXMLCursor &cursor) const
get value type from particular node.
E_RelationshipType
SR relationship types.
void clear()
clear all internal member variables
OFBool encodingHandlerValid() const
check whether the currently set character encoding handler is valid.
OFCondition getElementFromNodeContent(const DSRXMLCursor &cursor, DcmElement &delem, const char *name=NULL, const OFBool encoding=OFFalse) const
get element value from particular XML element
DSRXMLCursor getRootNode() const
get root node of the document
OFCondition setEncodingHandler(const char *charset)
set the specified character encoding handler.
OFCondition read(const OFString &filename, const size_t flags=0)
read XML document from file.
OFString & getStringFromNodeContent(const DSRXMLCursor &cursor, OFString &stringValue, const char *name=NULL, const OFBool encoding=OFFalse, const OFBool clearString=OFTrue) const
get string value from particular XML element
DSRXMLDocument()
default constructor
OFBool convertUtf8ToCharset(const xmlChar *fromString, OFString &toString) const
convert given string from 'libxml' format (UTF8) to current character set
OFCondition getElementFromAttribute(const DSRXMLCursor &cursor, DcmElement &delem, const char *name, const OFBool encoding=OFFalse, const OFBool required=OFTrue) const
get element value from particular XML attribute
virtual ~DSRXMLDocument()
destructor
E_ValueType
SR value types.
E_RelationshipType getRelationshipTypeFromNode(const DSRXMLCursor &cursor) const
get relationship type from particular node.
General purpose class hiding global functions, constants and types from the global namespace...
OFBool hasAttribute(const DSRXMLCursor &cursor, const char *name) const
check whether particular node has a specific attribute
a simple string class that implements a subset of std::string.
OFBool matchNode(const DSRXMLCursor &cursor, const char *name) const
check whether particular node matches a given name
xmlDocPtr Document
pointer to the internal representation of the XML document (libxml)
DSRXMLCursor getNamedNode(const DSRXMLCursor &cursor, const char *name, const OFBool required=OFTrue) const
get a particular named node of the document.
OFBool valid() const
check whether the current internal state is valid
xmlCharEncodingHandlerPtr EncodingHandler
pointer to the currently selected character encoding handler (libxml)
Class for XML document cursors.
OFString & getStringFromAttribute(const DSRXMLCursor &cursor, OFString &stringValue, const char *name, const OFBool encoding=OFFalse, const OFBool required=OFTrue) const
get string value from particular XML attribute.
void printMissingAttributeError(const DSRXMLCursor &cursor, const char *name) const
print error message for missing attribute
OFCondition checkNode(const DSRXMLCursor &cursor, const char *name) const
check whether particular node matches a given name and report an error if not
void printUnexpectedNodeWarning(const DSRXMLCursor &cursor) const
print warning message for unexpected node
General purpose class for condition codes.