OpenMS
Loading...
Searching...
No Matches
XMLAttributes::NativeStore Class Reference

Reusable UTF-8 attribute storage of an XML parser adapter. More...

#include <OpenMS/FORMAT/HANDLERS/XMLAttributes.h>

Classes

struct  Entry
 

Public Member Functions

void clear () noexcept
 Forgets the attributes of the previous element (keeps capacity).
 
void add (std::string_view prefix, std::string_view local, std::string_view value)
 Appends an attribute; prefix may be empty. The qualified name is "prefix:local".
 
Size size () const noexcept
 Number of attributes.
 

Private Attributes

std::vector< Entry > entries_
 
Size count_ = 0
 

Friends

class XMLAttributes
 

Detailed Description

Reusable UTF-8 attribute storage of an XML parser adapter.

Names and values are borrowed from the parser for one callback. The storage keeps its capacity across clear(), so a parse does not allocate per element once the largest element has been seen.

Member Function Documentation

◆ add()

void add ( std::string_view  prefix,
std::string_view  local,
std::string_view  value 
)

Appends an attribute; prefix may be empty. The qualified name is "prefix:local".

◆ clear()

void clear ( )
inlinenoexcept

Forgets the attributes of the previous element (keeps capacity).

◆ size()

Size size ( ) const
inlinenoexcept

Number of attributes.

Friends And Related Symbol Documentation

◆ XMLAttributes

friend class XMLAttributes
friend

Member Data Documentation

◆ count_

Size count_ = 0
private

◆ entries_

std::vector<Entry> entries_
private