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
6b719ecd
Commit
6b719ecd
authored
Mar 19, 2014
by
Nikias Bassen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deprecated plist_dict_insert_item in favor of plist_dict_set_item
parent
f9299fa8
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
10 deletions
+21
-10
Dictionary.h
include/plist/Dictionary.h
+2
-1
plist.h
include/plist/plist.h
+11
-1
Dictionary.cpp
src/Dictionary.cpp
+7
-2
plist.c
src/plist.c
+1
-6
No files found.
include/plist/Dictionary.h
View file @
6b719ecd
...
...
@@ -46,7 +46,8 @@ public :
iterator
Begin
();
iterator
End
();
iterator
Find
(
const
std
::
string
&
key
);
iterator
Insert
(
const
std
::
string
&
key
,
Node
*
node
);
iterator
Set
(
const
std
::
string
&
key
,
Node
*
node
);
DEPRECATED
(
"use Set() instead"
)
iterator
Insert
(
const
std
::
string
&
key
,
Node
*
node
);
void
Remove
(
Node
*
node
);
void
Remove
(
const
std
::
string
&
key
);
std
::
string
GetNodeKey
(
Node
*
key
);
...
...
include/plist/plist.h
View file @
6b719ecd
...
...
@@ -44,9 +44,17 @@ extern "C"
#else
#define PLIST_API __declspec( dllimport )
#endif
#define DEPRECATED(x) __declspec(deprecated(x))
#else
#include <stdint.h>
#define PLIST_API
#ifdef __GNUC__
#define DEPRECATED(x) __attribute__((deprecated(x)))
#elif defined(_MSC_VER)
#else
#define DEPRECATED(x)
#pragma message("WARNING: You need to implement DEPRECATED for this compiler")
#endif
#endif
#include <sys/types.h>
...
...
@@ -322,11 +330,13 @@ extern "C"
/**
* Insert a new item into a #PLIST_DICT node.
*
* @deprecated Deprecated. Use plist_dict_set_item instead.
*
* @param node the node of type #PLIST_DICT
* @param item the new item to insert
* @param key The identifier of the item to insert.
*/
PLIST_API
void
plist_dict_insert_item
(
plist_t
node
,
const
char
*
key
,
plist_t
item
);
DEPRECATED
(
"use plist_dict_set_item instead"
)
PLIST_API
void
plist_dict_insert_item
(
plist_t
node
,
const
char
*
key
,
plist_t
item
);
/**
* Remove an existing position in a #PLIST_DICT node.
...
...
src/Dictionary.cpp
View file @
6b719ecd
...
...
@@ -140,13 +140,13 @@ Dictionary::iterator Dictionary::Find(const std::string& key)
return
_map
.
find
(
key
);
}
Dictionary
::
iterator
Dictionary
::
Inser
t
(
const
std
::
string
&
key
,
Node
*
node
)
Dictionary
::
iterator
Dictionary
::
Se
t
(
const
std
::
string
&
key
,
Node
*
node
)
{
if
(
node
)
{
Node
*
clone
=
node
->
Clone
();
UpdateNodeParent
(
clone
);
plist_dict_
inser
t_item
(
_node
,
key
.
c_str
(),
clone
->
GetPlist
());
plist_dict_
se
t_item
(
_node
,
key
.
c_str
(),
clone
->
GetPlist
());
delete
_map
[
key
];
_map
[
key
]
=
clone
;
return
_map
.
find
(
key
);
...
...
@@ -154,6 +154,11 @@ Dictionary::iterator Dictionary::Insert(const std::string& key, Node* node)
return
iterator
(
this
->
_map
.
end
());
}
Dictionary
::
iterator
Dictionary
::
Insert
(
const
std
::
string
&
key
,
Node
*
node
)
{
return
this
->
Set
(
key
,
node
);
}
void
Dictionary
::
Remove
(
Node
*
node
)
{
if
(
node
)
...
...
src/plist.c
View file @
6b719ecd
...
...
@@ -424,12 +424,7 @@ void plist_dict_set_item(plist_t node, const char* key, plist_t item)
void
plist_dict_insert_item
(
plist_t
node
,
const
char
*
key
,
plist_t
item
)
{
if
(
node
&&
PLIST_DICT
==
plist_get_node_type
(
node
))
{
node_attach
(
node
,
plist_new_key
(
key
));
node_attach
(
node
,
item
);
}
return
;
plist_dict_set_item
(
node
,
key
,
item
);
}
void
plist_dict_remove_item
(
plist_t
node
,
const
char
*
key
)
...
...
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