summaryrefslogtreecommitdiffstats
path: root/include/plist/Dictionary.h
diff options
context:
space:
mode:
authorGravatar Jonathan Beck2009-10-13 20:04:06 +0200
committerGravatar Jonathan Beck2009-10-13 20:04:06 +0200
commita922b714c9b75fdc67735d674758d4eaedfd32f9 (patch)
tree509ec53c18c0be36a9e650eb0f760854cd8d4957 /include/plist/Dictionary.h
parente492ef675c404cc6c0d1cfa26e47a1c16c850d5f (diff)
downloadlibplist-a922b714c9b75fdc67735d674758d4eaedfd32f9.tar.gz
libplist-a922b714c9b75fdc67735d674758d4eaedfd32f9.tar.bz2
Add C++ binding.
Diffstat (limited to 'include/plist/Dictionary.h')
-rw-r--r--include/plist/Dictionary.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/include/plist/Dictionary.h b/include/plist/Dictionary.h
new file mode 100644
index 0000000..8468ab5
--- /dev/null
+++ b/include/plist/Dictionary.h
@@ -0,0 +1,58 @@
1/*
2 * Dictionary.h
3 * Dictionary node type for C++ binding
4 *
5 * Copyright (c) 2009 Jonathan Beck All Rights Reserved.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#ifndef DICTIONARY_H
23#define DICTIONARY_H
24
25#include <plist/Structure.h>
26#include <map>
27#include <string>
28
29namespace PList
30{
31
32class Dictionary : public Structure
33{
34 public :
35 Dictionary();
36 Dictionary(plist_t node);
37 Dictionary(Dictionary& d);
38 Dictionary& operator=(const Dictionary& d);
39 virtual ~Dictionary();
40
41 typedef std::map<std::string,Node*>::iterator iterator;
42
43 Node* operator[](std::string& key);
44 iterator Begin();
45 iterator End();
46 void Insert(std::string& key, Node* node);
47 void Remove(Node* node);
48 void Remove(std::string& key);
49
50 private :
51 std::map<std::string,Node*> _map;
52
53
54};
55
56};
57
58#endif // DICTIONARY_H