- Create `Include/` folder for all main projects - Fix some issues here and there (found while moving things) - All includes are now in `Tactility/` subfolder and must be included with that prefix. This fixes issues with clashing POSIX headers (e.g. `<semaphore.h>` versus Tactility's `Semaphore.h`)
50 lines
1.6 KiB
C++
50 lines
1.6 KiB
C++
#include "Tactility/app/AppInstancePaths.h"
|
|
|
|
#include <Tactility/Partitions.h>
|
|
|
|
#define LVGL_PATH_PREFIX std::string("A:/")
|
|
#ifdef ESP_PLATFORM
|
|
#define PARTITION_PREFIX std::string("/")
|
|
#else
|
|
#define PARTITION_PREFIX std::string("")
|
|
#endif
|
|
|
|
namespace tt::app {
|
|
|
|
std::string AppInstancePaths::getDataDirectory() const {
|
|
return PARTITION_PREFIX + DATA_PARTITION_NAME + "/app/" + manifest.id;
|
|
}
|
|
|
|
std::string AppInstancePaths::getDataDirectoryLvgl() const {
|
|
return LVGL_PATH_PREFIX + DATA_PARTITION_NAME + "/app/" + manifest.id;
|
|
}
|
|
|
|
std::string AppInstancePaths::getDataPath(const std::string& childPath) const {
|
|
assert(!childPath.starts_with('/'));
|
|
return PARTITION_PREFIX + DATA_PARTITION_NAME + "/app/" + manifest.id + '/' + childPath;
|
|
}
|
|
|
|
std::string AppInstancePaths::getDataPathLvgl(const std::string& childPath) const {
|
|
assert(!childPath.starts_with('/'));
|
|
return LVGL_PATH_PREFIX + DATA_PARTITION_NAME + "/app/" + manifest.id + '/' + childPath;
|
|
}
|
|
|
|
std::string AppInstancePaths::getSystemDirectory() const {
|
|
return PARTITION_PREFIX + SYSTEM_PARTITION_NAME + "/app/" + manifest.id;
|
|
}
|
|
|
|
std::string AppInstancePaths::getSystemDirectoryLvgl() const {
|
|
return LVGL_PATH_PREFIX + SYSTEM_PARTITION_NAME + "/app/" + manifest.id;
|
|
}
|
|
|
|
std::string AppInstancePaths::getSystemPath(const std::string& childPath) const {
|
|
assert(!childPath.starts_with('/'));
|
|
return PARTITION_PREFIX + SYSTEM_PARTITION_NAME + "/app/" + manifest.id + '/' + childPath;
|
|
}
|
|
|
|
std::string AppInstancePaths::getSystemPathLvgl(const std::string& childPath) const {
|
|
return LVGL_PATH_PREFIX + SYSTEM_PARTITION_NAME + "/app/" + manifest.id + '/' + childPath;
|
|
}
|
|
|
|
}
|