[ios, osx, linux] Remove unused "applicationRoot" function

This commit is contained in:
John Firebaugh
2016-03-31 16:19:33 -07:00
parent 23f2defadd
commit 77b0723476
6 changed files with 0 additions and 52 deletions

View File

@@ -26,7 +26,6 @@
'../platform/default/sqlite3.cpp',
'../platform/darwin/src/log_nslog.mm',
'../platform/darwin/src/string_nsstring.mm',
'../platform/darwin/src/application_root.mm',
'../platform/darwin/src/image.mm',
'../platform/darwin/src/nsthread.mm',
'../platform/darwin/src/reachability.m',

View File

@@ -14,7 +14,6 @@
'../platform/default/log_stderr.cpp',
'../platform/default/string_stdlib.cpp',
'../platform/default/run_loop.cpp',
'../platform/default/application_root.cpp',
'../platform/default/thread.cpp',
'../platform/default/image.cpp',
'../platform/default/webp_reader.cpp',

View File

@@ -25,7 +25,6 @@
'../platform/default/sqlite3.cpp',
'../platform/darwin/src/log_nslog.mm',
'../platform/darwin/src/string_nsstring.mm',
'../platform/darwin/src/application_root.mm',
'../platform/darwin/src/image.mm',
'../platform/darwin/src/nsthread.mm',
'../platform/darwin/src/reachability.m',

View File

@@ -15,9 +15,6 @@ std::string uppercase(const std::string &string);
// Lowercase a string, potentially using platform-specific routines.
std::string lowercase(const std::string &string);
// Returns the path to the root folder of the application.
const std::string &applicationRoot();
// Makes the current thread low priority.
void makeThreadLowPriority();

View File

@@ -1,18 +0,0 @@
#import <Foundation/Foundation.h>
#include <mbgl/platform/platform.hpp>
namespace mbgl {
namespace platform {
// Returns the path to the root folder of the application.
const std::string &applicationRoot() {
static const std::string root = []() -> std::string {
NSString *path = [[[NSBundle mainBundle] resourceURL] path];
return {[path cStringUsingEncoding : NSUTF8StringEncoding],
[path lengthOfBytesUsingEncoding:NSUTF8StringEncoding]};
}();
return root;
}
}
}

View File

@@ -1,28 +0,0 @@
#include <mbgl/platform/platform.hpp>
#include <uv.h>
#include <libgen.h>
namespace mbgl {
namespace platform {
// Returns the path to the root folder of the application.
const std::string &applicationRoot() {
static const std::string root = []() -> std::string {
size_t max = 0;
std::string dir;
do {
// Gradually increase the length of the string in case the path was truncated.
max += 256;
dir.resize(max);
uv_exepath(const_cast<char *>(dir.data()), &max);
} while (max == dir.size());
dir.resize(max - 1);
dir = dirname(const_cast<char *>(dir.c_str()));
return dir;
}();
return root;
}
}
}