Array.h   Array.h 
skipping to change at line 22 skipping to change at line 22
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 1 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 1 USA
*/ */
#ifndef PLIST__ARRAY_H #ifndef PLIST_ARRAY_H
#define PLIST__ARRAY_H #define PLIST_ARRAY_H
#include <plist/Structure.h> #include <plist/Structure.h>
#include <vector> #include <vector>
namespace PList namespace PList
{ {
class Array : public Structure class Array : public Structure
{ {
public : public :
Array(Node* parent = NULL); Array(Node* parent = NULL);
Array(plist_t node, Node* parent = NULL); Array(plist_t node, Node* parent = NULL);
Array(Array& a); Array(const Array& a);
Array& operator=(Array& a); Array& operator=(Array& a);
virtual ~Array(); virtual ~Array();
Node* Clone(); Node* Clone() const;
Node* operator[](unsigned int index); Node* operator[](unsigned int index);
void Append(Node* node); void Append(Node* node);
void Insert(Node* node, unsigned int pos); void Insert(Node* node, unsigned int pos);
void Remove(Node* node); void Remove(Node* node);
void Remove(unsigned int pos); void Remove(unsigned int pos);
unsigned int GetNodeIndex(Node* node); unsigned int GetNodeIndex(Node* node) const;
private : private :
std::vector<Node*> _array; std::vector<Node*> _array;
}; };
}; };
#endif // PLIST__ARRAY_H #endif // PLIST_ARRAY_H
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added


 Boolean.h   Boolean.h 
skipping to change at line 22 skipping to change at line 22
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 1 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 1 USA
*/ */
#ifndef PLIST__BOOLEAN_H #ifndef PLIST_BOOLEAN_H
#define PLIST__BOOLEAN_H #define PLIST_BOOLEAN_H
#include <plist/Node.h> #include <plist/Node.h>
namespace PList namespace PList
{ {
class Boolean : public Node class Boolean : public Node
{ {
public : public :
Boolean(Node* parent = NULL); Boolean(Node* parent = NULL);
Boolean(plist_t node, Node* parent = NULL); Boolean(plist_t node, Node* parent = NULL);
Boolean(Boolean& b); Boolean(const Boolean& b);
Boolean& operator=(Boolean& b); Boolean& operator=(Boolean& b);
Boolean(bool b); Boolean(bool b);
virtual ~Boolean(); virtual ~Boolean();
Node* Clone(); Node* Clone() const;
void SetValue(bool b); void SetValue(bool b);
bool GetValue(); bool GetValue() const;
}; };
}; };
#endif // PLIST__BOOLEAN_H #endif // PLIST_BOOLEAN_H
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added


 Data.h   Data.h 
skipping to change at line 22 skipping to change at line 22
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 1 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 1 USA
*/ */
#ifndef PLIST__DATA_H #ifndef PLIST_DATA_H
#define PLIST__DATA_H #define PLIST_DATA_H
#include <plist/Node.h> #include <plist/Node.h>
#include <vector> #include <vector>
namespace PList namespace PList
{ {
class Data : public Node class Data : public Node
{ {
public : public :
Data(Node* parent = NULL); Data(Node* parent = NULL);
Data(plist_t node, Node* parent = NULL); Data(plist_t node, Node* parent = NULL);
Data(Data& d); Data(const Data& d);
Data& operator=(Data& d); Data& operator=(Data& d);
Data(const std::vector<char>& buff); Data(const std::vector<char>& buff);
virtual ~Data(); virtual ~Data();
Node* Clone(); Node* Clone() const;
void SetValue(const std::vector<char>& buff); void SetValue(const std::vector<char>& buff);
std::vector<char> GetValue(); std::vector<char> GetValue() const;
}; };
}; };
#endif // PLIST__DATA_H #endif // PLIST_DATA_H
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added


 Date.h   Date.h 
skipping to change at line 22 skipping to change at line 22
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 1 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 1 USA
*/ */
#ifndef PLIST__DATE_H #ifndef PLIST_DATE_H
#define PLIST__DATE_H #define PLIST_DATE_H
#include <plist/Node.h> #include <plist/Node.h>
#include <ctime> #include <ctime>
#include <sys/time.h> #include <sys/time.h>
namespace PList namespace PList
{ {
class Date : public Node class Date : public Node
{ {
public : public :
Date(Node* parent = NULL); Date(Node* parent = NULL);
Date(plist_t node, Node* parent = NULL); Date(plist_t node, Node* parent = NULL);
Date(Date& d); Date(const Date& d);
Date& operator=(Date& d); Date& operator=(Date& d);
Date(timeval t); Date(timeval t);
virtual ~Date(); virtual ~Date();
Node* Clone(); Node* Clone() const;
void SetValue(timeval t); void SetValue(timeval t);
timeval GetValue(); timeval GetValue() const;
}; };
}; };
#endif // PLIST__DATE_H #endif // PLIST_DATE_H
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added


 Dictionary.h   Dictionary.h 
skipping to change at line 22 skipping to change at line 22
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 1 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 1 USA
*/ */
#ifndef PLIST__DICTIONARY_H #ifndef PLIST_DICTIONARY_H
#define PLIST__DICTIONARY_H #define PLIST_DICTIONARY_H
#include <plist/Structure.h> #include <plist/Structure.h>
#include <map> #include <map>
#include <string> #include <string>
namespace PList namespace PList
{ {
class Dictionary : public Structure class Dictionary : public Structure
{ {
public : public :
Dictionary(Node* parent = NULL); Dictionary(Node* parent = NULL);
Dictionary(plist_t node, Node* parent = NULL); Dictionary(plist_t node, Node* parent = NULL);
Dictionary(Dictionary& d); Dictionary(const Dictionary& d);
Dictionary& operator=(Dictionary& d); Dictionary& operator=(Dictionary& d);
virtual ~Dictionary(); virtual ~Dictionary();
Node* Clone(); Node* Clone() const;
typedef std::map<std::string,Node*>::iterator iterator; typedef std::map<std::string,Node*>::iterator iterator;
Node* operator[](const std::string& key); Node* operator[](const std::string& key);
iterator Begin(); iterator Begin();
iterator End(); iterator End();
iterator Find(const std::string& key); iterator Find(const std::string& key);
iterator Set(const std::string& key, Node* node); iterator Set(const std::string& key, const Node* node);
DEPRECATED("use Set() instead") iterator Insert(const std::string& key, iterator Set(const std::string& key, const Node& node);
Node* node); iterator Insert(const std::string& key, Node* node) PLIST_WARN_DEPRECAT
ED("use Set() instead");
void Remove(Node* node); void Remove(Node* node);
void Remove(const std::string& key); void Remove(const std::string& key);
std::string GetNodeKey(Node* key); std::string GetNodeKey(Node* key);
private : private :
std::map<std::string,Node*> _map; std::map<std::string,Node*> _map;
}; };
}; };
#endif // PLIST__DICTIONARY_H #endif // PLIST_DICTIONARY_H
 End of changes. 5 change blocks. 
7 lines changed or deleted 8 lines changed or added


 Integer.h   Integer.h 
skipping to change at line 22 skipping to change at line 22
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 1 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 1 USA
*/ */
#ifndef PLIST__INTEGER_H #ifndef PLIST_INTEGER_H
#define PLIST__INTEGER_H #define PLIST_INTEGER_H
#include <plist/Node.h> #include <plist/Node.h>
namespace PList namespace PList
{ {
class Integer : public Node class Integer : public Node
{ {
public : public :
Integer(Node* parent = NULL); Integer(Node* parent = NULL);
Integer(plist_t node, Node* parent = NULL); Integer(plist_t node, Node* parent = NULL);
Integer(Integer& i); Integer(const Integer& i);
Integer& operator=(Integer& i); Integer& operator=(Integer& i);
Integer(uint64_t i); Integer(uint64_t i);
virtual ~Integer(); virtual ~Integer();
Node* Clone(); Node* Clone() const;
void SetValue(uint64_t i); void SetValue(uint64_t i);
uint64_t GetValue(); uint64_t GetValue() const;
}; };
}; };
#endif // PLIST__INTEGER_H #endif // PLIST_INTEGER_H
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added


 Key.h   Key.h 
skipping to change at line 22 skipping to change at line 22
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 1 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 1 USA
*/ */
#ifndef PLIST__KEY_H #ifndef PLIST_KEY_H
#define PLIST__KEY_H #define PLIST_KEY_H
#include <plist/Node.h> #include <plist/Node.h>
#include <string> #include <string>
namespace PList namespace PList
{ {
class Key : public Node class Key : public Node
{ {
public : public :
Key(Node* parent = NULL); Key(Node* parent = NULL);
Key(plist_t node, Node* parent = NULL); Key(plist_t node, Node* parent = NULL);
Key(Key& s); Key(const Key& s);
Key& operator=(Key& s); Key& operator=(Key& s);
Key(const std::string& s); Key(const std::string& s);
virtual ~Key(); virtual ~Key();
Node* Clone(); Node* Clone() const;
void SetValue(const std::string& s); void SetValue(const std::string& s);
std::string GetValue(); std::string GetValue() const;
}; };
}; };
#endif // PLIST__KEY_H #endif // PLIST_KEY_H
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added


 Node.h   Node.h 
skipping to change at line 22 skipping to change at line 22
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 1 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 1 USA
*/ */
#ifndef PLIST__NODE_H #ifndef PLIST_NODE_H
#define PLIST__NODE_H #define PLIST_NODE_H
#include <plist/plist.h> #include <plist/plist.h>
#include <cstddef>
namespace PList namespace PList
{ {
class Node class Node
{ {
public : public :
virtual ~Node(); virtual ~Node();
virtual Node* Clone() = 0; virtual Node* Clone() const = 0;
Node * GetParent(); Node * GetParent() const;
plist_type GetType(); plist_type GetType() const;
plist_t GetPlist(); plist_t GetPlist() const;
static Node* FromPlist(plist_t node, Node* parent = NULL); static Node* FromPlist(plist_t node, Node* parent = NULL);
protected: protected:
Node(Node* parent = NULL); Node(Node* parent = NULL);
Node(plist_t node, Node* parent = NULL); Node(plist_t node, Node* parent = NULL);
Node(plist_type type, Node* parent = NULL); Node(plist_type type, Node* parent = NULL);
plist_t _node; plist_t _node;
private: private:
Node* _parent; Node* _parent;
friend class Structure; friend class Structure;
}; };
}; };
#endif // PLIST__NODE_H #endif // PLIST_NODE_H
 End of changes. 5 change blocks. 
6 lines changed or deleted 7 lines changed or added


 Real.h   Real.h 
skipping to change at line 22 skipping to change at line 22
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 1 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 1 USA
*/ */
#ifndef PLIST__REAL_H #ifndef PLIST_REAL_H
#define PLIST__REAL_H #define PLIST_REAL_H
#include <plist/Node.h> #include <plist/Node.h>
namespace PList namespace PList
{ {
class Real : public Node class Real : public Node
{ {
public : public :
Real(Node* parent = NULL); Real(Node* parent = NULL);
Real(plist_t node, Node* parent = NULL); Real(plist_t node, Node* parent = NULL);
Real(Real& d); Real(const Real& d);
Real& operator=(Real& d); Real& operator=(Real& d);
Real(double d); Real(double d);
virtual ~Real(); virtual ~Real();
Node* Clone(); Node* Clone() const;
void SetValue(double d); void SetValue(double d);
double GetValue(); double GetValue() const;
}; };
}; };
#endif // PLIST__REAL_H #endif // PLIST_REAL_H
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added


 String.h   String.h 
skipping to change at line 22 skipping to change at line 22
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 1 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 1 USA
*/ */
#ifndef PLIST__STRING_H #ifndef PLIST_STRING_H
#define PLIST__STRING_H #define PLIST_STRING_H
#include <plist/Node.h> #include <plist/Node.h>
#include <string> #include <string>
namespace PList namespace PList
{ {
class String : public Node class String : public Node
{ {
public : public :
String(Node* parent = NULL); String(Node* parent = NULL);
String(plist_t node, Node* parent = NULL); String(plist_t node, Node* parent = NULL);
String(String& s); String(const String& s);
String& operator=(String& s); String& operator=(String& s);
String(const std::string& s); String(const std::string& s);
virtual ~String(); virtual ~String();
Node* Clone(); Node* Clone() const;
void SetValue(const std::string& s); void SetValue(const std::string& s);
std::string GetValue(); std::string GetValue() const;
}; };
}; };
#endif // PLIST__STRING_H #endif // PLIST_STRING_H
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added


 Structure.h   Structure.h 
skipping to change at line 22 skipping to change at line 22
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 1 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 1 USA
*/ */
#ifndef PLIST__STRUCTURE_H #ifndef PLIST_STRUCTURE_H
#define PLIST__STRUCTURE_H #define PLIST_STRUCTURE_H
#include <plist/Node.h> #include <plist/Node.h>
#include <string> #include <string>
#include <vector> #include <vector>
namespace PList namespace PList
{ {
class Structure : public Node class Structure : public Node
{ {
public : public :
virtual ~Structure(); virtual ~Structure();
uint32_t GetSize(); uint32_t GetSize() const;
std::string ToXml(); std::string ToXml() const;
std::vector<char> ToBin(); std::vector<char> ToBin() const;
virtual void Remove(Node* node) = 0; virtual void Remove(Node* node) = 0;
static Structure* FromXml(const std::string& xml); static Structure* FromXml(const std::string& xml);
static Structure* FromBin(const std::vector<char>& bin); static Structure* FromBin(const std::vector<char>& bin);
protected: protected:
Structure(Node* parent = NULL); Structure(Node* parent = NULL);
Structure(plist_type type, Node* parent = NULL); Structure(plist_type type, Node* parent = NULL);
void UpdateNodeParent(Node* node); void UpdateNodeParent(Node* node);
private: private:
Structure(Structure& s); Structure(Structure& s);
Structure& operator=(const Structure& s); Structure& operator=(const Structure& s);
}; };
}; };
#endif // PLIST__STRUCTURE_H #endif // PLIST_STRUCTURE_H
 End of changes. 4 change blocks. 
5 lines changed or deleted 5 lines changed or added


 Uid.h   Uid.h 
skipping to change at line 22 skipping to change at line 22
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 1 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 1 USA
*/ */
#ifndef PLIST__UID_H #ifndef PLIST_UID_H
#define PLIST__UID_H #define PLIST_UID_H
#include <plist/Node.h> #include <plist/Node.h>
namespace PList namespace PList
{ {
class Uid : public Node class Uid : public Node
{ {
public : public :
Uid(Node* parent = NULL); Uid(Node* parent = NULL);
Uid(plist_t node, Node* parent = NULL); Uid(plist_t node, Node* parent = NULL);
Uid(Uid& i); Uid(const Uid& i);
Uid& operator=(Uid& i); Uid& operator=(Uid& i);
Uid(uint64_t i); Uid(uint64_t i);
virtual ~Uid(); virtual ~Uid();
Node* Clone(); Node* Clone() const;
void SetValue(uint64_t i); void SetValue(uint64_t i);
uint64_t GetValue(); uint64_t GetValue() const;
}; };
}; };
#endif // PLIST__UID_H #endif // PLIST_UID_H
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added


 plist.h   plist.h 
skipping to change at line 42 skipping to change at line 42
typedef __int8 int8_t; typedef __int8 int8_t;
typedef __int16 int16_t; typedef __int16 int16_t;
typedef __int32 int32_t; typedef __int32 int32_t;
typedef __int64 int64_t; typedef __int64 int64_t;
typedef unsigned __int8 uint8_t; typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t; typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t; typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t; typedef unsigned __int64 uint64_t;
#ifdef plist_EXPORTS
#define PLIST_API __declspec( dllexport )
#else
#define PLIST_API __declspec( dllimport )
#endif
#define DEPRECATED(x) __declspec(deprecated(x))
#else #else
#include <stdint.h> #include <stdint.h>
#define PLIST_API #endif
#ifdef __GNUC__
#define DEPRECATED(x) __attribute__((deprecated(x))) #ifdef __llvm__
#if defined(__has_extension)
#if (__has_extension(attribute_deprecated_with_message))
#ifndef PLIST_WARN_DEPRECATED
#define PLIST_WARN_DEPRECATED(x) __attribute__((deprecated(x)))
#endif
#else
#ifndef PLIST_WARN_DEPRECATED
#define PLIST_WARN_DEPRECATED(x) __attribute__((deprecated))
#endif
#endif
#else
#ifndef PLIST_WARN_DEPRECATED
#define PLIST_WARN_DEPRECATED(x) __attribute__((deprecated))
#endif
#endif
#elif (__GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 5)))
#ifndef PLIST_WARN_DEPRECATED
#define PLIST_WARN_DEPRECATED(x) __attribute__((deprecated(x)))
#endif
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
#ifndef PLIST_WARN_DEPRECATED
#define PLIST_WARN_DEPRECATED(x) __declspec(deprecated(x))
#endif
#else #else
#define DEPRECATED(x) #define PLIST_WARN_DEPRECATED(x)
#pragma message("WARNING: You need to implement DEPRECATED for this compile #pragma message("WARNING: You need to implement DEPRECATED for this compi
r") ler")
#endif
#endif #endif
#include <sys/types.h> #include <sys/types.h>
#include <stdarg.h> #include <stdarg.h>
/** /**
* \mainpage libplist : A library to handle Apple Property Lists * \mainpage libplist : A library to handle Apple Property Lists
* \defgroup PublicAPI Public libplist API * \defgroup PublicAPI Public libplist API
*/ */
/*@{*/ /*@{*/
skipping to change at line 109 skipping to change at line 124
* Creation & Destruction * * Creation & Destruction *
* * * *
********************************************/ ********************************************/
/** /**
* Create a new root plist_t type #PLIST_DICT * Create a new root plist_t type #PLIST_DICT
* *
* @return the created plist * @return the created plist
* @sa #plist_type * @sa #plist_type
*/ */
PLIST_API plist_t plist_new_dict(void); plist_t plist_new_dict(void);
/** /**
* Create a new root plist_t type #PLIST_ARRAY * Create a new root plist_t type #PLIST_ARRAY
* *
* @return the created plist * @return the created plist
* @sa #plist_type * @sa #plist_type
*/ */
PLIST_API plist_t plist_new_array(void); plist_t plist_new_array(void);
/** /**
* Create a new plist_t type #PLIST_STRING * Create a new plist_t type #PLIST_STRING
* *
* @param val the sting value, encoded in UTF8. * @param val the sting value, encoded in UTF8.
* @return the created item * @return the created item
* @sa #plist_type * @sa #plist_type
*/ */
PLIST_API plist_t plist_new_string(const char *val); plist_t plist_new_string(const char *val);
/** /**
* Create a new plist_t type #PLIST_BOOLEAN * Create a new plist_t type #PLIST_BOOLEAN
* *
* @param val the boolean value, 0 is false, other values are true. * @param val the boolean value, 0 is false, other values are true.
* @return the created item * @return the created item
* @sa #plist_type * @sa #plist_type
*/ */
PLIST_API plist_t plist_new_bool(uint8_t val); plist_t plist_new_bool(uint8_t val);
/** /**
* Create a new plist_t type #PLIST_UINT * Create a new plist_t type #PLIST_UINT
* *
* @param val the unsigned integer value * @param val the unsigned integer value
* @return the created item * @return the created item
* @sa #plist_type * @sa #plist_type
*/ */
PLIST_API plist_t plist_new_uint(uint64_t val); plist_t plist_new_uint(uint64_t val);
/** /**
* Create a new plist_t type #PLIST_REAL * Create a new plist_t type #PLIST_REAL
* *
* @param val the real value * @param val the real value
* @return the created item * @return the created item
* @sa #plist_type * @sa #plist_type
*/ */
PLIST_API plist_t plist_new_real(double val); plist_t plist_new_real(double val);
/** /**
* Create a new plist_t type #PLIST_DATA * Create a new plist_t type #PLIST_DATA
* *
* @param val the binary buffer * @param val the binary buffer
* @param length the length of the buffer * @param length the length of the buffer
* @return the created item * @return the created item
* @sa #plist_type * @sa #plist_type
*/ */
PLIST_API plist_t plist_new_data(const char *val, uint64_t length); plist_t plist_new_data(const char *val, uint64_t length);
/** /**
* Create a new plist_t type #PLIST_DATE * Create a new plist_t type #PLIST_DATE
* *
* @param sec the number of seconds since 01/01/2001 * @param sec the number of seconds since 01/01/2001
* @param usec the number of microseconds * @param usec the number of microseconds
* @return the created item * @return the created item
* @sa #plist_type * @sa #plist_type
*/ */
PLIST_API plist_t plist_new_date(int32_t sec, int32_t usec); plist_t plist_new_date(int32_t sec, int32_t usec);
/** /**
* Create a new plist_t type #PLIST_UID * Create a new plist_t type #PLIST_UID
* *
* @param val the unsigned integer value * @param val the unsigned integer value
* @return the created item * @return the created item
* @sa #plist_type * @sa #plist_type
*/ */
PLIST_API plist_t plist_new_uid(uint64_t val); plist_t plist_new_uid(uint64_t val);
/** /**
* Destruct a plist_t node and all its children recursively * Destruct a plist_t node and all its children recursively
* *
* @param plist the plist to free * @param plist the plist to free
*/ */
PLIST_API void plist_free(plist_t plist); void plist_free(plist_t plist);
/** /**
* Return a copy of passed node and it's children * Return a copy of passed node and it's children
* *
* @param node the plist to copy * @param node the plist to copy
* @return copied plist * @return copied plist
*/ */
PLIST_API plist_t plist_copy(plist_t node); plist_t plist_copy(plist_t node);
/******************************************** /********************************************
* * * *
* Array functions * * Array functions *
* * * *
********************************************/ ********************************************/
/** /**
* Get size of a #PLIST_ARRAY node. * Get size of a #PLIST_ARRAY node.
* *
* @param node the node of type #PLIST_ARRAY * @param node the node of type #PLIST_ARRAY
* @return size of the #PLIST_ARRAY node * @return size of the #PLIST_ARRAY node
*/ */
PLIST_API uint32_t plist_array_get_size(plist_t node); uint32_t plist_array_get_size(plist_t node);
/** /**
* Get the nth item in a #PLIST_ARRAY node. * Get the nth item in a #PLIST_ARRAY node.
* *
* @param node the node of type #PLIST_ARRAY * @param node the node of type #PLIST_ARRAY
* @param n the index of the item to get. Range is [0, array_size[ * @param n the index of the item to get. Range is [0, array_size[
* @return the nth item or NULL if node is not of type #PLIST_ARRAY * @return the nth item or NULL if node is not of type #PLIST_ARRAY
*/ */
PLIST_API plist_t plist_array_get_item(plist_t node, uint32_t n); plist_t plist_array_get_item(plist_t node, uint32_t n);
/** /**
* Get the index of an item. item must be a member of a #PLIST_ARRAY no de. * Get the index of an item. item must be a member of a #PLIST_ARRAY no de.
* *
* @param node the node * @param node the node
* @return the node index * @return the node index
*/ */
PLIST_API uint32_t plist_array_get_item_index(plist_t node); uint32_t plist_array_get_item_index(plist_t node);
/** /**
* Set the nth item in a #PLIST_ARRAY node. * Set the nth item in a #PLIST_ARRAY node.
* The previous item at index n will be freed using #plist_free * The previous item at index n will be freed using #plist_free
* *
* @param node the node of type #PLIST_ARRAY * @param node the node of type #PLIST_ARRAY
* @param item the new item at index n * @param item the new item at index n. The array is responsible for fr eeing item when it is no longer needed.
* @param n the index of the item to get. Range is [0, array_size[. Ass ert if n is not in range. * @param n the index of the item to get. Range is [0, array_size[. Ass ert if n is not in range.
*/ */
PLIST_API void plist_array_set_item(plist_t node, plist_t item, uint32_ t n); void plist_array_set_item(plist_t node, plist_t item, uint32_t n);
/** /**
* Append a new item at the end of a #PLIST_ARRAY node. * Append a new item at the end of a #PLIST_ARRAY node.
* *
* @param node the node of type #PLIST_ARRAY * @param node the node of type #PLIST_ARRAY
* @param item the new item * @param item the new item. The array is responsible for freeing item when it is no longer needed.
*/ */
PLIST_API void plist_array_append_item(plist_t node, plist_t item); void plist_array_append_item(plist_t node, plist_t item);
/** /**
* Insert a new item at position n in a #PLIST_ARRAY node. * Insert a new item at position n in a #PLIST_ARRAY node.
* *
* @param node the node of type #PLIST_ARRAY * @param node the node of type #PLIST_ARRAY
* @param item the new item to insert * @param item the new item to insert. The array is responsible for fre eing item when it is no longer needed.
* @param n The position at which the node will be stored. Range is [0, array_size[. Assert if n is not in range. * @param n The position at which the node will be stored. Range is [0, array_size[. Assert if n is not in range.
*/ */
PLIST_API void plist_array_insert_item(plist_t node, plist_t item, uint 32_t n); void plist_array_insert_item(plist_t node, plist_t item, uint32_t n);
/** /**
* Remove an existing position in a #PLIST_ARRAY node. * Remove an existing position in a #PLIST_ARRAY node.
* Removed position will be freed using #plist_free * Removed position will be freed using #plist_free.
* *
* @param node the node of type #PLIST_ARRAY * @param node the node of type #PLIST_ARRAY
* @param n The position to remove. Range is [0, array_size[. Assert if n is not in range. * @param n The position to remove. Range is [0, array_size[. Assert if n is not in range.
*/ */
PLIST_API void plist_array_remove_item(plist_t node, uint32_t n); void plist_array_remove_item(plist_t node, uint32_t n);
/******************************************** /********************************************
* * * *
* Dictionary functions * * Dictionary functions *
* * * *
********************************************/ ********************************************/
/** /**
* Get size of a #PLIST_DICT node. * Get size of a #PLIST_DICT node.
* *
* @param node the node of type #PLIST_DICT * @param node the node of type #PLIST_DICT
* @return size of the #PLIST_DICT node * @return size of the #PLIST_DICT node
*/ */
PLIST_API uint32_t plist_dict_get_size(plist_t node); uint32_t plist_dict_get_size(plist_t node);
/** /**
* Create iterator of a #PLIST_DICT node. * Create an iterator of a #PLIST_DICT node.
* The allocated iterator shoult be freed with tandard free function * The allocated iterator should be freed with the standard free functi
on.
* *
* @param node the node of type #PLIST_DICT * @param node the node of type #PLIST_DICT
* @param iter iterator of the #PLIST_DICT node * @param iter iterator of the #PLIST_DICT node
*/ */
PLIST_API void plist_dict_new_iter(plist_t node, plist_dict_iter *iter) ; void plist_dict_new_iter(plist_t node, plist_dict_iter *iter);
/** /**
* Increment iterator of a #PLIST_DICT node. * Increment iterator of a #PLIST_DICT node.
* *
* @param node the node of type #PLIST_DICT * @param node the node of type #PLIST_DICT
* @param iter iterator of the dictionary * @param iter iterator of the dictionary
* @param key a location to store the key, or NULL. * @param key a location to store the key, or NULL. The caller is respo
* @param val a location to store the value, or NULL. nsible
* for freeing the the returned string.
* @param val a location to store the value, or NULL. The caller should
*not*
* free the returned value.
*/ */
PLIST_API void plist_dict_next_item(plist_t node, plist_dict_iter iter, char **key, plist_t *val); void plist_dict_next_item(plist_t node, plist_dict_iter iter, char **ke y, plist_t *val);
/** /**
* Get key associated to an item. Item must be member of a dictionary * Get key associated to an item. Item must be member of a dictionary
* *
* @param node the node * @param node the node
* @param key a location to store the key. * @param key a location to store the key. The caller is responsible fo r freeing the returned string.
*/ */
PLIST_API void plist_dict_get_item_key(plist_t node, char **key); void plist_dict_get_item_key(plist_t node, char **key);
/** /**
* Get the nth item in a #PLIST_DICT node. * Get the nth item in a #PLIST_DICT node.
* *
* @param node the node of type #PLIST_DICT * @param node the node of type #PLIST_DICT
* @param key the identifier of the item to get. * @param key the identifier of the item to get.
* @return the item or NULL if node is not of type #PLIST_DICT * @return the item or NULL if node is not of type #PLIST_DICT. The cal
ler should not free
* the returned node.
*/ */
PLIST_API plist_t plist_dict_get_item(plist_t node, const char* key); plist_t plist_dict_get_item(plist_t node, const char* key);
/** /**
* Set item identified by key in a #PLIST_DICT node. * Set item identified by key in a #PLIST_DICT node.
* The previous item identified by key will be freed using #plist_free. * The previous item identified by key will be freed using #plist_free.
* If there is no item for the given key a new item will be inserted. * If there is no item for the given key a new item will be inserted.
* *
* @param node the node of type #PLIST_DICT * @param node the node of type #PLIST_DICT
* @param item the new item associated to key * @param item the new item associated to key
* @param key the identifier of the item to set. * @param key the identifier of the item to set.
*/ */
PLIST_API void plist_dict_set_item(plist_t node, const char* key, plist _t item); void plist_dict_set_item(plist_t node, const char* key, plist_t item);
/** /**
* Insert a new item into a #PLIST_DICT node. * Insert a new item into a #PLIST_DICT node.
* *
* @deprecated Deprecated. Use plist_dict_set_item instead. * @deprecated Deprecated. Use plist_dict_set_item instead.
* *
* @param node the node of type #PLIST_DICT * @param node the node of type #PLIST_DICT
* @param item the new item to insert * @param item the new item to insert
* @param key The identifier of the item to insert. * @param key The identifier of the item to insert.
*/ */
DEPRECATED("use plist_dict_set_item instead") PLIST_API void plist_dict PLIST_WARN_DEPRECATED("use plist_dict_set_item instead")
_insert_item(plist_t node, const char* key, plist_t item); void plist_dict_insert_item(plist_t node, const char* key, plist_t item
);
/** /**
* Remove an existing position in a #PLIST_DICT node. * Remove an existing position in a #PLIST_DICT node.
* Removed position will be freed using #plist_free * Removed position will be freed using #plist_free
* *
* @param node the node of type #PLIST_DICT * @param node the node of type #PLIST_DICT
* @param key The identifier of the item to remove. Assert if identifie r is not present. * @param key The identifier of the item to remove. Assert if identifie r is not present.
*/ */
PLIST_API void plist_dict_remove_item(plist_t node, const char* key); void plist_dict_remove_item(plist_t node, const char* key);
/** /**
* Merge a dictionary into another. This will add all key/value pairs * Merge a dictionary into another. This will add all key/value pairs
* from the source dictionary to the target dictionary, overwriting * from the source dictionary to the target dictionary, overwriting
* any existing key/value pairs that are already present in target. * any existing key/value pairs that are already present in target.
* *
* @param target pointer to an existing node of type #PLIST_DICT * @param target pointer to an existing node of type #PLIST_DICT
* @param source node of type #PLIST_DICT that should be merged into ta rget * @param source node of type #PLIST_DICT that should be merged into ta rget
*/ */
PLIST_API void plist_dict_merge(plist_t *target, plist_t source); void plist_dict_merge(plist_t *target, plist_t source);
/******************************************** /********************************************
* * * *
* Getters * * Getters *
* * * *
********************************************/ ********************************************/
/** /**
* Get the parent of a node * Get the parent of a node
* *
* @param node the parent (NULL if node is root) * @param node the parent (NULL if node is root)
*/ */
PLIST_API plist_t plist_get_parent(plist_t node); plist_t plist_get_parent(plist_t node);
/** /**
* Get the #plist_type of a node. * Get the #plist_type of a node.
* *
* @param node the node * @param node the node
* @return the type of the node * @return the type of the node
*/ */
PLIST_API plist_type plist_get_node_type(plist_t node); plist_type plist_get_node_type(plist_t node);
/** /**
* Get the value of a #PLIST_KEY node. * Get the value of a #PLIST_KEY node.
* This function does nothing if node is not of type #PLIST_KEY * This function does nothing if node is not of type #PLIST_KEY
* *
* @param node the node * @param node the node
* @param val a pointer to a C-string. This function allocates the memo ry, * @param val a pointer to a C-string. This function allocates the memo ry,
* caller is responsible for freeing it. * caller is responsible for freeing it.
*/ */
PLIST_API void plist_get_key_val(plist_t node, char **val); void plist_get_key_val(plist_t node, char **val);
/** /**
* Get the value of a #PLIST_STRING node. * Get the value of a #PLIST_STRING node.
* This function does nothing if node is not of type #PLIST_STRING * This function does nothing if node is not of type #PLIST_STRING
* *
* @param node the node * @param node the node
* @param val a pointer to a C-string. This function allocates the memo ry, * @param val a pointer to a C-string. This function allocates the memo ry,
* caller is responsible for freeing it. Data is UTF-8 encod ed. * caller is responsible for freeing it. Data is UTF-8 encod ed.
*/ */
PLIST_API void plist_get_string_val(plist_t node, char **val); void plist_get_string_val(plist_t node, char **val);
/** /**
* Get the value of a #PLIST_BOOLEAN node. * Get the value of a #PLIST_BOOLEAN node.
* This function does nothing if node is not of type #PLIST_BOOLEAN * This function does nothing if node is not of type #PLIST_BOOLEAN
* *
* @param node the node * @param node the node
* @param val a pointer to a uint8_t variable. * @param val a pointer to a uint8_t variable.
*/ */
PLIST_API void plist_get_bool_val(plist_t node, uint8_t * val); void plist_get_bool_val(plist_t node, uint8_t * val);
/** /**
* Get the value of a #PLIST_UINT node. * Get the value of a #PLIST_UINT node.
* This function does nothing if node is not of type #PLIST_UINT * This function does nothing if node is not of type #PLIST_UINT
* *
* @param node the node * @param node the node
* @param val a pointer to a uint64_t variable. * @param val a pointer to a uint64_t variable.
*/ */
PLIST_API void plist_get_uint_val(plist_t node, uint64_t * val); void plist_get_uint_val(plist_t node, uint64_t * val);
/** /**
* Get the value of a #PLIST_REAL node. * Get the value of a #PLIST_REAL node.
* This function does nothing if node is not of type #PLIST_REAL * This function does nothing if node is not of type #PLIST_REAL
* *
* @param node the node * @param node the node
* @param val a pointer to a double variable. * @param val a pointer to a double variable.
*/ */
PLIST_API void plist_get_real_val(plist_t node, double *val); void plist_get_real_val(plist_t node, double *val);
/** /**
* Get the value of a #PLIST_DATA node. * Get the value of a #PLIST_DATA node.
* This function does nothing if node is not of type #PLIST_DATA * This function does nothing if node is not of type #PLIST_DATA
* *
* @param node the node * @param node the node
* @param val a pointer to an unallocated char buffer. This function al locates the memory, * @param val a pointer to an unallocated char buffer. This function al locates the memory,
* caller is responsible for freeing it. * caller is responsible for freeing it.
* @param length the length of the buffer * @param length the length of the buffer
*/ */
PLIST_API void plist_get_data_val(plist_t node, char **val, uint64_t * length); void plist_get_data_val(plist_t node, char **val, uint64_t * length);
/** /**
* Get the value of a #PLIST_DATE node. * Get the value of a #PLIST_DATE node.
* This function does nothing if node is not of type #PLIST_DATE * This function does nothing if node is not of type #PLIST_DATE
* *
* @param node the node * @param node the node
* @param sec a pointer to an int32_t variable. Represents the number o f seconds since 01/01/2001. * @param sec a pointer to an int32_t variable. Represents the number o f seconds since 01/01/2001.
* @param usec a pointer to an int32_t variable. Represents the number of microseconds * @param usec a pointer to an int32_t variable. Represents the number of microseconds
*/ */
PLIST_API void plist_get_date_val(plist_t node, int32_t * sec, int32_t * usec); void plist_get_date_val(plist_t node, int32_t * sec, int32_t * usec);
/** /**
* Get the value of a #PLIST_UID node. * Get the value of a #PLIST_UID node.
* This function does nothing if node is not of type #PLIST_UID * This function does nothing if node is not of type #PLIST_UID
* *
* @param node the node * @param node the node
* @param val a pointer to a uint64_t variable. * @param val a pointer to a uint64_t variable.
*/ */
PLIST_API void plist_get_uid_val(plist_t node, uint64_t * val); void plist_get_uid_val(plist_t node, uint64_t * val);
/******************************************** /********************************************
* * * *
* Setters * * Setters *
* * * *
********************************************/ ********************************************/
/** /**
* Forces type of node. Changing type of structured nodes is only allow
ed if node is empty.
* Reset value of node;
* @param node the node
* @param type the key value
*/
PLIST_API void plist_set_type(plist_t node, plist_type type);
/**
* Set the value of a node. * Set the value of a node.
* Forces type of node to #PLIST_KEY * Forces type of node to #PLIST_KEY
* *
* @param node the node * @param node the node
* @param val the key value * @param val the key value
*/ */
PLIST_API void plist_set_key_val(plist_t node, const char *val); void plist_set_key_val(plist_t node, const char *val);
/** /**
* Set the value of a node. * Set the value of a node.
* Forces type of node to #PLIST_STRING * Forces type of node to #PLIST_STRING
* *
* @param node the node * @param node the node
* @param val the string value * @param val the string value. The string is copied when set and will
be
* freed by the node.
*/ */
PLIST_API void plist_set_string_val(plist_t node, const char *val); void plist_set_string_val(plist_t node, const char *val);
/** /**
* Set the value of a node. * Set the value of a node.
* Forces type of node to #PLIST_BOOLEAN * Forces type of node to #PLIST_BOOLEAN
* *
* @param node the node * @param node the node
* @param val the boolean value * @param val the boolean value
*/ */
PLIST_API void plist_set_bool_val(plist_t node, uint8_t val); void plist_set_bool_val(plist_t node, uint8_t val);
/** /**
* Set the value of a node. * Set the value of a node.
* Forces type of node to #PLIST_UINT * Forces type of node to #PLIST_UINT
* *
* @param node the node * @param node the node
* @param val the unsigned integer value * @param val the unsigned integer value
*/ */
PLIST_API void plist_set_uint_val(plist_t node, uint64_t val); void plist_set_uint_val(plist_t node, uint64_t val);
/** /**
* Set the value of a node. * Set the value of a node.
* Forces type of node to #PLIST_REAL * Forces type of node to #PLIST_REAL
* *
* @param node the node * @param node the node
* @param val the real value * @param val the real value
*/ */
PLIST_API void plist_set_real_val(plist_t node, double val); void plist_set_real_val(plist_t node, double val);
/** /**
* Set the value of a node. * Set the value of a node.
* Forces type of node to #PLIST_DATA * Forces type of node to #PLIST_DATA
* *
* @param node the node * @param node the node
* @param val the binary buffer * @param val the binary buffer. The buffer is copied when set and will
* be freed by the node.
* @param length the length of the buffer * @param length the length of the buffer
*/ */
PLIST_API void plist_set_data_val(plist_t node, const char *val, uint64 _t length); void plist_set_data_val(plist_t node, const char *val, uint64_t length) ;
/** /**
* Set the value of a node. * Set the value of a node.
* Forces type of node to #PLIST_DATE * Forces type of node to #PLIST_DATE
* *
* @param node the node * @param node the node
* @param sec the number of seconds since 01/01/2001 * @param sec the number of seconds since 01/01/2001
* @param usec the number of microseconds * @param usec the number of microseconds
*/ */
PLIST_API void plist_set_date_val(plist_t node, int32_t sec, int32_t us ec); void plist_set_date_val(plist_t node, int32_t sec, int32_t usec);
/** /**
* Set the value of a node. * Set the value of a node.
* Forces type of node to #PLIST_UID * Forces type of node to #PLIST_UID
* *
* @param node the node * @param node the node
* @param val the unsigned integer value * @param val the unsigned integer value
*/ */
PLIST_API void plist_set_uid_val(plist_t node, uint64_t val); void plist_set_uid_val(plist_t node, uint64_t val);
/******************************************** /********************************************
* * * *
* Import & Export * * Import & Export *
* * * *
********************************************/ ********************************************/
/** /**
* Export the #plist_t structure to XML format. * Export the #plist_t structure to XML format.
* *
* @param plist the root node to export * @param plist the root node to export
* @param plist_xml a pointer to a C-string. This function allocates th e memory, * @param plist_xml a pointer to a C-string. This function allocates th e memory,
* caller is responsible for freeing it. Data is UTF-8 encod ed. * caller is responsible for freeing it. Data is UTF-8 encod ed.
* @param length a pointer to an uint32_t variable. Represents the leng th of the allocated buffer. * @param length a pointer to an uint32_t variable. Represents the leng th of the allocated buffer.
*/ */
PLIST_API void plist_to_xml(plist_t plist, char **plist_xml, uint32_t * length); void plist_to_xml(plist_t plist, char **plist_xml, uint32_t * length);
/** /**
* Export the #plist_t structure to binary format. * Export the #plist_t structure to binary format.
* *
* @param plist the root node to export * @param plist the root node to export
* @param plist_bin a pointer to a char* buffer. This function allocate s the memory, * @param plist_bin a pointer to a char* buffer. This function allocate s the memory,
* caller is responsible for freeing it. * caller is responsible for freeing it.
* @param length a pointer to an uint32_t variable. Represents the leng th of the allocated buffer. * @param length a pointer to an uint32_t variable. Represents the leng th of the allocated buffer.
*/ */
PLIST_API void plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length); void plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length);
/** /**
* Import the #plist_t structure from XML format. * Import the #plist_t structure from XML format.
* *
* @param plist_xml a pointer to the xml buffer. * @param plist_xml a pointer to the xml buffer.
* @param length length of the buffer to read. * @param length length of the buffer to read.
* @param plist a pointer to the imported plist. * @param plist a pointer to the imported plist.
*/ */
PLIST_API void plist_from_xml(const char *plist_xml, uint32_t length, p list_t * plist); void plist_from_xml(const char *plist_xml, uint32_t length, plist_t * p list);
/** /**
* Import the #plist_t structure from binary format. * Import the #plist_t structure from binary format.
* *
* @param plist_bin a pointer to the xml buffer. * @param plist_bin a pointer to the xml buffer.
* @param length length of the buffer to read. * @param length length of the buffer to read.
* @param plist a pointer to the imported plist. * @param plist a pointer to the imported plist.
*/ */
PLIST_API void plist_from_bin(const char *plist_bin, uint32_t length, p list_t * plist); void plist_from_bin(const char *plist_bin, uint32_t length, plist_t * p list);
/******************************************** /********************************************
* * * *
* Utils * * Utils *
* * * *
********************************************/ ********************************************/
/** /**
* Get a node from its path. Each path element depends on the associate d father node type. * Get a node from its path. Each path element depends on the associate d father node type.
* For Dictionaries, var args are casted to const char*, for arrays, va r args are caster to uint32_t * For Dictionaries, var args are casted to const char*, for arrays, va r args are caster to uint32_t
* Search is breath first order. * Search is breath first order.
* *
* @param plist the node to access result from. * @param plist the node to access result from.
* @param length length of the path to access * @param length length of the path to access
* @return the value to access. * @return the value to access.
*/ */
PLIST_API plist_t plist_access_path(plist_t plist, uint32_t length, ... ); plist_t plist_access_path(plist_t plist, uint32_t length, ...);
/** /**
* Variadic version of #plist_access_path. * Variadic version of #plist_access_path.
* *
* @param plist the node to access result from. * @param plist the node to access result from.
* @param length length of the path to access * @param length length of the path to access
* @param v list of array's index and dic'st key * @param v list of array's index and dic'st key
* @return the value to access. * @return the value to access.
*/ */
PLIST_API plist_t plist_access_pathv(plist_t plist, uint32_t length, va _list v); plist_t plist_access_pathv(plist_t plist, uint32_t length, va_list v);
/** /**
* Compare two node values * Compare two node values
* *
* @param node_l left node to compare * @param node_l left node to compare
* @param node_r rigth node to compare * @param node_r rigth node to compare
* @return TRUE is type and value match, FALSE otherwise. * @return TRUE is type and value match, FALSE otherwise.
*/ */
PLIST_API char plist_compare_node_value(plist_t node_l, plist_t node_r) ; char plist_compare_node_value(plist_t node_l, plist_t node_r);
/*@}*/ /*@}*/
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 67 change blocks. 
87 lines changed or deleted 104 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/