OpenMS
Loading...
Searching...
No Matches
XMLAttributes.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Timo Sachsenberg $
6// $Authors: Timo Sachsenberg $
7// --------------------------------------------------------------------------
8
9#pragma once
10
12
13namespace OpenMS::Internal
14{
31 class OPENMS_DLLAPI XMLAttributes
32 {
33 public:
34 XMLAttributes(const XMLAttributes&) = default;
36
44 explicit XMLAttributes(const void* attributes) noexcept :
45 attributes_(attributes)
46 {
47 }
48
50 const char16_t* value(const char16_t* qname) const;
51
53 const char16_t* value(const char* qname) const;
54
56 SignedSize index(const char16_t* qname) const;
57
59 const char16_t* valueByIndex(Size i) const;
60
62 const void* handle() const noexcept { return attributes_; }
63
64 private:
65 const void* attributes_;
66 };
67
68} // namespace OpenMS::Internal
Xerces-free, lightweight view over the attribute list of an XML element.
Definition XMLAttributes.h:32
const char16_t * valueByIndex(Size i) const
Value of the attribute at position i (UTF-16 code units).
XMLAttributes(const XMLAttributes &)=default
const void * attributes_
Definition XMLAttributes.h:65
const void * handle() const noexcept
Opaque handle to the underlying attribute list (libOpenMS-internal use).
Definition XMLAttributes.h:62
XMLAttributes(const void *attributes) noexcept
Wrap a live attribute list (non-owning).
Definition XMLAttributes.h:44
XMLAttributes & operator=(const XMLAttributes &)=default
SignedSize index(const char16_t *qname) const
Index of the attribute named qname, or a negative value if absent.
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.
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
Namespace used to hide implementation details from users.
Definition BayesianProteinInferenceAlgorithm.h:26