![]() |
OpenMS
|
Xerces-free, lightweight view over the attribute list of an XML element. More...
#include <OpenMS/FORMAT/HANDLERS/XMLAttributes.h>
Public Member Functions | |
| XMLAttributes (const XMLAttributes &)=default | |
| XMLAttributes & | operator= (const XMLAttributes &)=default |
| XMLAttributes (const void *attributes) noexcept | |
| Wrap a live attribute list (non-owning). | |
| const char16_t * | value (const char16_t *qname) const |
Value of the attribute named qname (UTF-16 code units), or nullptr if absent. | |
| const char16_t * | value (const char *qname) const |
Value of the attribute named qname (narrow name, transcoded internally), or nullptr if absent. | |
| SignedSize | index (const char16_t *qname) const |
Index of the attribute named qname, or a negative value if absent. | |
| const char16_t * | valueByIndex (Size i) const |
Value of the attribute at position i (UTF-16 code units). | |
| const void * | handle () const noexcept |
| Opaque handle to the underlying attribute list (libOpenMS-internal use). | |
Private Attributes | |
| const void * | attributes_ |
Xerces-free, lightweight view over the attribute list of an XML element.
Wraps a live xercesc::Attributes (owned by the SAX parser and valid only for the duration of the startElement callback). It exposes only the small surface the OpenMS handlers actually use (value-by-name, index-by-name, value-by-index), so that Xerces types never appear in a public header.
The underlying attribute list is held as an opaque pointer, so this header pulls in no Xerces declarations — consumers of libOpenMS need Xerces neither on their include path nor at link time. The accessor implementations (in XMLAttributes.cpp) recover the concrete Xerces type internally.
The wrapper is a non-owning view: it stores a pointer to the parser-owned attribute list and must not outlive the callback it was created for.
|
default |
|
inlineexplicitnoexcept |
Wrap a live attribute list (non-owning).
Takes an opaque handle so this header need not name any Xerces type. The only caller is the internal SAX2HandlerAdapter, which passes the address of the live xercesc::Attributes (recovered internally in XMLAttributes.cpp).
|
inlinenoexcept |
Opaque handle to the underlying attribute list (libOpenMS-internal use).
| SignedSize index | ( | const char16_t * | qname | ) | const |
Index of the attribute named qname, or a negative value if absent.
|
default |
| const char16_t * value | ( | const char * | qname | ) | const |
Value of the attribute named qname (narrow name, transcoded internally), or nullptr if absent.
| const char16_t * value | ( | const char16_t * | qname | ) | const |
Value of the attribute named qname (UTF-16 code units), or nullptr if absent.
Referenced by XMLHandler::attributeAsDouble_(), XMLHandler::attributeAsDouble_(), XMLHandler::attributeAsInt_(), XMLHandler::attributeAsInt_(), XMLHandler::attributeAsString_(), XMLHandler::attributeAsString_(), XMLHandler::optionalAttributeAsDouble_(), XMLHandler::optionalAttributeAsDouble_(), XMLHandler::optionalAttributeAsDoubleList_(), XMLHandler::optionalAttributeAsDoubleList_(), XMLHandler::optionalAttributeAsInt_(), XMLHandler::optionalAttributeAsInt_(), XMLHandler::optionalAttributeAsIntList_(), XMLHandler::optionalAttributeAsIntList_(), XMLHandler::optionalAttributeAsString_(), XMLHandler::optionalAttributeAsString_(), XMLHandler::optionalAttributeAsStringList_(), XMLHandler::optionalAttributeAsStringList_(), XMLHandler::optionalAttributeAsUInt_(), and XMLHandler::optionalAttributeAsUInt_().
| const char16_t * valueByIndex | ( | Size | i | ) | const |
Value of the attribute at position i (UTF-16 code units).
|
private |