summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Array.cpp45
-rw-r--r--src/Boolean.cpp4
-rw-r--r--src/Data.cpp4
-rw-r--r--src/Date.cpp4
-rw-r--r--src/Dictionary.cpp45
-rw-r--r--src/Integer.cpp4
-rw-r--r--src/Real.cpp4
-rw-r--r--src/String.cpp4
8 files changed, 108 insertions, 6 deletions
diff --git a/src/Array.cpp b/src/Array.cpp
index 6f1d3f9..0505a27 100644
--- a/src/Array.cpp
+++ b/src/Array.cpp
@@ -21,6 +21,12 @@
21#include <stdlib.h> 21#include <stdlib.h>
22#include <plist/Array.h> 22#include <plist/Array.h>
23#include <plist/Dictionary.h> 23#include <plist/Dictionary.h>
24#include <plist/Boolean.h>
25#include <plist/Integer.h>
26#include <plist/Real.h>
27#include <plist/String.h>
28#include <plist/Date.h>
29#include <plist/Data.h>
24 30
25namespace PList 31namespace PList
26{ 32{
@@ -48,13 +54,24 @@ Array::Array(plist_t node) : Structure()
48 _array.push_back( new Array(subnode) ); 54 _array.push_back( new Array(subnode) );
49 break; 55 break;
50 case PLIST_BOOLEAN: 56 case PLIST_BOOLEAN:
57 _array.push_back( new Boolean(subnode) );
58 break;
51 case PLIST_UINT: 59 case PLIST_UINT:
60 _array.push_back( new Integer(subnode) );
61 break;
52 case PLIST_REAL: 62 case PLIST_REAL:
63 _array.push_back( new Real(subnode) );
64 break;
53 case PLIST_STRING: 65 case PLIST_STRING:
66 _array.push_back( new String(subnode) );
67 break;
54 case PLIST_DATE: 68 case PLIST_DATE:
69 _array.push_back( new Date(subnode) );
70 break;
55 case PLIST_DATA: 71 case PLIST_DATA:
72 _array.push_back( new Data(subnode) );
73 break;
56 default: 74 default:
57 _array.push_back( new Node(subnode) );
58 break; 75 break;
59 } 76 }
60 } 77 }
@@ -85,13 +102,24 @@ Array::Array(Array& a)
85 _array.push_back( new Array(subnode) ); 102 _array.push_back( new Array(subnode) );
86 break; 103 break;
87 case PLIST_BOOLEAN: 104 case PLIST_BOOLEAN:
105 _array.push_back( new Boolean(subnode) );
106 break;
88 case PLIST_UINT: 107 case PLIST_UINT:
108 _array.push_back( new Integer(subnode) );
109 break;
89 case PLIST_REAL: 110 case PLIST_REAL:
111 _array.push_back( new Real(subnode) );
112 break;
90 case PLIST_STRING: 113 case PLIST_STRING:
114 _array.push_back( new String(subnode) );
115 break;
91 case PLIST_DATE: 116 case PLIST_DATE:
117 _array.push_back( new Date(subnode) );
118 break;
92 case PLIST_DATA: 119 case PLIST_DATA:
120 _array.push_back( new Data(subnode) );
121 break;
93 default: 122 default:
94 _array.push_back( new Node(subnode) );
95 break; 123 break;
96 } 124 }
97 } 125 }
@@ -122,13 +150,24 @@ Array& Array::operator=(const Array& a)
122 _array.push_back( new Array(subnode) ); 150 _array.push_back( new Array(subnode) );
123 break; 151 break;
124 case PLIST_BOOLEAN: 152 case PLIST_BOOLEAN:
153 _array.push_back( new Boolean(subnode) );
154 break;
125 case PLIST_UINT: 155 case PLIST_UINT:
156 _array.push_back( new Integer(subnode) );
157 break;
126 case PLIST_REAL: 158 case PLIST_REAL:
159 _array.push_back( new Real(subnode) );
160 break;
127 case PLIST_STRING: 161 case PLIST_STRING:
162 _array.push_back( new String(subnode) );
163 break;
128 case PLIST_DATE: 164 case PLIST_DATE:
165 _array.push_back( new Date(subnode) );
166 break;
129 case PLIST_DATA: 167 case PLIST_DATA:
168 _array.push_back( new Data(subnode) );
169 break;
130 default: 170 default:
131 _array.push_back( new Node(subnode) );
132 break; 171 break;
133 } 172 }
134 } 173 }
diff --git a/src/Boolean.cpp b/src/Boolean.cpp
index 5797d88..cc704c9 100644
--- a/src/Boolean.cpp
+++ b/src/Boolean.cpp
@@ -28,6 +28,10 @@ Boolean::Boolean() : Node(PLIST_BOOLEAN)
28{ 28{
29} 29}
30 30
31Boolean::Boolean(plist_t node) : Node(node)
32{
33}
34
31Boolean::Boolean(bool b) : Node(PLIST_BOOLEAN) 35Boolean::Boolean(bool b) : Node(PLIST_BOOLEAN)
32{ 36{
33 plist_set_bool_val(_node, b); 37 plist_set_bool_val(_node, b);
diff --git a/src/Data.cpp b/src/Data.cpp
index 2ce610d..53adfa4 100644
--- a/src/Data.cpp
+++ b/src/Data.cpp
@@ -28,6 +28,10 @@ Data::Data() : Node(PLIST_DATA)
28{ 28{
29} 29}
30 30
31Data::Data(plist_t node) : Node(node)
32{
33}
34
31Data::Data(std::vector<char>& buff) : Node(PLIST_DATA) 35Data::Data(std::vector<char>& buff) : Node(PLIST_DATA)
32{ 36{
33 plist_set_data_val(_node, &buff[0], buff.size()); 37 plist_set_data_val(_node, &buff[0], buff.size());
diff --git a/src/Date.cpp b/src/Date.cpp
index 56e1e8e..f6a6f42 100644
--- a/src/Date.cpp
+++ b/src/Date.cpp
@@ -28,6 +28,10 @@ Date::Date() : Node(PLIST_DATE)
28{ 28{
29} 29}
30 30
31Date::Date(plist_t node) : Node(node)
32{
33}
34
31Date::Date(uint64_t i) : Node(PLIST_DATE) 35Date::Date(uint64_t i) : Node(PLIST_DATE)
32{ 36{
33 plist_set_date_val(_node, i, 0); 37 plist_set_date_val(_node, i, 0);
diff --git a/src/Dictionary.cpp b/src/Dictionary.cpp
index 5bace76..6879e33 100644
--- a/src/Dictionary.cpp
+++ b/src/Dictionary.cpp
@@ -21,6 +21,12 @@
21#include <stdlib.h> 21#include <stdlib.h>
22#include <plist/Dictionary.h> 22#include <plist/Dictionary.h>
23#include <plist/Array.h> 23#include <plist/Array.h>
24#include <plist/Boolean.h>
25#include <plist/Integer.h>
26#include <plist/Real.h>
27#include <plist/String.h>
28#include <plist/Date.h>
29#include <plist/Data.h>
24 30
25namespace PList 31namespace PList
26{ 32{
@@ -50,13 +56,24 @@ Dictionary::Dictionary(plist_t node) : Structure()
50 _map[std::string(key)] = new Array(subnode); 56 _map[std::string(key)] = new Array(subnode);
51 break; 57 break;
52 case PLIST_BOOLEAN: 58 case PLIST_BOOLEAN:
59 _map[std::string(key)] = new Boolean(subnode);
60 break;
53 case PLIST_UINT: 61 case PLIST_UINT:
62 _map[std::string(key)] = new Integer(subnode);
63 break;
54 case PLIST_REAL: 64 case PLIST_REAL:
65 _map[std::string(key)] = new Real(subnode);
66 break;
55 case PLIST_STRING: 67 case PLIST_STRING:
68 _map[std::string(key)] = new String(subnode);
69 break;
56 case PLIST_DATE: 70 case PLIST_DATE:
71 _map[std::string(key)] = new Date(subnode);
72 break;
57 case PLIST_DATA: 73 case PLIST_DATA:
74 _map[std::string(key)] = new Data(subnode);
75 break;
58 default: 76 default:
59 _map[std::string(key)] = new Node(subnode);
60 break; 77 break;
61 } 78 }
62 79
@@ -96,13 +113,24 @@ Dictionary::Dictionary(Dictionary& d)
96 _map[std::string(key)] = new Array(subnode); 113 _map[std::string(key)] = new Array(subnode);
97 break; 114 break;
98 case PLIST_BOOLEAN: 115 case PLIST_BOOLEAN:
116 _map[std::string(key)] = new Boolean(subnode);
117 break;
99 case PLIST_UINT: 118 case PLIST_UINT:
119 _map[std::string(key)] = new Integer(subnode);
120 break;
100 case PLIST_REAL: 121 case PLIST_REAL:
122 _map[std::string(key)] = new Real(subnode);
123 break;
101 case PLIST_STRING: 124 case PLIST_STRING:
125 _map[std::string(key)] = new String(subnode);
126 break;
102 case PLIST_DATE: 127 case PLIST_DATE:
128 _map[std::string(key)] = new Date(subnode);
129 break;
103 case PLIST_DATA: 130 case PLIST_DATA:
131 _map[std::string(key)] = new Data(subnode);
132 break;
104 default: 133 default:
105 _map[std::string(key)] = new Node(subnode);
106 break; 134 break;
107 } 135 }
108 136
@@ -142,13 +170,24 @@ Dictionary& Dictionary::operator=(const Dictionary& d)
142 _map[std::string(key)] = new Array(subnode); 170 _map[std::string(key)] = new Array(subnode);
143 break; 171 break;
144 case PLIST_BOOLEAN: 172 case PLIST_BOOLEAN:
173 _map[std::string(key)] = new Boolean(subnode);
174 break;
145 case PLIST_UINT: 175 case PLIST_UINT:
176 _map[std::string(key)] = new Integer(subnode);
177 break;
146 case PLIST_REAL: 178 case PLIST_REAL:
179 _map[std::string(key)] = new Real(subnode);
180 break;
147 case PLIST_STRING: 181 case PLIST_STRING:
182 _map[std::string(key)] = new String(subnode);
183 break;
148 case PLIST_DATE: 184 case PLIST_DATE:
185 _map[std::string(key)] = new Date(subnode);
186 break;
149 case PLIST_DATA: 187 case PLIST_DATA:
188 _map[std::string(key)] = new Data(subnode);
189 break;
150 default: 190 default:
151 _map[std::string(key)] = new Node(subnode);
152 break; 191 break;
153 } 192 }
154 193
diff --git a/src/Integer.cpp b/src/Integer.cpp
index d4a7645..2a7429a 100644
--- a/src/Integer.cpp
+++ b/src/Integer.cpp
@@ -28,6 +28,10 @@ Integer::Integer() : Node(PLIST_UINT)
28{ 28{
29} 29}
30 30
31Integer::Integer(plist_t node) : Node(node)
32{
33}
34
31Integer::Integer(uint64_t i) : Node(PLIST_UINT) 35Integer::Integer(uint64_t i) : Node(PLIST_UINT)
32{ 36{
33 plist_set_uint_val(_node, i); 37 plist_set_uint_val(_node, i);
diff --git a/src/Real.cpp b/src/Real.cpp
index 41c5d87..5416887 100644
--- a/src/Real.cpp
+++ b/src/Real.cpp
@@ -28,6 +28,10 @@ Real::Real() : Node(PLIST_REAL)
28{ 28{
29} 29}
30 30
31Real::Real(plist_t node) : Node(node)
32{
33}
34
31Real::Real(double d) : Node(PLIST_REAL) 35Real::Real(double d) : Node(PLIST_REAL)
32{ 36{
33 plist_set_real_val(_node, d); 37 plist_set_real_val(_node, d);
diff --git a/src/String.cpp b/src/String.cpp
index 24b4ce8..7bf744c 100644
--- a/src/String.cpp
+++ b/src/String.cpp
@@ -28,6 +28,10 @@ String::String() : Node(PLIST_STRING)
28{ 28{
29} 29}
30 30
31String::String(plist_t node) : Node(node)
32{
33}
34
31String::String(std::string& s) : Node(PLIST_STRING) 35String::String(std::string& s) : Node(PLIST_STRING)
32{ 36{
33 plist_set_string_val(_node, s.c_str()); 37 plist_set_string_val(_node, s.c_str());