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
c17b420a
Commit
c17b420a
authored
Oct 18, 2009
by
Jonathan Beck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweak Dictioonary interface a bit.
parent
6f84d30c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
Dictionary.h
include/plist/Dictionary.h
+2
-1
Dictionary.cpp
src/Dictionary.cpp
+10
-1
No files found.
include/plist/Dictionary.h
View file @
c17b420a
...
...
@@ -45,7 +45,8 @@ class Dictionary : public Structure
Node
*
operator
[](
const
std
::
string
&
key
);
iterator
Begin
();
iterator
End
();
void
Insert
(
const
std
::
string
&
key
,
Node
*
node
);
iterator
Find
(
const
std
::
string
&
key
);
iterator
Insert
(
const
std
::
string
&
key
,
Node
*
node
);
void
Remove
(
Node
*
node
);
void
Remove
(
const
std
::
string
&
key
);
...
...
src/Dictionary.cpp
View file @
c17b420a
...
...
@@ -229,7 +229,12 @@ Dictionary::iterator Dictionary::End()
return
_map
.
end
();
}
void
Dictionary
::
Insert
(
const
std
::
string
&
key
,
Node
*
node
)
Dictionary
::
iterator
Dictionary
::
Find
(
const
std
::
string
&
key
)
{
return
_map
.
find
(
key
);
}
Dictionary
::
iterator
Dictionary
::
Insert
(
const
std
::
string
&
key
,
Node
*
node
)
{
if
(
node
)
{
...
...
@@ -237,7 +242,9 @@ void Dictionary::Insert(const std::string& key, Node* node)
plist_dict_insert_item
(
_node
,
key
.
c_str
(),
clone
->
GetPlist
());
delete
_map
[
key
];
_map
[
key
]
=
clone
;
return
_map
.
find
(
key
);
}
return
iterator
(
NULL
);
}
void
Dictionary
::
Remove
(
Node
*
node
)
...
...
@@ -249,6 +256,7 @@ void Dictionary::Remove(Node* node)
plist_dict_remove_item
(
_node
,
key
);
std
::
string
skey
=
key
;
free
(
key
);
_map
.
erase
(
skey
);
delete
node
;
}
}
...
...
@@ -257,6 +265,7 @@ void Dictionary::Remove(const std::string& key)
{
plist_dict_remove_item
(
_node
,
key
.
c_str
());
delete
_map
[
key
];
_map
.
erase
(
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