Commit 213164ae authored by Ronan's avatar Ronan

fix(content): clean file/file-transfert content

parent 01694c2b
......@@ -43,6 +43,7 @@ public:
Content &operator= (const Content &src);
Content &operator= (Content &&src);
bool operator== (const Content &content) const;
const ContentType &getContentType () const;
......
......@@ -17,9 +17,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
// TODO: Remove me later.
#include "linphone/core.h"
#include "content-p.h"
#include "file-content.h"
#include "linphone/core.h"
// =============================================================================
......@@ -27,6 +29,8 @@ using namespace std;
LINPHONE_BEGIN_NAMESPACE
// -----------------------------------------------------------------------------
class FileContentPrivate : public ContentPrivate {
public:
string fileName;
......@@ -36,7 +40,7 @@ public:
// -----------------------------------------------------------------------------
FileContent::FileContent() : Content(*new FileContentPrivate()) {}
FileContent::FileContent () : Content(*new FileContentPrivate) {}
FileContent::FileContent (const FileContent &src) : Content(*new FileContentPrivate) {
L_D();
......@@ -81,22 +85,22 @@ bool FileContent::operator== (const FileContent &content) const {
d->fileSize == content.getFileSize();
}
void FileContent::setFileSize(size_t size) {
void FileContent::setFileSize (size_t size) {
L_D();
d->fileSize = size;
}
size_t FileContent::getFileSize() const {
size_t FileContent::getFileSize () const {
L_D();
return d->fileSize;
}
void FileContent::setFileName(const string &name) {
void FileContent::setFileName (const string &name) {
L_D();
d->fileName = name;
}
const string& FileContent::getFileName() const {
const string &FileContent::getFileName () const {
L_D();
return d->fileName;
}
......@@ -106,12 +110,12 @@ void FileContent::setFilePath (const string &path) {
d->filePath = path;
}
const string& FileContent::getFilePath () const {
const string &FileContent::getFilePath () const {
L_D();
return d->filePath;
}
LinphoneContent *FileContent::toLinphoneContent() const {
LinphoneContent *FileContent::toLinphoneContent () const {
LinphoneContent *content = linphone_core_create_content(nullptr);
linphone_content_set_type(content, getContentType().getType().c_str());
linphone_content_set_subtype(content, getContentType().getSubType().c_str());
......
......@@ -36,18 +36,20 @@ public:
FileContent &operator= (const FileContent &src);
FileContent &operator= (FileContent &&src);
bool operator== (const FileContent &content) const;
void setFileSize (size_t size);
size_t getFileSize () const;
void setFileName (const std::string &name);
const std::string &getFileName() const;
const std::string &getFileName () const;
void setFilePath (const std::string &path);
const std::string &getFilePath() const;
const std::string &getFilePath () const;
LinphoneContent *toLinphoneContent() const override;
// TODO: Remove me later.
LinphoneContent *toLinphoneContent () const override;
private:
L_DECLARE_PRIVATE(FileContent);
......
......@@ -17,9 +17,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
// TODO: Remove me later.
#include "linphone/core.h"
#include "content-p.h"
#include "file-transfer-content.h"
#include "linphone/core.h"
// =============================================================================
......@@ -27,6 +29,8 @@ using namespace std;
LINPHONE_BEGIN_NAMESPACE
// -----------------------------------------------------------------------------
class FileTransferContentPrivate : public ContentPrivate {
public:
string fileName;
......@@ -37,9 +41,7 @@ public:
// -----------------------------------------------------------------------------
FileTransferContent::FileTransferContent() : Content(*new FileTransferContentPrivate()) {
}
FileTransferContent::FileTransferContent () : Content(*new FileTransferContentPrivate) {}
FileTransferContent::FileTransferContent (const FileTransferContent &src) : Content(*new FileTransferContentPrivate) {
L_D();
......@@ -88,49 +90,48 @@ bool FileTransferContent::operator== (const FileTransferContent &content) const
d->filePath == content.getFilePath();
}
void FileTransferContent::setFileName(const string &name) {
void FileTransferContent::setFileName (const string &name) {
L_D();
d->fileName = name;
}
const string& FileTransferContent::getFileName() const {
const string &FileTransferContent::getFileName () const {
L_D();
return d->fileName;
}
void FileTransferContent::setFileUrl(const string &url) {
void FileTransferContent::setFileUrl (const string &url) {
L_D();
d->fileUrl = url;
}
const string& FileTransferContent::getFileUrl() const {
const string &FileTransferContent::getFileUrl () const {
L_D();
return d->fileUrl;
}
void FileTransferContent::setFilePath(const string &path) {
void FileTransferContent::setFilePath (const string &path) {
L_D();
d->filePath = path;
}
const string& FileTransferContent::getFilePath() const {
const string &FileTransferContent::getFilePath () const {
L_D();
return d->filePath;
}
void FileTransferContent::setFileContent(FileContent *content) {
void FileTransferContent::setFileContent (FileContent *content) {
L_D();
d->fileContent = content;
}
FileContent* FileTransferContent::getFileContent() const {
FileContent *FileTransferContent::getFileContent () const {
L_D();
return d->fileContent;
}
LinphoneContent * FileTransferContent::toLinphoneContent() const {
LinphoneContent* content;
content = linphone_core_create_content(NULL);
LinphoneContent *FileTransferContent::toLinphoneContent () const {
LinphoneContent *content = linphone_core_create_content(nullptr);
linphone_content_set_type(content, getContentType().getType().c_str());
linphone_content_set_subtype(content, getContentType().getSubType().c_str());
linphone_content_set_name(content, getFileName().c_str());
......
......@@ -21,37 +21,39 @@
#define _FILE_TRANSFER_CONTENT_H_
#include "content.h"
#include "file-content.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
class FileContent;
class FileTransferContentPrivate;
class LINPHONE_PUBLIC FileTransferContent : public Content {
public:
FileTransferContent();
FileTransferContent ();
FileTransferContent (const FileTransferContent &src);
FileTransferContent (FileTransferContent &&src);
FileTransferContent &operator= (const FileTransferContent &src);
FileTransferContent &operator= (FileTransferContent &&src);
bool operator== (const FileTransferContent &content) const;
void setFileName(const std::string &name);
const std::string& getFileName() const;
void setFileUrl(const std::string &url);
const std::string& getFileUrl() const;
void setFilePath(const std::string &path);
const std::string& getFilePath() const;
void setFileContent(FileContent *content);
FileContent* getFileContent() const;
LinphoneContent * toLinphoneContent() const override;
void setFileName (const std::string &name);
const std::string &getFileName () const;
void setFileUrl (const std::string &url);
const std::string &getFileUrl () const;
void setFilePath (const std::string &path);
const std::string &getFilePath () const;
void setFileContent (FileContent *content);
FileContent *getFileContent () const;
// TODO: Remove me later.
LinphoneContent *toLinphoneContent () const override;
private:
L_DECLARE_PRIVATE(FileTransferContent);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment