summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Elements')
-rw-r--r--Swiften/Elements/ChatState.h2
-rw-r--r--Swiften/Elements/ErrorPayload.h2
-rw-r--r--Swiften/Elements/Form.h6
-rw-r--r--Swiften/Elements/IBB.h7
-rw-r--r--Swiften/Elements/MUCPayload.h8
-rw-r--r--Swiften/Elements/VCard.h4
-rw-r--r--Swiften/Elements/VCardUpdate.h2
7 files changed, 16 insertions, 15 deletions
diff --git a/Swiften/Elements/ChatState.h b/Swiften/Elements/ChatState.h
index 5c83318..477fd27 100644
--- a/Swiften/Elements/ChatState.h
+++ b/Swiften/Elements/ChatState.h
@@ -18,7 +18,7 @@ namespace Swift {
state_ = state;
}
- ChatStateType getChatState() { return state_; }
+ ChatStateType getChatState() const { return state_; }
void setChatState(ChatStateType state) {state_ = state;}
private:
diff --git a/Swiften/Elements/ErrorPayload.h b/Swiften/Elements/ErrorPayload.h
index 6d31a98..f21ba98 100644
--- a/Swiften/Elements/ErrorPayload.h
+++ b/Swiften/Elements/ErrorPayload.h
@@ -73,7 +73,7 @@ namespace Swift {
payload_ = payload;
}
- boost::shared_ptr<Payload> getPayload() {
+ boost::shared_ptr<Payload> getPayload() const {
return payload_;
}
diff --git a/Swiften/Elements/Form.h b/Swiften/Elements/Form.h
index 3b93be4..47ff7d4 100644
--- a/Swiften/Elements/Form.h
+++ b/Swiften/Elements/Form.h
@@ -31,12 +31,12 @@ namespace Swift {
void addField(boost::shared_ptr<FormField> field) { fields_.push_back(field); }
const std::vector<boost::shared_ptr<FormField> >& getFields() const { return fields_; }
void setTitle(const std::string& title) { title_ = title; }
- const std::string& getTitle() { return title_; }
+ const std::string& getTitle() const { return title_; }
void setInstructions(const std::string& instructions) { instructions_ = instructions; }
- const std::string& getInstructions() { return instructions_; }
+ const std::string& getInstructions() const { return instructions_; }
- Type getType() { return type_; }
+ Type getType() const { return type_; }
void setType(Type type) { type_ = type; }
std::string getFormType() const;
diff --git a/Swiften/Elements/IBB.h b/Swiften/Elements/IBB.h
index 8138e83..64c9f14 100644
--- a/Swiften/Elements/IBB.h
+++ b/Swiften/Elements/IBB.h
@@ -9,6 +9,7 @@
#include <string>
#include <vector>
#include <boost/shared_ptr.hpp>
+#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Elements/Payload.h>
@@ -31,20 +32,20 @@ namespace Swift {
}
static IBB::ref createIBBOpen(const std::string& streamID, int blockSize) {
- IBB::ref result(new IBB(Open, streamID));
+ IBB::ref result = boost::make_shared<IBB>(Open, streamID);
result->setBlockSize(blockSize);
return result;
}
static IBB::ref createIBBData(const std::string& streamID, int sequenceNumber, const std::vector<unsigned char>& data) {
- IBB::ref result(new IBB(Data, streamID));
+ IBB::ref result = boost::make_shared<IBB>(Data, streamID);
result->setSequenceNumber(sequenceNumber);
result->setData(data);
return result;
}
static IBB::ref createIBBClose(const std::string& streamID) {
- return IBB::ref(new IBB(Close, streamID));
+ return boost::make_shared<IBB>(Close, streamID);
}
void setAction(Action action) {
diff --git a/Swiften/Elements/MUCPayload.h b/Swiften/Elements/MUCPayload.h
index 8b75bd4..3b99111 100644
--- a/Swiften/Elements/MUCPayload.h
+++ b/Swiften/Elements/MUCPayload.h
@@ -40,19 +40,19 @@ namespace Swift {
since_ = since;
}
- int getMaxChars() {
+ int getMaxChars() const{
return maxChars_;
}
- int getMaxStanzas() {
+ int getMaxStanzas() const{
return maxStanzas_;
}
- int getSeconds() {
+ int getSeconds() const {
return seconds_;
}
- boost::posix_time::ptime getSince() {
+ const boost::posix_time::ptime& getSince() const {
return since_;
}
diff --git a/Swiften/Elements/VCard.h b/Swiften/Elements/VCard.h
index cb05056..f9822c9 100644
--- a/Swiften/Elements/VCard.h
+++ b/Swiften/Elements/VCard.h
@@ -60,10 +60,10 @@ namespace Swift {
const std::string& getNickname() const { return nick_; }
void setPhoto(const ByteArray& photo) { photo_ = photo; }
- const ByteArray& getPhoto() { return photo_; }
+ const ByteArray& getPhoto() const { return photo_; }
void setPhotoType(const std::string& photoType) { photoType_ = photoType; }
- const std::string& getPhotoType() { return photoType_; }
+ const std::string& getPhotoType() const { return photoType_; }
const std::string& getUnknownContent() const { return unknownContent_; }
void addUnknownContent(const std::string& c) {
diff --git a/Swiften/Elements/VCardUpdate.h b/Swiften/Elements/VCardUpdate.h
index e225a4a..782106c 100644
--- a/Swiften/Elements/VCardUpdate.h
+++ b/Swiften/Elements/VCardUpdate.h
@@ -15,7 +15,7 @@ namespace Swift {
VCardUpdate(const std::string& photoHash = "") : photoHash_(photoHash) {}
void setPhotoHash(const std::string& photoHash) { photoHash_ = photoHash; }
- const std::string& getPhotoHash() { return photoHash_; }
+ const std::string& getPhotoHash() const { return photoHash_; }
private:
std::string photoHash_;