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 
24 #include "librevenge-api.h"
25 
26 #include "RVNGProperty.h"
27 
28 namespace librevenge
29 {
30 
31 // we use the pimpl pattern so we don't expose any STL symbols to the rest of
32 // the world.. yes, this is quite annoying.
33 
34 class RVNGPropertyListImpl;
35 class RVNGPropertyListIterImpl;
36 class RVNGPropertyListVector;
37 
39 {
40 public:
43  virtual ~RVNGPropertyList();
44  void insert(const char *name, RVNGProperty *prop);
45  void insert(const char *name, const char *val);
46  void insert(const char *name, const int val);
47  void insert(const char *name, const bool val);
48  void insert(const char *name, const RVNGString &val);
49  void insert(const char *name, const double val, const RVNGUnit units = RVNG_INCH);
50  void insert(const char *name, const unsigned char *buffer, const unsigned long bufferSize);
51  void insert(const char *name, const RVNGBinaryData &data);
52  void insert(const char *name, const RVNGPropertyListVector &vec);
53  void remove(const char *name);
54  void clear();
55  bool empty() const;
56 
57  const RVNGProperty *operator[](const char *name) const;
58  const RVNGPropertyListVector *child(const char *name) const;
59  const RVNGPropertyList &operator=(const RVNGPropertyList &propList);
60 
61  RVNGString getPropString() const;
62 
64  {
65  public:
66  Iter(const RVNGPropertyList &propList);
67  virtual ~Iter();
68  void rewind();
69  bool next();
70  bool last();
71  const RVNGProperty *operator()() const;
72  const char *key() const;
73  const RVNGPropertyListVector *child() const;
74  private:
76  Iter(const Iter &);
77  Iter &operator=(const Iter &);
78  };
79  friend class RVNGPropertyList::Iter;
80 
81 private:
83 };
84 
85 }
86 
87 #endif /* RVNGPROPERTYLIST_H */
88 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
librevenge::RVNGPropertyList::child
const RVNGPropertyListVector * child(const char *name) const
Definition: RVNGPropertyList.cpp:350
librevenge::RVNGPropertyFactory::newPointProp
static RVNGProperty * newPointProp(const double val)
Definition: RVNGProperty.cpp:447
librevenge::RVNGPropertyListImpl
Definition: RVNGPropertyList.cpp:154
librevenge::RVNGPropertyFactory::newTwipProp
static RVNGProperty * newTwipProp(const double val)
Definition: RVNGProperty.cpp:452
librevenge::RVNGPropertyList::~RVNGPropertyList
virtual ~RVNGPropertyList()
Definition: RVNGPropertyList.cpp:255
librevenge::RVNGPropertyListIterImpl::next
bool next()
Definition: RVNGPropertyList.cpp:436
RVNGProperty.h
librevenge::RVNGPropertyListIterImpl::operator()
const RVNGProperty * operator()() const
Definition: RVNGPropertyList.cpp:452
librevenge::RVNGPropertyListElement
Definition: RVNGPropertyList.cpp:125
librevenge::RVNGString::append
void void append(const RVNGString &s)
Definition: RVNGString.cpp:211
librevenge::RVNGPropertyList::Iter::Iter
Iter(const Iter &)
librevenge::RVNGProperty::clone
virtual RVNGProperty * clone() const =0
librevenge-api.h
librevenge::RVNGPropertyListImpl::remove
void remove(const char *name)
Definition: RVNGPropertyList.cpp:226
librevenge::RVNGString::empty
bool empty() const
Definition: RVNGString.cpp:252
librevenge::RVNGPropertyListImpl::clear
void clear()
Definition: RVNGPropertyList.cpp:235
librevenge::RVNGPropertyList::remove
void remove(const char *name)
Definition: RVNGPropertyList.cpp:333
librevenge::RVNGPropertyFactory::newBinaryDataProp
static RVNGProperty * newBinaryDataProp(const RVNGBinaryData &data)
Definition: RVNGProperty.cpp:412
librevenge::RVNGPropertyListImpl::operator=
RVNGPropertyListImpl & operator=(const RVNGPropertyListImpl &plist)
Definition: RVNGPropertyList.cpp:171
librevenge::RVNGPropertyListImpl::m_map
std::map< std::string, RVNGPropertyListElement > m_map
Definition: RVNGPropertyList.cpp:168
librevenge::RVNGPropertyListIterImpl::child
const RVNGPropertyListVector * child() const
Definition: RVNGPropertyList.cpp:461
librevenge::RVNGPropertyListElement::m_prop
RVNGProperty * m_prop
Definition: RVNGPropertyList.cpp:149
librevenge::RVNGPropertyList::RVNGPropertyList
RVNGPropertyList()
Definition: RVNGPropertyList.cpp:245
librevenge::RVNGPropertyFactory::newStringProp
static RVNGProperty * newStringProp(const RVNGString &str)
Definition: RVNGProperty.cpp:402
librevenge::RVNGPropertyListVector::getPropString
RVNGString getPropString() const
Definition: RVNGPropertyListVector.cpp:177
librevenge.h
librevenge::RVNGPropertyListElement::~RVNGPropertyListElement
~RVNGPropertyListElement()
Definition: RVNGPropertyList.cpp:138
librevenge::RVNGPropertyList::Iter::next
bool next()
Definition: RVNGPropertyList.cpp:489
librevenge::RVNGPropertyListImpl::insert
void insert(const char *name, RVNGProperty *prop)
Definition: RVNGPropertyList.cpp:196
librevenge::RVNGPropertyListIterImpl
Definition: RVNGPropertyList.cpp:400
librevenge::RVNGPropertyList::insert
void insert(const char *name, RVNGProperty *prop)
Definition: RVNGPropertyList.cpp:260
librevenge::RVNGPropertyList::Iter::key
const char * key() const
Definition: RVNGPropertyList.cpp:509
librevenge::RVNGPropertyList::empty
bool empty() const
Definition: RVNGPropertyList.cpp:360
librevenge::RVNGPropertyList
Definition: RVNGPropertyList.h:39
librevenge::RVNGPropertyListElement::RVNGPropertyListElement
RVNGPropertyListElement(const RVNGPropertyListElement &elem)
Definition: RVNGPropertyList.cpp:128
librevenge::RVNGPropertyListElement::m_vec
RVNGPropertyListVector * m_vec
Definition: RVNGPropertyList.cpp:150
librevenge::RVNGPropertyListIterImpl::rewind
void rewind()
Definition: RVNGPropertyList.cpp:429
librevenge::RVNGPropertyListImpl::RVNGPropertyListImpl
RVNGPropertyListImpl()
Definition: RVNGPropertyList.cpp:156
librevenge::RVNGPropertyListVector::clone
RVNGProperty * clone() const
Definition: RVNGPropertyListVector.cpp:129
librevenge::RVNGPropertyListIterImpl::RVNGPropertyListIterImpl
RVNGPropertyListIterImpl(const RVNGPropertyListImpl *impl)
Definition: RVNGPropertyList.cpp:422
librevenge::RVNGPropertyListImpl::child
const RVNGPropertyListVector * child(const char *name) const
Definition: RVNGPropertyList.cpp:185
librevenge::RVNGPropertyList::Iter::operator=
Iter & operator=(const Iter &)
librevenge::RVNGBinaryData
A representation of arbitrary binary data.
Definition: RVNGBinaryData.h:37
librevenge::RVNGProperty
Definition: RVNGProperty.h:33
librevenge::RVNGPropertyList::Iter::operator()
const RVNGProperty * operator()() const
Definition: RVNGPropertyList.cpp:499
librevenge::RVNGPropertyList::Iter::m_iterImpl
RVNGPropertyListIterImpl * m_iterImpl
Definition: RVNGPropertyList.h:75
librevenge::RVNGPropertyListElement::operator=
RVNGPropertyListElement & operator=(const RVNGPropertyListElement &elem)
Definition: RVNGPropertyList.cpp:143
librevenge::RVNGPropertyListImpl::empty
bool empty() const
Definition: RVNGPropertyList.cpp:240
librevenge::RVNGPropertyListIterImpl::last
bool last()
Definition: RVNGPropertyList.cpp:447
librevenge::RVNGString
UTF-8 string.
Definition: RVNGString.h:34
librevenge::RVNG_POINT
@ RVNG_POINT
Definition: RVNGProperty.h:30
librevenge::RVNGPropertyList::getPropString
RVNGString getPropString() const
Definition: RVNGPropertyList.cpp:366
librevenge::RVNGUnit
RVNGUnit
Definition: RVNGProperty.h:30
librevenge::RVNGPropertyList::Iter::last
bool last()
Definition: RVNGPropertyList.cpp:494
librevenge::RVNGPropertyList::Iter
Definition: RVNGPropertyList.h:64
librevenge::RVNGPropertyListIterImpl::m_imaginaryFirst
bool m_imaginaryFirst
Definition: RVNGPropertyList.cpp:416
librevenge::RVNGPropertyListIterImpl::RVNGPropertyListIterImpl
RVNGPropertyListIterImpl(const RVNGPropertyListIterImpl &other)
librevenge::RVNGPropertyListIterImpl::operator=
RVNGPropertyListIterImpl & operator=(const RVNGPropertyListIterImpl &other)
librevenge::RVNG_INCH
@ RVNG_INCH
Definition: RVNGProperty.h:30
librevenge::RVNGPropertyList::clear
void clear()
Definition: RVNGPropertyList.cpp:355
librevenge::RVNGPropertyList::m_impl
RVNGPropertyListImpl * m_impl
Definition: RVNGPropertyList.h:82
librevenge::RVNG_PERCENT
@ RVNG_PERCENT
Definition: RVNGProperty.h:30
librevenge::RVNGPropertyListImpl::RVNGPropertyListImpl
RVNGPropertyListImpl(const RVNGPropertyListImpl &plist)
Definition: RVNGPropertyList.cpp:157
librevenge::RVNGString::cstr
const char * cstr() const
Definition: RVNGString.cpp:174
librevenge::RVNGPropertyFactory::newDoubleProp
static RVNGProperty * newDoubleProp(const double val)
Definition: RVNGProperty.cpp:432
librevenge::RVNGPropertyList::operator=
const RVNGPropertyList & operator=(const RVNGPropertyList &propList)
Definition: RVNGPropertyList.cpp:338
librevenge::RVNGPropertyFactory::newPercentProp
static RVNGProperty * newPercentProp(const double val)
Definition: RVNGProperty.cpp:442
librevenge::RVNGPropertyListElement::RVNGPropertyListElement
RVNGPropertyListElement()
Definition: RVNGPropertyList.cpp:127
librevenge::RVNGPropertyListIterImpl::key
const char * key() const
Definition: RVNGPropertyList.cpp:468
librevenge::RVNG_GENERIC
@ RVNG_GENERIC
Definition: RVNGProperty.h:30
librevenge::RVNGPropertyList::operator[]
const RVNGProperty * operator[](const char *name) const
Definition: RVNGPropertyList.cpp:345
librevenge::RVNGPropertyListImpl::~RVNGPropertyListImpl
~RVNGPropertyListImpl()
Definition: RVNGPropertyList.cpp:158
librevenge::RVNGPropertyListVector
Definition: RVNGPropertyListVector.h:35
librevenge
Definition: RVNGBinaryData.cpp:39
librevenge::RVNGPropertyList::Iter::Iter
Iter(const RVNGPropertyList &propList)
Definition: RVNGPropertyList.cpp:473
librevenge::RVNGPropertyList::Iter::rewind
void rewind()
Definition: RVNGPropertyList.cpp:483
librevenge::RVNGPropertyList::Iter::child
const RVNGPropertyListVector * child() const
Definition: RVNGPropertyList.cpp:504
librevenge::RVNGPropertyFactory::newIntProp
static RVNGProperty * newIntProp(const int val)
Definition: RVNGProperty.cpp:422
librevenge::RVNGPropertyListIterImpl::m_map
std::map< std::string, RVNGPropertyListElement > * m_map
Definition: RVNGPropertyList.cpp:418
librevenge::RVNGPropertyListElement::RVNGPropertyListElement
RVNGPropertyListElement(RVNGProperty *prop, RVNGPropertyListVector *vec)
Definition: RVNGPropertyList.cpp:136
librevenge::RVNGPropertyList::Iter::~Iter
virtual ~Iter()
Definition: RVNGPropertyList.cpp:478
librevenge::RVNG_TWIP
@ RVNG_TWIP
Definition: RVNGProperty.h:30
REVENGE_API
#define REVENGE_API
Definition: librevenge-api.h:34
librevenge::RVNGPropertyListIterImpl::m_iter
std::map< std::string, RVNGPropertyListElement >::iterator m_iter
Definition: RVNGPropertyList.cpp:417
librevenge::RVNGPropertyListImpl::operator[]
const RVNGProperty * operator[](const char *name) const
Definition: RVNGPropertyList.cpp:177
librevenge::RVNGPropertyFactory::newInchProp
static RVNGProperty * newInchProp(const double val)
Definition: RVNGProperty.cpp:437
librevenge::RVNGPropertyFactory::newBoolProp
static RVNGProperty * newBoolProp(const bool val)
Definition: RVNGProperty.cpp:427

Generated for librevenge by doxygen 1.8.18