Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libplist
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pwn
libplist
Commits
8186a9d3
Commit
8186a9d3
authored
Oct 15, 2009
by
Jonathan Beck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix various mistakes in C++ bindings.
parent
a922b714
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
118 additions
and
10 deletions
+118
-10
Array.h
include/plist/Array.h
+3
-3
Boolean.h
include/plist/Boolean.h
+1
-0
Data.h
include/plist/Data.h
+1
-0
Date.h
include/plist/Date.h
+1
-0
Integer.h
include/plist/Integer.h
+1
-0
Node.h
include/plist/Node.h
+1
-1
Real.h
include/plist/Real.h
+1
-0
String.h
include/plist/String.h
+1
-0
Array.cpp
src/Array.cpp
+42
-3
Boolean.cpp
src/Boolean.cpp
+4
-0
Data.cpp
src/Data.cpp
+4
-0
Date.cpp
src/Date.cpp
+4
-0
Dictionary.cpp
src/Dictionary.cpp
+42
-3
Integer.cpp
src/Integer.cpp
+4
-0
Real.cpp
src/Real.cpp
+4
-0
String.cpp
src/String.cpp
+4
-0
No files found.
include/plist/Array.h
View file @
8186a9d3
...
@@ -19,8 +19,8 @@
...
@@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
*/
#ifndef
STRING
_H
#ifndef
ARRAY
_H
#define
STRING
_H
#define
ARRAY
_H
#include <plist/Structure.h>
#include <plist/Structure.h>
#include <vector>
#include <vector>
...
@@ -49,4 +49,4 @@ class Array : public Structure
...
@@ -49,4 +49,4 @@ class Array : public Structure
};
};
#endif //
STRING
_H
#endif //
ARRAY
_H
include/plist/Boolean.h
View file @
8186a9d3
...
@@ -31,6 +31,7 @@ class Boolean : public Node
...
@@ -31,6 +31,7 @@ class Boolean : public Node
{
{
public
:
public
:
Boolean
();
Boolean
();
Boolean
(
plist_t
node
);
Boolean
(
bool
b
);
Boolean
(
bool
b
);
virtual
~
Boolean
();
virtual
~
Boolean
();
...
...
include/plist/Data.h
View file @
8186a9d3
...
@@ -32,6 +32,7 @@ class Data : public Node
...
@@ -32,6 +32,7 @@ class Data : public Node
{
{
public
:
public
:
Data
();
Data
();
Data
(
plist_t
node
);
Data
(
std
::
vector
<
char
>&
buff
);
Data
(
std
::
vector
<
char
>&
buff
);
virtual
~
Data
();
virtual
~
Data
();
...
...
include/plist/Date.h
View file @
8186a9d3
...
@@ -31,6 +31,7 @@ class Date : public Node
...
@@ -31,6 +31,7 @@ class Date : public Node
{
{
public
:
public
:
Date
();
Date
();
Date
(
plist_t
node
);
Date
(
uint64_t
i
);
Date
(
uint64_t
i
);
virtual
~
Date
();
virtual
~
Date
();
...
...
include/plist/Integer.h
View file @
8186a9d3
...
@@ -31,6 +31,7 @@ class Integer : public Node
...
@@ -31,6 +31,7 @@ class Integer : public Node
{
{
public
:
public
:
Integer
();
Integer
();
Integer
(
plist_t
node
);
Integer
(
uint64_t
i
);
Integer
(
uint64_t
i
);
virtual
~
Integer
();
virtual
~
Integer
();
...
...
include/plist/Node.h
View file @
8186a9d3
...
@@ -31,7 +31,6 @@ class Node
...
@@ -31,7 +31,6 @@ class Node
{
{
public
:
public
:
virtual
~
Node
();
virtual
~
Node
();
Node
(
plist_t
node
);
Node
(
Node
&
node
);
Node
(
Node
&
node
);
Node
&
operator
=
(
const
Node
&
node
);
Node
&
operator
=
(
const
Node
&
node
);
...
@@ -40,6 +39,7 @@ class Node
...
@@ -40,6 +39,7 @@ class Node
protected
:
protected
:
Node
();
Node
();
Node
(
plist_t
node
);
Node
(
plist_type
type
);
Node
(
plist_type
type
);
plist_t
_node
;
plist_t
_node
;
};
};
...
...
include/plist/Real.h
View file @
8186a9d3
...
@@ -31,6 +31,7 @@ class Real : public Node
...
@@ -31,6 +31,7 @@ class Real : public Node
{
{
public
:
public
:
Real
();
Real
();
Real
(
plist_t
node
);
Real
(
double
d
);
Real
(
double
d
);
virtual
~
Real
();
virtual
~
Real
();
...
...
include/plist/String.h
View file @
8186a9d3
...
@@ -32,6 +32,7 @@ class String : public Node
...
@@ -32,6 +32,7 @@ class String : public Node
{
{
public
:
public
:
String
();
String
();
String
(
plist_t
node
);
String
(
std
::
string
&
s
);
String
(
std
::
string
&
s
);
virtual
~
String
();
virtual
~
String
();
...
...
src/Array.cpp
View file @
8186a9d3
...
@@ -21,6 +21,12 @@
...
@@ -21,6 +21,12 @@
#include <stdlib.h>
#include <stdlib.h>
#include <plist/Array.h>
#include <plist/Array.h>
#include <plist/Dictionary.h>
#include <plist/Dictionary.h>
#include <plist/Boolean.h>
#include <plist/Integer.h>
#include <plist/Real.h>
#include <plist/String.h>
#include <plist/Date.h>
#include <plist/Data.h>
namespace
PList
namespace
PList
{
{
...
@@ -48,13 +54,24 @@ Array::Array(plist_t node) : Structure()
...
@@ -48,13 +54,24 @@ Array::Array(plist_t node) : Structure()
_array
.
push_back
(
new
Array
(
subnode
)
);
_array
.
push_back
(
new
Array
(
subnode
)
);
break
;
break
;
case
PLIST_BOOLEAN
:
case
PLIST_BOOLEAN
:
_array
.
push_back
(
new
Boolean
(
subnode
)
);
break
;
case
PLIST_UINT
:
case
PLIST_UINT
:
_array
.
push_back
(
new
Integer
(
subnode
)
);
break
;
case
PLIST_REAL
:
case
PLIST_REAL
:
_array
.
push_back
(
new
Real
(
subnode
)
);
break
;
case
PLIST_STRING
:
case
PLIST_STRING
:
_array
.
push_back
(
new
String
(
subnode
)
);
break
;
case
PLIST_DATE
:
case
PLIST_DATE
:
_array
.
push_back
(
new
Date
(
subnode
)
);
break
;
case
PLIST_DATA
:
case
PLIST_DATA
:
_array
.
push_back
(
new
Data
(
subnode
)
);
break
;
default
:
default
:
_array
.
push_back
(
new
Node
(
subnode
)
);
break
;
break
;
}
}
}
}
...
@@ -85,13 +102,24 @@ Array::Array(Array& a)
...
@@ -85,13 +102,24 @@ Array::Array(Array& a)
_array
.
push_back
(
new
Array
(
subnode
)
);
_array
.
push_back
(
new
Array
(
subnode
)
);
break
;
break
;
case
PLIST_BOOLEAN
:
case
PLIST_BOOLEAN
:
_array
.
push_back
(
new
Boolean
(
subnode
)
);
break
;
case
PLIST_UINT
:
case
PLIST_UINT
:
_array
.
push_back
(
new
Integer
(
subnode
)
);
break
;
case
PLIST_REAL
:
case
PLIST_REAL
:
_array
.
push_back
(
new
Real
(
subnode
)
);
break
;
case
PLIST_STRING
:
case
PLIST_STRING
:
_array
.
push_back
(
new
String
(
subnode
)
);
break
;
case
PLIST_DATE
:
case
PLIST_DATE
:
_array
.
push_back
(
new
Date
(
subnode
)
);
break
;
case
PLIST_DATA
:
case
PLIST_DATA
:
_array
.
push_back
(
new
Data
(
subnode
)
);
break
;
default
:
default
:
_array
.
push_back
(
new
Node
(
subnode
)
);
break
;
break
;
}
}
}
}
...
@@ -122,13 +150,24 @@ Array& Array::operator=(const Array& a)
...
@@ -122,13 +150,24 @@ Array& Array::operator=(const Array& a)
_array
.
push_back
(
new
Array
(
subnode
)
);
_array
.
push_back
(
new
Array
(
subnode
)
);
break
;
break
;
case
PLIST_BOOLEAN
:
case
PLIST_BOOLEAN
:
_array
.
push_back
(
new
Boolean
(
subnode
)
);
break
;
case
PLIST_UINT
:
case
PLIST_UINT
:
_array
.
push_back
(
new
Integer
(
subnode
)
);
break
;
case
PLIST_REAL
:
case
PLIST_REAL
:
_array
.
push_back
(
new
Real
(
subnode
)
);
break
;
case
PLIST_STRING
:
case
PLIST_STRING
:
_array
.
push_back
(
new
String
(
subnode
)
);
break
;
case
PLIST_DATE
:
case
PLIST_DATE
:
_array
.
push_back
(
new
Date
(
subnode
)
);
break
;
case
PLIST_DATA
:
case
PLIST_DATA
:
_array
.
push_back
(
new
Data
(
subnode
)
);
break
;
default
:
default
:
_array
.
push_back
(
new
Node
(
subnode
)
);
break
;
break
;
}
}
}
}
...
...
src/Boolean.cpp
View file @
8186a9d3
...
@@ -28,6 +28,10 @@ Boolean::Boolean() : Node(PLIST_BOOLEAN)
...
@@ -28,6 +28,10 @@ Boolean::Boolean() : Node(PLIST_BOOLEAN)
{
{
}
}
Boolean
::
Boolean
(
plist_t
node
)
:
Node
(
node
)
{
}
Boolean
::
Boolean
(
bool
b
)
:
Node
(
PLIST_BOOLEAN
)
Boolean
::
Boolean
(
bool
b
)
:
Node
(
PLIST_BOOLEAN
)
{
{
plist_set_bool_val
(
_node
,
b
);
plist_set_bool_val
(
_node
,
b
);
...
...
src/Data.cpp
View file @
8186a9d3
...
@@ -28,6 +28,10 @@ Data::Data() : Node(PLIST_DATA)
...
@@ -28,6 +28,10 @@ Data::Data() : Node(PLIST_DATA)
{
{
}
}
Data
::
Data
(
plist_t
node
)
:
Node
(
node
)
{
}
Data
::
Data
(
std
::
vector
<
char
>&
buff
)
:
Node
(
PLIST_DATA
)
Data
::
Data
(
std
::
vector
<
char
>&
buff
)
:
Node
(
PLIST_DATA
)
{
{
plist_set_data_val
(
_node
,
&
buff
[
0
],
buff
.
size
());
plist_set_data_val
(
_node
,
&
buff
[
0
],
buff
.
size
());
...
...
src/Date.cpp
View file @
8186a9d3
...
@@ -28,6 +28,10 @@ Date::Date() : Node(PLIST_DATE)
...
@@ -28,6 +28,10 @@ Date::Date() : Node(PLIST_DATE)
{
{
}
}
Date
::
Date
(
plist_t
node
)
:
Node
(
node
)
{
}
Date
::
Date
(
uint64_t
i
)
:
Node
(
PLIST_DATE
)
Date
::
Date
(
uint64_t
i
)
:
Node
(
PLIST_DATE
)
{
{
plist_set_date_val
(
_node
,
i
,
0
);
plist_set_date_val
(
_node
,
i
,
0
);
...
...
src/Dictionary.cpp
View file @
8186a9d3
...
@@ -21,6 +21,12 @@
...
@@ -21,6 +21,12 @@
#include <stdlib.h>
#include <stdlib.h>
#include <plist/Dictionary.h>
#include <plist/Dictionary.h>
#include <plist/Array.h>
#include <plist/Array.h>
#include <plist/Boolean.h>
#include <plist/Integer.h>
#include <plist/Real.h>
#include <plist/String.h>
#include <plist/Date.h>
#include <plist/Data.h>
namespace
PList
namespace
PList
{
{
...
@@ -50,13 +56,24 @@ Dictionary::Dictionary(plist_t node) : Structure()
...
@@ -50,13 +56,24 @@ Dictionary::Dictionary(plist_t node) : Structure()
_map
[
std
::
string
(
key
)]
=
new
Array
(
subnode
);
_map
[
std
::
string
(
key
)]
=
new
Array
(
subnode
);
break
;
break
;
case
PLIST_BOOLEAN
:
case
PLIST_BOOLEAN
:
_map
[
std
::
string
(
key
)]
=
new
Boolean
(
subnode
);
break
;
case
PLIST_UINT
:
case
PLIST_UINT
:
_map
[
std
::
string
(
key
)]
=
new
Integer
(
subnode
);
break
;
case
PLIST_REAL
:
case
PLIST_REAL
:
_map
[
std
::
string
(
key
)]
=
new
Real
(
subnode
);
break
;
case
PLIST_STRING
:
case
PLIST_STRING
:
_map
[
std
::
string
(
key
)]
=
new
String
(
subnode
);
break
;
case
PLIST_DATE
:
case
PLIST_DATE
:
_map
[
std
::
string
(
key
)]
=
new
Date
(
subnode
);
break
;
case
PLIST_DATA
:
case
PLIST_DATA
:
_map
[
std
::
string
(
key
)]
=
new
Data
(
subnode
);
break
;
default
:
default
:
_map
[
std
::
string
(
key
)]
=
new
Node
(
subnode
);
break
;
break
;
}
}
...
@@ -96,13 +113,24 @@ Dictionary::Dictionary(Dictionary& d)
...
@@ -96,13 +113,24 @@ Dictionary::Dictionary(Dictionary& d)
_map
[
std
::
string
(
key
)]
=
new
Array
(
subnode
);
_map
[
std
::
string
(
key
)]
=
new
Array
(
subnode
);
break
;
break
;
case
PLIST_BOOLEAN
:
case
PLIST_BOOLEAN
:
_map
[
std
::
string
(
key
)]
=
new
Boolean
(
subnode
);
break
;
case
PLIST_UINT
:
case
PLIST_UINT
:
_map
[
std
::
string
(
key
)]
=
new
Integer
(
subnode
);
break
;
case
PLIST_REAL
:
case
PLIST_REAL
:
_map
[
std
::
string
(
key
)]
=
new
Real
(
subnode
);
break
;
case
PLIST_STRING
:
case
PLIST_STRING
:
_map
[
std
::
string
(
key
)]
=
new
String
(
subnode
);
break
;
case
PLIST_DATE
:
case
PLIST_DATE
:
_map
[
std
::
string
(
key
)]
=
new
Date
(
subnode
);
break
;
case
PLIST_DATA
:
case
PLIST_DATA
:
_map
[
std
::
string
(
key
)]
=
new
Data
(
subnode
);
break
;
default
:
default
:
_map
[
std
::
string
(
key
)]
=
new
Node
(
subnode
);
break
;
break
;
}
}
...
@@ -142,13 +170,24 @@ Dictionary& Dictionary::operator=(const Dictionary& d)
...
@@ -142,13 +170,24 @@ Dictionary& Dictionary::operator=(const Dictionary& d)
_map
[
std
::
string
(
key
)]
=
new
Array
(
subnode
);
_map
[
std
::
string
(
key
)]
=
new
Array
(
subnode
);
break
;
break
;
case
PLIST_BOOLEAN
:
case
PLIST_BOOLEAN
:
_map
[
std
::
string
(
key
)]
=
new
Boolean
(
subnode
);
break
;
case
PLIST_UINT
:
case
PLIST_UINT
:
_map
[
std
::
string
(
key
)]
=
new
Integer
(
subnode
);
break
;
case
PLIST_REAL
:
case
PLIST_REAL
:
_map
[
std
::
string
(
key
)]
=
new
Real
(
subnode
);
break
;
case
PLIST_STRING
:
case
PLIST_STRING
:
_map
[
std
::
string
(
key
)]
=
new
String
(
subnode
);
break
;
case
PLIST_DATE
:
case
PLIST_DATE
:
_map
[
std
::
string
(
key
)]
=
new
Date
(
subnode
);
break
;
case
PLIST_DATA
:
case
PLIST_DATA
:
_map
[
std
::
string
(
key
)]
=
new
Data
(
subnode
);
break
;
default
:
default
:
_map
[
std
::
string
(
key
)]
=
new
Node
(
subnode
);
break
;
break
;
}
}
...
...
src/Integer.cpp
View file @
8186a9d3
...
@@ -28,6 +28,10 @@ Integer::Integer() : Node(PLIST_UINT)
...
@@ -28,6 +28,10 @@ Integer::Integer() : Node(PLIST_UINT)
{
{
}
}
Integer
::
Integer
(
plist_t
node
)
:
Node
(
node
)
{
}
Integer
::
Integer
(
uint64_t
i
)
:
Node
(
PLIST_UINT
)
Integer
::
Integer
(
uint64_t
i
)
:
Node
(
PLIST_UINT
)
{
{
plist_set_uint_val
(
_node
,
i
);
plist_set_uint_val
(
_node
,
i
);
...
...
src/Real.cpp
View file @
8186a9d3
...
@@ -28,6 +28,10 @@ Real::Real() : Node(PLIST_REAL)
...
@@ -28,6 +28,10 @@ Real::Real() : Node(PLIST_REAL)
{
{
}
}
Real
::
Real
(
plist_t
node
)
:
Node
(
node
)
{
}
Real
::
Real
(
double
d
)
:
Node
(
PLIST_REAL
)
Real
::
Real
(
double
d
)
:
Node
(
PLIST_REAL
)
{
{
plist_set_real_val
(
_node
,
d
);
plist_set_real_val
(
_node
,
d
);
...
...
src/String.cpp
View file @
8186a9d3
...
@@ -28,6 +28,10 @@ String::String() : Node(PLIST_STRING)
...
@@ -28,6 +28,10 @@ String::String() : Node(PLIST_STRING)
{
{
}
}
String
::
String
(
plist_t
node
)
:
Node
(
node
)
{
}
String
::
String
(
std
::
string
&
s
)
:
Node
(
PLIST_STRING
)
String
::
String
(
std
::
string
&
s
)
:
Node
(
PLIST_STRING
)
{
{
plist_set_string_val
(
_node
,
s
.
c_str
());
plist_set_string_val
(
_node
,
s
.
c_str
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment