mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
feat(utils): remove content-type files
This commit is contained in:
parent
093ae07e79
commit
b1a37f6bd0
7 changed files with 47 additions and 89 deletions
|
|
@ -37,9 +37,9 @@
|
|||
|
||||
#include "c-wrapper/c-tools.h"
|
||||
#include "chat/basic-chat-room.h"
|
||||
#include "chat/real-time-text-chat-room.h"
|
||||
#include "chat/real-time-text-chat-room-p.h"
|
||||
#include "utils/content-type.h"
|
||||
#include "chat/real-time-text-chat-room.h"
|
||||
#include "content/content-type.h"
|
||||
|
||||
struct _LinphoneChatRoom{
|
||||
belle_sip_object_t base;
|
||||
|
|
|
|||
|
|
@ -92,7 +92,6 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES
|
|||
object/object-p.h
|
||||
object/object.h
|
||||
object/singleton.h
|
||||
utils/content-type.h
|
||||
utils/payload-type-handler.h
|
||||
)
|
||||
|
||||
|
|
@ -141,7 +140,6 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES
|
|||
nat/stun-client.cpp
|
||||
object/clonable-object.cpp
|
||||
object/object.cpp
|
||||
utils/content-type.cpp
|
||||
utils/general.cpp
|
||||
utils/payload-type-handler.cpp
|
||||
utils/utils.cpp
|
||||
|
|
|
|||
|
|
@ -20,11 +20,11 @@
|
|||
|
||||
#include "linphone/utils/utils.h"
|
||||
|
||||
#include "chat-room-p.h"
|
||||
#include "imdn.h"
|
||||
#include "c-wrapper/c-tools.h"
|
||||
#include "chat-room-p.h"
|
||||
#include "content/content-type.h"
|
||||
#include "imdn.h"
|
||||
#include "logger/logger.h"
|
||||
#include "utils/content-type.h"
|
||||
|
||||
#include "chat-room.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -108,4 +108,36 @@ string ContentType::asString () const {
|
|||
return isValid() ? d->type + "/" + d->subType : "";
|
||||
}
|
||||
|
||||
bool ContentType::isFileTransfer () const {
|
||||
return isFileTransfer(asString());
|
||||
}
|
||||
|
||||
bool ContentType::isImIsComposing () const {
|
||||
return isFileTransfer(asString());
|
||||
}
|
||||
|
||||
bool ContentType::isImdn () const {
|
||||
return isImdn(asString());
|
||||
}
|
||||
|
||||
bool ContentType::isText () const {
|
||||
return isText(asString());
|
||||
}
|
||||
|
||||
bool ContentType::isFileTransfer (const string &contentType) {
|
||||
return contentType == "application/vnd.gsma.rcs-ft-http+xml";
|
||||
}
|
||||
|
||||
bool ContentType::isImIsComposing (const string &contentType) {
|
||||
return contentType == "application/im-iscomposing+xml";
|
||||
}
|
||||
|
||||
bool ContentType::isImdn (const string &contentType) {
|
||||
return contentType == "message/imdn+xml";
|
||||
}
|
||||
|
||||
bool ContentType::isText (const string &contentType) {
|
||||
return contentType == "text/plain";
|
||||
}
|
||||
|
||||
LINPHONE_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -49,6 +49,16 @@ public:
|
|||
|
||||
std::string asString () const;
|
||||
|
||||
bool isFileTransfer () const;
|
||||
bool isImIsComposing () const;
|
||||
bool isImdn () const;
|
||||
bool isText () const;
|
||||
|
||||
static bool isFileTransfer (const std::string &contentType);
|
||||
static bool isImIsComposing (const std::string &contentType);
|
||||
static bool isImdn (const std::string &contentType);
|
||||
static bool isText (const std::string &contentType);
|
||||
|
||||
private:
|
||||
L_DECLARE_PRIVATE(ContentType);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,43 +0,0 @@
|
|||
/*
|
||||
* content-type.cpp
|
||||
* Copyright (C) 2017 Belledonne Communications SARL
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "content-type.h"
|
||||
|
||||
// =============================================================================
|
||||
|
||||
using namespace std;
|
||||
|
||||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
bool ContentType::isFileTransfer (const string &contentType) {
|
||||
return "application/vnd.gsma.rcs-ft-http+xml" == contentType;
|
||||
}
|
||||
|
||||
bool ContentType::isImIsComposing (const string &contentType) {
|
||||
return "application/im-iscomposing+xml" == contentType;
|
||||
}
|
||||
|
||||
bool ContentType::isImdn (const string &contentType) {
|
||||
return "message/imdn+xml" == contentType;
|
||||
}
|
||||
|
||||
bool ContentType::isText (const string &contentType) {
|
||||
return "text/plain" == contentType;
|
||||
}
|
||||
|
||||
LINPHONE_END_NAMESPACE
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
/*
|
||||
* content-type.h
|
||||
* Copyright (C) 2017 Belledonne Communications SARL
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _CONTENT_TYPE_H_
|
||||
#define _CONTENT_TYPE_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "linphone/utils/general.h"
|
||||
|
||||
// =============================================================================
|
||||
|
||||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
namespace ContentType {
|
||||
bool isFileTransfer (const std::string &contentType);
|
||||
bool isImIsComposing (const std::string &contentType);
|
||||
bool isImdn (const std::string &contentType);
|
||||
bool isText (const std::string &contentType);
|
||||
}
|
||||
|
||||
LINPHONE_END_NAMESPACE
|
||||
|
||||
#endif // ifndef _CONTENT_TYPE_H_
|
||||
Loading…
Add table
Reference in a new issue