- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

RVNGPropertyList.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* librevenge
3 * Version: MPL 2.0 / LGPLv2.1+
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 * Major Contributor(s):
10 * Copyright (C) 2004 William Lachance (wrlach@gmail.com)
11 * Copyright (C) 2006 Fridrich Strba (fridrich.strba@bluewin.ch)
12 *
13 * For minor contributions see the git repository.
14 *
15 * Alternatively, the contents of this file may be used under the terms
16 * of the GNU Lesser General Public License Version 2.1 or later
17 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
18 * applicable instead of those above.
19 */
20
21 #ifndef RVNGPROPERTYLIST_H
22 #define RVNGPROPERTYLIST_H
23 #include "RVNGProperty.h"
24
25 namespace librevenge
26 {
27
28 // we use the pimpl pattern so we don't expose any STL symbols to the rest of
29 // the world.. yes, this is quite annoying.
30
31 class RVNGPropertyListImpl;
32 class RVNGPropertyListIterImpl;
33 class RVNGPropertyListVector;
34
35 class RVNGPropertyList
36 {
37 public:
38 RVNGPropertyList();
39 RVNGPropertyList(const RVNGPropertyList &);
40 virtual ~RVNGPropertyList();
41 void insert(const char *name, RVNGProperty *prop);
42 void insert(const char *name, const char *val);
43 void insert(const char *name, const int val);
44 void insert(const char *name, const bool val);
45 void insert(const char *name, const RVNGString &val);
46 void insert(const char *name, const double val, const RVNGUnit units = RVNG_INCH);
47 void insert(const char *name, const unsigned char *buffer, const unsigned long bufferSize);
48 void insert(const char *name, const RVNGBinaryData &data);
49 void insert(const char *name, const RVNGPropertyListVector &vec);
50 void remove(const char *name);
51 void clear();
52 bool empty() const;
53
54 const RVNGProperty *operator[](const char *name) const;
55 const RVNGPropertyListVector *child(const char *name) const;
56 const RVNGPropertyList &operator=(const RVNGPropertyList &propList);
57
58 RVNGString getPropString() const;
59
60 class Iter
61 {
62 public:
63 Iter(const RVNGPropertyList &propList);
64 virtual ~Iter();
65 void rewind();
66 bool next();
67 bool last();
68 const RVNGProperty *operator()() const;
69 const char *key() const;
70 const RVNGPropertyListVector *child() const;
71 private:
72 RVNGPropertyListIterImpl *m_iterImpl;
73 Iter(const Iter &);
74 Iter &operator=(const Iter &);
75 };
76 friend class RVNGPropertyList::Iter;
77
78 private:
79 mutable RVNGPropertyListImpl *m_impl;
80 };
81
82 }
83
84 #endif /* RVNGPROPERTYLIST_H */
85 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
librevenge::RVNGPropertyListIterImpl
Definition: RVNGPropertyList.cpp:386
librevenge::RVNGPropertyList::operator[]
const RVNGProperty * operator[](const char *name) const
Definition: RVNGPropertyList.cpp:332
librevenge::RVNGPropertyList::operator=
const RVNGPropertyList & operator=(const RVNGPropertyList &propList)
Definition: RVNGPropertyList.cpp:325
librevenge::RVNGPropertyList::getPropString
RVNGString getPropString() const
Definition: RVNGPropertyList.cpp:353
librevenge::RVNGPropertyListImpl
Definition: RVNGPropertyList.cpp:140
librevenge::RVNGPropertyList::Iter::next
bool next()
Definition: RVNGPropertyList.cpp:479
librevenge::RVNGUnit
RVNGUnit
Definition: RVNGProperty.h:27
librevenge::RVNGPropertyList::RVNGPropertyList
RVNGPropertyList()
Definition: RVNGPropertyList.cpp:232
RVNGProperty.h
librevenge::RVNGPropertyList::Iter::child
const RVNGPropertyListVector * child() const
Definition: RVNGPropertyList.cpp:494
librevenge::RVNGPropertyList::child
const RVNGPropertyListVector * child(const char *name) const
Definition: RVNGPropertyList.cpp:337
librevenge::RVNGPropertyList::Iter::m_iterImpl
RVNGPropertyListIterImpl * m_iterImpl
Definition: RVNGPropertyList.h:72
librevenge::RVNGProperty
Definition: RVNGProperty.h:29
librevenge::RVNGPropertyList::~RVNGPropertyList
virtual ~RVNGPropertyList()
Definition: RVNGPropertyList.cpp:242
librevenge::RVNGPropertyList::Iter::operator=
Iter & operator=(const Iter &)
librevenge::RVNGPropertyList::Iter::last
bool last()
Definition: RVNGPropertyList.cpp:484
librevenge::RVNGPropertyList::Iter
Definition: RVNGPropertyList.h:60
librevenge::RVNGPropertyList::Iter::key
const char * key() const
Definition: RVNGPropertyList.cpp:499
librevenge::RVNGPropertyListVector
Definition: RVNGPropertyListVector.h:32
librevenge::RVNGPropertyList::clear
void clear()
Definition: RVNGPropertyList.cpp:342
librevenge::RVNGPropertyList::Iter::operator()
const RVNGProperty * operator()() const
Definition: RVNGPropertyList.cpp:489
librevenge::RVNGBinaryData
Definition: RVNGBinaryData.h:31
librevenge::RVNGPropertyList::m_impl
RVNGPropertyListImpl * m_impl
Definition: RVNGPropertyList.h:79
librevenge::RVNG_INCH
Definition: RVNGProperty.h:27
librevenge::RVNGPropertyList::insert
void insert(const char *name, RVNGProperty *prop)
Definition: RVNGPropertyList.cpp:247
librevenge::RVNGPropertyList::Iter::~Iter
virtual ~Iter()
Definition: RVNGPropertyList.cpp:468
librevenge::RVNGPropertyList::Iter::rewind
void rewind()
Definition: RVNGPropertyList.cpp:473
librevenge::RVNGPropertyList::empty
bool empty() const
Definition: RVNGPropertyList.cpp:347
librevenge::RVNGPropertyList
Definition: RVNGPropertyList.h:35
librevenge::RVNGString
Definition: RVNGString.h:29
librevenge::RVNGPropertyList::Iter::Iter
Iter(const RVNGPropertyList &propList)
Definition: RVNGPropertyList.cpp:463