diff options
| author | 2009-10-16 22:26:13 +0200 | |
|---|---|---|
| committer | 2009-10-16 22:26:13 +0200 | |
| commit | 32be8ec384bfd78e189d3de6609e50cf4dd072a2 (patch) | |
| tree | ac7edad0f19be2a31efaaaaa3acd477dd2f3c233 /include | |
| parent | 8aeef4dd2331445fea8a7a40466b19973e9d09c4 (diff) | |
| download | libplist-32be8ec384bfd78e189d3de6609e50cf4dd072a2.tar.gz libplist-32be8ec384bfd78e189d3de6609e50cf4dd072a2.tar.bz2 | |
Fix Node lifecycle and change argument as reference to const reference.
Diffstat (limited to 'include')
| -rw-r--r-- | include/plist/Array.h | 6 | ||||
| -rw-r--r-- | include/plist/Boolean.h | 4 | ||||
| -rw-r--r-- | include/plist/Data.h | 8 | ||||
| -rw-r--r-- | include/plist/Date.h | 4 | ||||
| -rw-r--r-- | include/plist/Dictionary.h | 12 | ||||
| -rw-r--r-- | include/plist/Integer.h | 4 | ||||
| -rw-r--r-- | include/plist/Node.h | 8 | ||||
| -rw-r--r-- | include/plist/Real.h | 4 | ||||
| -rw-r--r-- | include/plist/String.h | 8 | ||||
| -rw-r--r-- | include/plist/Utils.h | 4 |
10 files changed, 45 insertions, 17 deletions
diff --git a/include/plist/Array.h b/include/plist/Array.h index f990928..106555d 100644 --- a/include/plist/Array.h +++ b/include/plist/Array.h | |||
| @@ -34,9 +34,11 @@ class Array : public Structure | |||
| 34 | Array(); | 34 | Array(); |
| 35 | Array(plist_t node); | 35 | Array(plist_t node); |
| 36 | Array(Array& a); | 36 | Array(Array& a); |
| 37 | Array& operator=(const Array& a); | 37 | Array& operator=(Array& a); |
| 38 | virtual ~Array(); | 38 | virtual ~Array(); |
| 39 | 39 | ||
| 40 | Node* Clone(); | ||
| 41 | |||
| 40 | Node* operator[](unsigned int index); | 42 | Node* operator[](unsigned int index); |
| 41 | void Append(Node* node); | 43 | void Append(Node* node); |
| 42 | void Insert(Node* node, unsigned int pos); | 44 | void Insert(Node* node, unsigned int pos); |
diff --git a/include/plist/Boolean.h b/include/plist/Boolean.h index 01b5b85..917bc9d 100644 --- a/include/plist/Boolean.h +++ b/include/plist/Boolean.h | |||
| @@ -32,9 +32,13 @@ class Boolean : public Node | |||
| 32 | public : | 32 | public : |
| 33 | Boolean(); | 33 | Boolean(); |
| 34 | Boolean(plist_t node); | 34 | Boolean(plist_t node); |
| 35 | Boolean(Boolean& b); | ||
| 36 | Boolean& operator=(Boolean& b); | ||
| 35 | Boolean(bool b); | 37 | Boolean(bool b); |
| 36 | virtual ~Boolean(); | 38 | virtual ~Boolean(); |
| 37 | 39 | ||
| 40 | Node* Clone(); | ||
| 41 | |||
| 38 | void SetValue(bool b); | 42 | void SetValue(bool b); |
| 39 | bool GetValue(); | 43 | bool GetValue(); |
| 40 | }; | 44 | }; |
diff --git a/include/plist/Data.h b/include/plist/Data.h index 92bda0a..86a26d9 100644 --- a/include/plist/Data.h +++ b/include/plist/Data.h | |||
| @@ -33,10 +33,14 @@ class Data : public Node | |||
| 33 | public : | 33 | public : |
| 34 | Data(); | 34 | Data(); |
| 35 | Data(plist_t node); | 35 | Data(plist_t node); |
| 36 | Data(std::vector<char>& buff); | 36 | Data(Data& d); |
| 37 | Data& operator=(Data& d); | ||
| 38 | Data(const std::vector<char>& buff); | ||
| 37 | virtual ~Data(); | 39 | virtual ~Data(); |
| 38 | 40 | ||
| 39 | void SetValue(std::vector<char>& buff); | 41 | Node* Clone(); |
| 42 | |||
| 43 | void SetValue(const std::vector<char>& buff); | ||
| 40 | std::vector<char> GetValue(); | 44 | std::vector<char> GetValue(); |
| 41 | }; | 45 | }; |
| 42 | 46 | ||
diff --git a/include/plist/Date.h b/include/plist/Date.h index 78d8601..e9645aa 100644 --- a/include/plist/Date.h +++ b/include/plist/Date.h | |||
| @@ -32,9 +32,13 @@ class Date : public Node | |||
| 32 | public : | 32 | public : |
| 33 | Date(); | 33 | Date(); |
| 34 | Date(plist_t node); | 34 | Date(plist_t node); |
| 35 | Date(Date& d); | ||
| 36 | Date& operator=(Date& d); | ||
| 35 | Date(uint64_t i); | 37 | Date(uint64_t i); |
| 36 | virtual ~Date(); | 38 | virtual ~Date(); |
| 37 | 39 | ||
| 40 | Node* Clone(); | ||
| 41 | |||
| 38 | void SetValue(uint64_t i); | 42 | void SetValue(uint64_t i); |
| 39 | uint64_t GetValue(); | 43 | uint64_t GetValue(); |
| 40 | }; | 44 | }; |
diff --git a/include/plist/Dictionary.h b/include/plist/Dictionary.h index 8468ab5..6169774 100644 --- a/include/plist/Dictionary.h +++ b/include/plist/Dictionary.h | |||
| @@ -35,17 +35,19 @@ class Dictionary : public Structure | |||
| 35 | Dictionary(); | 35 | Dictionary(); |
| 36 | Dictionary(plist_t node); | 36 | Dictionary(plist_t node); |
| 37 | Dictionary(Dictionary& d); | 37 | Dictionary(Dictionary& d); |
| 38 | Dictionary& operator=(const Dictionary& d); | 38 | Dictionary& operator=(Dictionary& d); |
| 39 | virtual ~Dictionary(); | 39 | virtual ~Dictionary(); |
| 40 | 40 | ||
| 41 | Node* Clone(); | ||
| 42 | |||
| 41 | typedef std::map<std::string,Node*>::iterator iterator; | 43 | typedef std::map<std::string,Node*>::iterator iterator; |
| 42 | 44 | ||
| 43 | Node* operator[](std::string& key); | 45 | Node* operator[](const std::string& key); |
| 44 | iterator Begin(); | 46 | iterator Begin(); |
| 45 | iterator End(); | 47 | iterator End(); |
| 46 | void Insert(std::string& key, Node* node); | 48 | void Insert(const std::string& key, Node* node); |
| 47 | void Remove(Node* node); | 49 | void Remove(Node* node); |
| 48 | void Remove(std::string& key); | 50 | void Remove(const std::string& key); |
| 49 | 51 | ||
| 50 | private : | 52 | private : |
| 51 | std::map<std::string,Node*> _map; | 53 | std::map<std::string,Node*> _map; |
diff --git a/include/plist/Integer.h b/include/plist/Integer.h index 823e3a0..3a3a0e3 100644 --- a/include/plist/Integer.h +++ b/include/plist/Integer.h | |||
| @@ -32,9 +32,13 @@ class Integer : public Node | |||
| 32 | public : | 32 | public : |
| 33 | Integer(); | 33 | Integer(); |
| 34 | Integer(plist_t node); | 34 | Integer(plist_t node); |
| 35 | Integer(Integer& i); | ||
| 36 | Integer& operator=(Integer& i); | ||
| 35 | Integer(uint64_t i); | 37 | Integer(uint64_t i); |
| 36 | virtual ~Integer(); | 38 | virtual ~Integer(); |
| 37 | 39 | ||
| 40 | Node* Clone(); | ||
| 41 | |||
| 38 | void SetValue(uint64_t i); | 42 | void SetValue(uint64_t i); |
| 39 | uint64_t GetValue(); | 43 | uint64_t GetValue(); |
| 40 | }; | 44 | }; |
diff --git a/include/plist/Node.h b/include/plist/Node.h index 3be900a..a59d469 100644 --- a/include/plist/Node.h +++ b/include/plist/Node.h | |||
| @@ -31,11 +31,11 @@ class Node | |||
| 31 | { | 31 | { |
| 32 | public : | 32 | public : |
| 33 | virtual ~Node(); | 33 | virtual ~Node(); |
| 34 | Node(Node& node); | 34 | |
| 35 | Node& operator=(const Node& node); | 35 | virtual Node* Clone() = 0; |
| 36 | 36 | ||
| 37 | plist_type GetType(); | 37 | plist_type GetType(); |
| 38 | plist_t GetPlist() const; | 38 | plist_t GetPlist(); |
| 39 | 39 | ||
| 40 | protected: | 40 | protected: |
| 41 | Node(); | 41 | Node(); |
diff --git a/include/plist/Real.h b/include/plist/Real.h index 8d898c7..c0095e4 100644 --- a/include/plist/Real.h +++ b/include/plist/Real.h | |||
| @@ -32,9 +32,13 @@ class Real : public Node | |||
| 32 | public : | 32 | public : |
| 33 | Real(); | 33 | Real(); |
| 34 | Real(plist_t node); | 34 | Real(plist_t node); |
| 35 | Real(Real& d); | ||
| 36 | Real& operator=(Real& d); | ||
| 35 | Real(double d); | 37 | Real(double d); |
| 36 | virtual ~Real(); | 38 | virtual ~Real(); |
| 37 | 39 | ||
| 40 | Node* Clone(); | ||
| 41 | |||
| 38 | void SetValue(double d); | 42 | void SetValue(double d); |
| 39 | double GetValue(); | 43 | double GetValue(); |
| 40 | }; | 44 | }; |
diff --git a/include/plist/String.h b/include/plist/String.h index 5314065..769c98b 100644 --- a/include/plist/String.h +++ b/include/plist/String.h | |||
| @@ -33,10 +33,14 @@ class String : public Node | |||
| 33 | public : | 33 | public : |
| 34 | String(); | 34 | String(); |
| 35 | String(plist_t node); | 35 | String(plist_t node); |
| 36 | String(std::string& s); | 36 | String(String& s); |
| 37 | String& operator=(String& s); | ||
| 38 | String(const std::string& s); | ||
| 37 | virtual ~String(); | 39 | virtual ~String(); |
| 38 | 40 | ||
| 39 | void SetValue(std::string& s); | 41 | Node* Clone(); |
| 42 | |||
| 43 | void SetValue(const std::string& s); | ||
| 40 | std::string GetValue(); | 44 | std::string GetValue(); |
| 41 | }; | 45 | }; |
| 42 | 46 | ||
diff --git a/include/plist/Utils.h b/include/plist/Utils.h index b499635..f3e2685 100644 --- a/include/plist/Utils.h +++ b/include/plist/Utils.h | |||
| @@ -30,8 +30,8 @@ namespace PList | |||
| 30 | class Utils | 30 | class Utils |
| 31 | { | 31 | { |
| 32 | public: | 32 | public: |
| 33 | static Structure* FromXml(std::string& in); | 33 | static Structure* FromXml(const std::string& in); |
| 34 | static Structure* FromBin(std::vector<char>& in); | 34 | static Structure* FromBin(const std::vector<char>& in); |
| 35 | 35 | ||
| 36 | private: | 36 | private: |
| 37 | Utils(); | 37 | Utils(); |
