diff options
author | Aaron Burghardt | 2014-08-15 21:59:01 -0400 |
---|---|---|
committer | Nikias Bassen | 2014-09-20 00:10:46 +0200 |
commit | ccd6f05fe1e6cd5a1611b0df78974fa39869013d (patch) | |
tree | 3c9e2c431d85cfb683de1724b121819aa16d29aa /include | |
parent | bc147d80b5a608b8a0478041e5198093ecd767b8 (diff) | |
download | libplist-ccd6f05fe1e6cd5a1611b0df78974fa39869013d.tar.gz libplist-ccd6f05fe1e6cd5a1611b0df78974fa39869013d.tar.bz2 |
Change Clone() to be const, which required constructors with const references and a const GetValue().
Diffstat (limited to 'include')
-rw-r--r-- | include/plist/Array.h | 4 | ||||
-rw-r--r-- | include/plist/Boolean.h | 6 | ||||
-rw-r--r-- | include/plist/Data.h | 6 | ||||
-rw-r--r-- | include/plist/Date.h | 6 | ||||
-rw-r--r-- | include/plist/Dictionary.h | 7 | ||||
-rw-r--r-- | include/plist/Integer.h | 6 | ||||
-rw-r--r-- | include/plist/Key.h | 6 | ||||
-rw-r--r-- | include/plist/Node.h | 8 | ||||
-rw-r--r-- | include/plist/Real.h | 6 | ||||
-rw-r--r-- | include/plist/String.h | 6 | ||||
-rw-r--r-- | include/plist/Uid.h | 6 |
11 files changed, 34 insertions, 33 deletions
diff --git a/include/plist/Array.h b/include/plist/Array.h index 5c65588..69ff26f 100644 --- a/include/plist/Array.h +++ b/include/plist/Array.h @@ -33,11 +33,11 @@ class Array : public Structure public : Array(Node* parent = NULL); Array(plist_t node, Node* parent = NULL); - Array(Array& a); + Array(const Array& a); Array& operator=(Array& a); virtual ~Array(); - Node* Clone(); + Node* Clone() const; Node* operator[](unsigned int index); void Append(Node* node); diff --git a/include/plist/Boolean.h b/include/plist/Boolean.h index 48489da..307a1ff 100644 --- a/include/plist/Boolean.h +++ b/include/plist/Boolean.h @@ -32,15 +32,15 @@ class Boolean : public Node public : Boolean(Node* parent = NULL); Boolean(plist_t node, Node* parent = NULL); - Boolean(Boolean& b); + Boolean(const Boolean& b); Boolean& operator=(Boolean& b); Boolean(bool b); virtual ~Boolean(); - Node* Clone(); + Node* Clone() const; void SetValue(bool b); - bool GetValue(); + bool GetValue() const; }; }; diff --git a/include/plist/Data.h b/include/plist/Data.h index 3eb6031..c9c089b 100644 --- a/include/plist/Data.h +++ b/include/plist/Data.h @@ -33,15 +33,15 @@ class Data : public Node public : Data(Node* parent = NULL); Data(plist_t node, Node* parent = NULL); - Data(Data& d); + Data(const Data& d); Data& operator=(Data& d); Data(const std::vector<char>& buff); virtual ~Data(); - Node* Clone(); + Node* Clone() const; void SetValue(const std::vector<char>& buff); - std::vector<char> GetValue(); + std::vector<char> GetValue() const; }; }; diff --git a/include/plist/Date.h b/include/plist/Date.h index e505b53..510a349 100644 --- a/include/plist/Date.h +++ b/include/plist/Date.h @@ -34,15 +34,15 @@ class Date : public Node public : Date(Node* parent = NULL); Date(plist_t node, Node* parent = NULL); - Date(Date& d); + Date(const Date& d); Date& operator=(Date& d); Date(timeval t); virtual ~Date(); - Node* Clone(); + Node* Clone() const; void SetValue(timeval t); - timeval GetValue(); + timeval GetValue() const; }; }; diff --git a/include/plist/Dictionary.h b/include/plist/Dictionary.h index c270de3..7a29f14 100644 --- a/include/plist/Dictionary.h +++ b/include/plist/Dictionary.h @@ -34,11 +34,11 @@ class Dictionary : public Structure public : Dictionary(Node* parent = NULL); Dictionary(plist_t node, Node* parent = NULL); - Dictionary(Dictionary& d); + Dictionary(const Dictionary& d); Dictionary& operator=(Dictionary& d); virtual ~Dictionary(); - Node* Clone(); + Node* Clone() const; typedef std::map<std::string,Node*>::iterator iterator; @@ -46,7 +46,8 @@ public : iterator Begin(); iterator End(); iterator Find(const std::string& key); - iterator Set(const std::string& key, Node* node); + iterator Set(const std::string& key, const Node* node); + iterator Set(const std::string& key, const Node& node); iterator Insert(const std::string& key, Node* node) PLIST_WARN_DEPRECATED("use Set() instead"); void Remove(Node* node); void Remove(const std::string& key); diff --git a/include/plist/Integer.h b/include/plist/Integer.h index 86af0dd..adbc39a 100644 --- a/include/plist/Integer.h +++ b/include/plist/Integer.h @@ -32,15 +32,15 @@ class Integer : public Node public : Integer(Node* parent = NULL); Integer(plist_t node, Node* parent = NULL); - Integer(Integer& i); + Integer(const Integer& i); Integer& operator=(Integer& i); Integer(uint64_t i); virtual ~Integer(); - Node* Clone(); + Node* Clone() const; void SetValue(uint64_t i); - uint64_t GetValue(); + uint64_t GetValue() const; }; }; diff --git a/include/plist/Key.h b/include/plist/Key.h index 3de09cf..c680f1c 100644 --- a/include/plist/Key.h +++ b/include/plist/Key.h @@ -33,15 +33,15 @@ class Key : public Node public : Key(Node* parent = NULL); Key(plist_t node, Node* parent = NULL); - Key(Key& s); + Key(const Key& s); Key& operator=(Key& s); Key(const std::string& s); virtual ~Key(); - Node* Clone(); + Node* Clone() const; void SetValue(const std::string& s); - std::string GetValue(); + std::string GetValue() const; }; }; diff --git a/include/plist/Node.h b/include/plist/Node.h index fdd26ee..9068880 100644 --- a/include/plist/Node.h +++ b/include/plist/Node.h @@ -32,11 +32,11 @@ class Node public : virtual ~Node(); - virtual Node* Clone() = 0; + virtual Node* Clone() const = 0; - Node * GetParent(); - plist_type GetType(); - plist_t GetPlist(); + Node * GetParent() const; + plist_type GetType() const; + plist_t GetPlist() const; static Node* FromPlist(plist_t node, Node* parent = NULL); diff --git a/include/plist/Real.h b/include/plist/Real.h index a89eb4a..c2d55f8 100644 --- a/include/plist/Real.h +++ b/include/plist/Real.h @@ -32,15 +32,15 @@ class Real : public Node public : Real(Node* parent = NULL); Real(plist_t node, Node* parent = NULL); - Real(Real& d); + Real(const Real& d); Real& operator=(Real& d); Real(double d); virtual ~Real(); - Node* Clone(); + Node* Clone() const; void SetValue(double d); - double GetValue(); + double GetValue() const; }; }; diff --git a/include/plist/String.h b/include/plist/String.h index a1906aa..80290b3 100644 --- a/include/plist/String.h +++ b/include/plist/String.h @@ -33,15 +33,15 @@ class String : public Node public : String(Node* parent = NULL); String(plist_t node, Node* parent = NULL); - String(String& s); + String(const String& s); String& operator=(String& s); String(const std::string& s); virtual ~String(); - Node* Clone(); + Node* Clone() const; void SetValue(const std::string& s); - std::string GetValue(); + std::string GetValue() const; }; }; diff --git a/include/plist/Uid.h b/include/plist/Uid.h index e11b022..2d8375b 100644 --- a/include/plist/Uid.h +++ b/include/plist/Uid.h @@ -32,15 +32,15 @@ class Uid : public Node public : Uid(Node* parent = NULL); Uid(plist_t node, Node* parent = NULL); - Uid(Uid& i); + Uid(const Uid& i); Uid& operator=(Uid& i); Uid(uint64_t i); virtual ~Uid(); - Node* Clone(); + Node* Clone() const; void SetValue(uint64_t i); - uint64_t GetValue(); + uint64_t GetValue() const; }; }; |