LibreOffice Module xmloff (master)  1
SvXMLAttrCollection.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  */
9 
10 #pragma once
11 
12 #include "SvXMLAttr.hxx"
13 
14 #include <xmloff/namespacemap.hxx>
15 #include <rtl/ustring.hxx>
16 #include <sal/types.h>
17 #include <vector>
18 
20 {
21 public:
23  std::vector<SvXMLAttr> aAttrs;
24 
25  bool operator==(const SvXMLAttrCollection &rCmp) const;
26  bool AddAttr( const OUString& rLName,
27  const OUString& rValue );
28  bool AddAttr( const OUString& rPrefix,
29  const OUString& rNamespace,
30  const OUString& rLName,
31  const OUString& rValue );
32  bool AddAttr( const OUString& rPrefix,
33  const OUString& rLName,
34  const OUString& rValue );
35 
36  bool SetAt( size_t i,
37  const OUString& rLName,
38  const OUString& rValue );
39  bool SetAt( size_t i,
40  const OUString& rPrefix,
41  const OUString& rNamespace,
42  const OUString& rLName,
43  const OUString& rValue );
44  bool SetAt( size_t i,
45  const OUString& rPrefix,
46  const OUString& rLName,
47  const OUString& rValue );
48 
49  void Remove( size_t i );
50 
51  size_t GetAttrCount() const;
52  const OUString& GetAttrLName(size_t i) const;
53  const OUString& GetAttrValue(size_t i) const;
54  OUString GetAttrNamespace( size_t i ) const;
55  OUString GetAttrPrefix( size_t i ) const;
56  const OUString& GetNamespace( sal_uInt16 i ) const;
57  const OUString& GetPrefix( sal_uInt16 i ) const;
58  sal_uInt16 GetFirstNamespaceIndex() const;
59  sal_uInt16 GetNextNamespaceIndex( sal_uInt16 nIdx ) const;
60 
61 private:
62  sal_uInt16 GetPrefixPos( size_t i ) const;
63 };
64 
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
66 
std::vector< SvXMLAttr > aAttrs
size_t GetAttrCount() const
sal_uInt16 GetPrefixPos(size_t i) const
bool SetAt(size_t i, const OUString &rLName, const OUString &rValue)
sal_uInt16 GetNextNamespaceIndex(sal_uInt16 nIdx) const
SvXMLNamespaceMap aNamespaceMap
sal_uInt16 GetFirstNamespaceIndex() const
OUString GetAttrNamespace(size_t i) const
OUString GetAttrPrefix(size_t i) const
const OUString & GetPrefix(sal_uInt16 i) const
const OUString & GetAttrValue(size_t i) const
bool operator==(const SvXMLAttrCollection &rCmp) const
const OUString & GetAttrLName(size_t i) const
const OUString & GetNamespace(sal_uInt16 i) const
bool AddAttr(const OUString &rLName, const OUString &rValue)