31 using Values = std::vector<std::pair<std::u16string, std::u16string>>;
44 void clear() noexcept { count_ = 0; }
46 void add(std::string_view prefix, std::string_view local, std::string_view value);
57 bool prefixed =
false;
59 mutable bool converted =
false;
62 std::string_view
name() const noexcept {
return prefixed ? std::string_view(joined) : local; }
80 const
char16_t* value(const
char16_t* qname) const;
83 const
char16_t* value(const
char* qname) const;
89 const
char16_t* valueByIndex(
Size i) const;
92 bool valueUTF8(const
char16_t* qname,
std::
string& value) const;
95 bool valueUTF8(const
char* qname,
std::
string& value) const;
101 void valueUTF8ByIndex_(
Size i,
std::
string& value) const;
Reusable UTF-8 attribute storage of an XML parser adapter.
Definition XMLAttributes.h:41
void clear() noexcept
Forgets the attributes of the previous element (keeps capacity).
Definition XMLAttributes.h:44
std::vector< Entry > entries_
Definition XMLAttributes.h:64
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.
Definition XMLAttributes.h:48
Non-owning attribute view for an XML start-element callback.
Definition XMLAttributes.h:29
std::vector< std::pair< std::u16string, std::u16string > > Values
Definition XMLAttributes.h:31
Size size() const noexcept
Number of attributes.
XMLAttributes(Values &&)=delete
XMLAttributes(const Values &&)=delete
XMLAttributes(const NativeStore &attributes) noexcept
Definition XMLAttributes.h:69
XMLAttributes(const Values &attributes) noexcept
Definition XMLAttributes.h:68
XMLAttributes(const NativeStore &&)=delete
XMLAttributes(NativeStore &&)=delete
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference.
Definition Types.h:104
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
Initialization procedures.
Definition BayesianProteinInferenceAlgorithm.h:26
Definition XMLAttributes.h:53
std::u16string value16
UTF-16 value, valid if converted.
Definition XMLAttributes.h:58
std::string_view name() const noexcept
UTF-8 qualified name (a view into joined is only taken here, as entries move when the store grows)
Definition XMLAttributes.h:62
std::string_view local
UTF-8 name if unprefixed.
Definition XMLAttributes.h:54
std::string_view value
UTF-8 value.
Definition XMLAttributes.h:55
std::string joined
UTF-8 "prefix:local" if prefixed.
Definition XMLAttributes.h:56