Commit 317a5084 authored by Benjamin REIS's avatar Benjamin REIS

move platform-helpers and paths

parent 04b6f138
......@@ -47,7 +47,6 @@ list(APPEND LINPHONE_PRIVATE_HEADER_FILES
sqlite3_bctbx_vfs.h
vcard_private.h
xml2lpc.h
platform-helpers.h
)
set(LINPHONE_SOURCE_FILES_C
......@@ -111,8 +110,6 @@ set(LINPHONE_SOURCE_FILES_C
set(LINPHONE_SOURCE_FILES_CXX
conference.cc
tester_utils.cpp
platform-helpers.cpp
android-helpers.cpp
)
set(LINPHONE_INCLUDE_DIRS ${LINPHONE_INCLUDE_DIRS})
if(ENABLE_JAVA_WRAPPER)
......
......@@ -42,7 +42,7 @@
#include "sal/register-op.h"
#ifdef __cplusplus
#include "platform-helpers.h"
#include "core/platform-helpers/platform-helpers.h"
#endif
#include "linphone/sipsetup.h"
......
......@@ -100,7 +100,6 @@ set(UTILS_HEADER_FILES
enum-generator.h
general.h
magic-macros.h
paths.h
utils.h
)
......
......@@ -81,6 +81,8 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES
content/content.h
core/core-p.h
core/core.h
core/paths/paths.h
core/platform-helpers/platform-helpers.h
db/abstract/abstract-db-p.h
db/abstract/abstract-db.h
db/main-db-p.h
......@@ -169,6 +171,8 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES
content/content-type.cpp
content/content.cpp
core/core.cpp
core/paths/paths.cpp
core/platform-helpers/platform-helpers.cpp
db/abstract/abstract-db.cpp
db/main-db.cpp
db/session/db-session-provider.cpp
......@@ -199,7 +203,6 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES
sal/register-op.cpp
sal/sal.cpp
utils/general.cpp
utils/paths/paths.cpp
utils/payload-type-handler.cpp
utils/utils.cpp
variant/variant.cpp
......@@ -210,20 +213,20 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES
set(LINPHONE_OBJC_SOURCE_FILES)
if (APPLE)
list(APPEND LINPHONE_OBJC_SOURCE_FILES utils/paths/paths-apple.mm)
list(APPEND LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES utils/paths/paths-apple.h)
list(APPEND LINPHONE_OBJC_SOURCE_FILES core/paths/paths-apple.mm)
list(APPEND LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES core/paths/paths-apple.h)
elseif(ANDROID)
list(APPEND LINPHONE_CXX_OBJECTS_SOURCE_FILES utils/paths/paths-android.cpp)
list(APPEND LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES utils/paths/paths-android.h)
list(APPEND LINPHONE_CXX_OBJECTS_SOURCE_FILES core/paths/paths-android.cpp core/platform-helpers/android-helpers.cpp)
list(APPEND LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES core/paths/paths-android.h)
elseif(WIN32)
list(APPEND LINPHONE_CXX_OBJECTS_SOURCE_FILES utils/paths/paths-windows.cpp)
list(APPEND LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES utils/paths/paths-windows.h)
list(APPEND LINPHONE_CXX_OBJECTS_SOURCE_FILES core/paths/paths-windows.cpp)
list(APPEND LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES core/paths/paths-windows.h)
elseif(UNIX)
list(APPEND LINPHONE_CXX_OBJECTS_SOURCE_FILES utils/paths/paths-linux.cpp)
list(APPEND LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES utils/paths/paths-linux.h)
list(APPEND LINPHONE_CXX_OBJECTS_SOURCE_FILES core/paths/paths-linux.cpp)
list(APPEND LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES core/paths/paths-linux.h)
endif()
set(LINPHONE_CXX_OBJECTS_INCLUDE_DIRS ${BELR_INCLUDE_DIRS} ${LIBXSD_INCLUDE_DIRS})
......
......@@ -24,13 +24,11 @@
#include "core-p.h"
#include "db/main-db.h"
#include "linphone/core.h"
#include "linphone/utils/paths.h"
#include "object/object-p.h"
#include "paths/paths.h"
#include "private.h"
#include "core.h"
// =============================================================================
using namespace std;
......@@ -50,7 +48,7 @@ Core::Core (LinphoneCore *cCore) : Object(*new CorePrivate) {
: MainDb::Sqlite3;
d->mainDb.connect(backend, uri);
} else {
string path = Paths::getPath(Paths::Data, static_cast<PlatformHelper *>(cCore->platform_helper));
string path = getDataPath();
//d->mainDb.connect(MainDb::Sqlite3, linphone_factory_get_writable_dir()/linphone.db);
}
}
......@@ -71,6 +69,16 @@ const list<shared_ptr<ChatRoom>> &Core::getChatRooms () const {
return d->chatRooms;
}
const std::string &Core::getDataPath() const {
L_D();
return Paths::getPath(Paths::Data, static_cast<PlatformHelper *>(d->cCore->platform_helper));
}
const std::string &Core::getConfigPath() const {
L_D();
return Paths::getPath(Paths::Config, static_cast<PlatformHelper *>(d->cCore->platform_helper));
}
// -----------------------------------------------------------------------------
LINPHONE_END_NAMESPACE
......@@ -39,6 +39,8 @@ public:
std::shared_ptr<ChatRoom> createClientGroupChatRoom (const std::string &subject);
std::shared_ptr<ChatRoom> getOrCreateChatRoom (const std::string &peerAddress, bool isRtt = false) const;
const std::list<std::shared_ptr<ChatRoom>> &getChatRooms () const;
const std::string &getDataPath() const;
const std::string &getConfigPath() const;
private:
L_DECLARE_PRIVATE(Core);
......
......@@ -19,7 +19,7 @@
#include <jni.h>
#include "private.h"
#include "core/platform-helpers/platform-helpers.h"
#include "linphone/utils/utils.h"
#include "paths-android.h"
......
......@@ -19,7 +19,7 @@
#import "linphone/utils/utils.h"
#include "private.h"
#include "core/platform-helpers/platform-helpers.h"
#import "paths-apple.h"
#ifdef __OBJC__
......
......@@ -17,7 +17,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "private.h"
#include "core/platform-helpers/platform-helpers.h"
#include "linphone/utils/utils.h"
#include "paths-linux.h"
......
......@@ -17,7 +17,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "private.h"
#include "core/platform-helpers/platform-helpers.h"
#include "linphone/utils/utils.h"
#include "paths-windows.h"
......
......@@ -17,8 +17,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "private.h"
#include "linphone/utils/paths.h"
#include "core/platform-helpers/platform-helpers.h"
#include "paths.h"
#ifdef __APPLE__
#include "paths-apple.h"
......
......@@ -20,7 +20,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "linphone/utils/utils.h"
#include "private.h"
#include "platform-helpers.h"
#ifdef __ANDROID__
......
......@@ -20,6 +20,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef platform_helpers_h
#define platform_helpers_h
#include <string>
#include "linphone/core.h"
#include "linphone/utils/general.h"
LINPHONE_BEGIN_NAMESPACE
......
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