[DEV] start searching file property for Auto package in one file
This commit is contained in:
parent
d98a438428
commit
742a070307
@ -60,13 +60,13 @@ void etk::Archive::display()
|
|||||||
}
|
}
|
||||||
|
|
||||||
etk::Archive* etk::Archive::load(const std::string& _fileName) {
|
etk::Archive* etk::Archive::load(const std::string& _fileName) {
|
||||||
etk::Archive* output=NULL;
|
etk::Archive* output=nullptr;
|
||||||
std::string tmpName = etk::tolower(_fileName);
|
std::string tmpName = etk::tolower(_fileName);
|
||||||
// select the corect Loader :
|
// select the corect Loader :
|
||||||
if( true == end_with(tmpName, ".zip")
|
if( true == end_with(tmpName, ".zip")
|
||||||
|| true == end_with(tmpName, ".apk") ) {
|
|| true == end_with(tmpName, ".apk") ) {
|
||||||
output = new etk::archive::Zip(_fileName);
|
output = new etk::archive::Zip(_fileName);
|
||||||
if (NULL==output) {
|
if (nullptr==output) {
|
||||||
TK_ERROR("An error occured when load archive : " << _fileName);
|
TK_ERROR("An error occured when load archive : " << _fileName);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -75,6 +75,39 @@ etk::Archive* etk::Archive::load(const std::string& _fileName) {
|
|||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
etk::Archive* etk::Archive::loadPackage(const std::string& _fileName) {
|
||||||
|
etk::Archive* output=nullptr;
|
||||||
|
FILE* file = fopen(_fileName.c_str(), "rb");
|
||||||
|
if (file == nullptr) {
|
||||||
|
TK_ERROR("Can not open file : '" << _fileName);
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
// move to end - 16 bytes:
|
||||||
|
fseek(file, -8, SEEK_END);
|
||||||
|
// get the basic binary size
|
||||||
|
uint64_t position = 0;
|
||||||
|
fread(&position, 1, sizeof(uint64_t), file);
|
||||||
|
TK_ERROR("position = " << position);
|
||||||
|
// move to the position
|
||||||
|
fseek(file, position, SEEK_SET);
|
||||||
|
char plop[1024];
|
||||||
|
fread(plop, 1, 16, file);
|
||||||
|
plop[16] = '\0';
|
||||||
|
// check if we have the mark: "***START DATA***" ==> if not ==> error
|
||||||
|
if (std::string(plop) != "***START DATA***") {
|
||||||
|
TK_ERROR("Error in the tag file : '" << plop << "'");
|
||||||
|
fclose(file);
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
fclose(file);
|
||||||
|
file = nullptr;
|
||||||
|
output = new etk::archive::Zip(_fileName, position);
|
||||||
|
if (nullptr==output) {
|
||||||
|
TK_ERROR("An error occured when load archive : " << _fileName);
|
||||||
|
}
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void etk::Archive::open(const std::string& _key) {
|
void etk::Archive::open(const std::string& _key) {
|
||||||
auto it = m_content.find(_key);
|
auto it = m_content.find(_key);
|
||||||
|
@ -128,6 +128,12 @@ namespace etk {
|
|||||||
* @return A pointer an the specified archive, the user might delete it.
|
* @return A pointer an the specified archive, the user might delete it.
|
||||||
*/
|
*/
|
||||||
static Archive* load(const std::string& _fileName);
|
static Archive* load(const std::string& _fileName);
|
||||||
|
/**
|
||||||
|
* @brief Load an Achive with a specific name in package mode ==> this mean the data is associated with the basic binary.
|
||||||
|
* @param[in] _fileName File name of the specific archive.
|
||||||
|
* @return A pointer an the specified archive, the user might delete it.
|
||||||
|
*/
|
||||||
|
static Archive* loadPackage(const std::string& _fileName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Create an Achive with a specific name.
|
* @brief Create an Achive with a specific name.
|
||||||
|
@ -11,11 +11,11 @@
|
|||||||
#include <etk/archive/Zip.h>
|
#include <etk/archive/Zip.h>
|
||||||
#include <etk/types.h>
|
#include <etk/types.h>
|
||||||
|
|
||||||
etk::archive::Zip::Zip(const std::string& _fileName) :
|
etk::archive::Zip::Zip(const std::string& _fileName, uint64_t _offset) :
|
||||||
etk::Archive(_fileName),
|
etk::Archive(_fileName),
|
||||||
m_ctx(nullptr) {
|
m_ctx(nullptr) {
|
||||||
/* Open the zip file */
|
/* Open the zip file */
|
||||||
m_ctx = unzOpen(m_fileName.c_str());
|
m_ctx = unzOpenOffset(m_fileName.c_str(), _offset);
|
||||||
if(!m_ctx) {
|
if(!m_ctx) {
|
||||||
TK_ERROR("Unable to open the zip file '" << m_fileName << "'");
|
TK_ERROR("Unable to open the zip file '" << m_fileName << "'");
|
||||||
return;
|
return;
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
unzFile m_ctx; //!< mini zip context
|
unzFile m_ctx; //!< mini zip context
|
||||||
unz_global_info m_info; //!< global information of the Zip
|
unz_global_info m_info; //!< global information of the Zip
|
||||||
public:
|
public:
|
||||||
Zip(const std::string& _fileName);
|
Zip(const std::string& _fileName, uint64_t _offset = 0LL);
|
||||||
virtual ~Zip();
|
virtual ~Zip();
|
||||||
protected: // herited functions :
|
protected: // herited functions :
|
||||||
virtual void loadFile(const std::map<std::string, ArchiveContent>::iterator& it);
|
virtual void loadFile(const std::map<std::string, ArchiveContent>::iterator& it);
|
||||||
|
@ -25,7 +25,7 @@ extern "C" {
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __TARGET_OS__Android
|
#if (defined(__TARGET_OS__Android) || defined(__TARGET_OS__Windows))
|
||||||
# include <etk/archive/Archive.h>
|
# include <etk/archive/Archive.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -152,12 +152,22 @@ static std::string baseRunPathInHome = "/";
|
|||||||
|
|
||||||
|
|
||||||
#ifdef __TARGET_OS__Android
|
#ifdef __TARGET_OS__Android
|
||||||
static etk::Archive* s_APKArchive = NULL;
|
static etk::Archive* s_APKArchive = nullptr;
|
||||||
static void loadAPK(std::string& _apkPath)
|
static void loadAPK(std::string& _apkPath)
|
||||||
{
|
{
|
||||||
TK_DEBUG("Loading APK \"" << _apkPath << "\"");
|
TK_DEBUG("Loading APK \"" << _apkPath << "\"");
|
||||||
s_APKArchive = etk::Archive::load(_apkPath);
|
s_APKArchive = etk::Archive::load(_apkPath);
|
||||||
TK_ASSERT(s_APKArchive != NULL, "Error loading APK ... \"" << _apkPath << "\"");
|
TK_ASSERT(s_APKArchive != nullptr, "Error loading APK ... \"" << _apkPath << "\"");
|
||||||
|
//Just for debug, print APK contents
|
||||||
|
s_APKArchive->display();
|
||||||
|
}
|
||||||
|
#elif defined(__TARGET_OS__Windows)
|
||||||
|
static etk::Archive* s_APKArchive = nullptr;
|
||||||
|
static void loadAPK(std::string& _apkPath)
|
||||||
|
{
|
||||||
|
TK_DEBUG("Loading APK \"" << _apkPath << "\"");
|
||||||
|
s_APKArchive = etk::Archive::loadPackage(_apkPath);
|
||||||
|
TK_ASSERT(s_APKArchive != nullptr, "Error loading APK ... \"" << _apkPath << "\"");
|
||||||
//Just for debug, print APK contents
|
//Just for debug, print APK contents
|
||||||
s_APKArchive->display();
|
s_APKArchive->display();
|
||||||
}
|
}
|
||||||
@ -221,6 +231,7 @@ std::string getApplicationPath() {
|
|||||||
TK_CRITICAL("Can not get the binary position in the tree ==> this is really bad ...");
|
TK_CRITICAL("Can not get the binary position in the tree ==> this is really bad ...");
|
||||||
} else {
|
} else {
|
||||||
binaryName = binaryCompleatePath;
|
binaryName = binaryCompleatePath;
|
||||||
|
loadAPK(binaryName);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
// check it to prevent test mode in local folder ...
|
// check it to prevent test mode in local folder ...
|
||||||
@ -423,7 +434,7 @@ std::string etk::getUserRunFolder() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef __TARGET_OS__Android
|
#if (defined(__TARGET_OS__Android) || defined(__TARGET_OS__Windows))
|
||||||
bool etk::FSNode::loadDataZip() {
|
bool etk::FSNode::loadDataZip() {
|
||||||
if (s_APKArchive == nullptr) {
|
if (s_APKArchive == nullptr) {
|
||||||
return false;
|
return false;
|
||||||
@ -499,7 +510,7 @@ etk::FSNode::FSNode(const std::string& _nodeName) :
|
|||||||
m_timeCreate(0),
|
m_timeCreate(0),
|
||||||
m_timeModify(0),
|
m_timeModify(0),
|
||||||
m_timeAccess(0)
|
m_timeAccess(0)
|
||||||
#ifdef __TARGET_OS__Android
|
#if (defined(__TARGET_OS__Android) || defined(__TARGET_OS__Windows))
|
||||||
, m_zipContent(NULL),
|
, m_zipContent(NULL),
|
||||||
m_zipReadingOffset(-1)
|
m_zipReadingOffset(-1)
|
||||||
#endif
|
#endif
|
||||||
@ -515,7 +526,7 @@ etk::FSNode::FSNode(const std::string& _nodeName) :
|
|||||||
m_timeCreate(0),
|
m_timeCreate(0),
|
||||||
m_timeModify(0),
|
m_timeModify(0),
|
||||||
m_timeAccess(0)
|
m_timeAccess(0)
|
||||||
#ifdef __TARGET_OS__Android
|
#if (defined(__TARGET_OS__Android) || defined(__TARGET_OS__Windows))
|
||||||
, m_zipContent(NULL),
|
, m_zipContent(NULL),
|
||||||
m_zipReadingOffset(-1)
|
m_zipReadingOffset(-1)
|
||||||
#endif
|
#endif
|
||||||
@ -527,7 +538,7 @@ etk::FSNode::FSNode(const std::string& _nodeName) :
|
|||||||
|
|
||||||
etk::FSNode::~FSNode() {
|
etk::FSNode::~FSNode() {
|
||||||
if( NULL != m_PointerFile
|
if( NULL != m_PointerFile
|
||||||
#ifdef __TARGET_OS__Android
|
#if (defined(__TARGET_OS__Android) || defined(__TARGET_OS__Windows))
|
||||||
|| NULL != m_zipContent
|
|| NULL != m_zipContent
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
@ -560,7 +571,7 @@ void etk::FSNode::sortElementList(std::vector<etk::FSNode *>& _list) {
|
|||||||
|
|
||||||
void etk::FSNode::privateSetName(const std::string& _newName) {
|
void etk::FSNode::privateSetName(const std::string& _newName) {
|
||||||
if( NULL != m_PointerFile
|
if( NULL != m_PointerFile
|
||||||
#ifdef __TARGET_OS__Android
|
#if (defined(__TARGET_OS__Android) || defined(__TARGET_OS__Windows))
|
||||||
|| NULL != m_zipContent
|
|| NULL != m_zipContent
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
@ -570,7 +581,7 @@ void etk::FSNode::privateSetName(const std::string& _newName) {
|
|||||||
// set right at NULL ...
|
// set right at NULL ...
|
||||||
m_rights = 0;
|
m_rights = 0;
|
||||||
|
|
||||||
#ifdef __TARGET_OS__Android
|
#if (defined(__TARGET_OS__Android) || defined(__TARGET_OS__Windows))
|
||||||
m_zipContent = NULL;
|
m_zipContent = NULL;
|
||||||
m_zipReadingOffset = 0;
|
m_zipReadingOffset = 0;
|
||||||
#endif
|
#endif
|
||||||
@ -732,7 +743,7 @@ void etk::FSNode::privateSetName(const std::string& _newName) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool directCheckFile(std::string _tmpFileNameDirect, bool _checkInAPKIfNeeded = false) {
|
bool directCheckFile(std::string _tmpFileNameDirect, bool _checkInAPKIfNeeded = false) {
|
||||||
#ifdef __TARGET_OS__Android
|
#if (defined(__TARGET_OS__Android) || defined(__TARGET_OS__Windows))
|
||||||
if (true == _checkInAPKIfNeeded) {
|
if (true == _checkInAPKIfNeeded) {
|
||||||
if( NULL != s_APKArchive
|
if( NULL != s_APKArchive
|
||||||
&& true == s_APKArchive->exist(_tmpFileNameDirect) ) {
|
&& true == s_APKArchive->exist(_tmpFileNameDirect) ) {
|
||||||
@ -860,7 +871,7 @@ void etk::FSNode::updateFileSystemProperty() {
|
|||||||
// File type is not knowns ...
|
// File type is not knowns ...
|
||||||
m_typeNode=FSN_UNKNOW;
|
m_typeNode=FSN_UNKNOW;
|
||||||
|
|
||||||
#ifdef __TARGET_OS__Android
|
#if (defined(__TARGET_OS__Android) || defined(__TARGET_OS__Windows))
|
||||||
if( m_type == etk::FSN_TYPE_DATA
|
if( m_type == etk::FSN_TYPE_DATA
|
||||||
|| m_type == etk::FSN_TYPE_THEME_DATA) {
|
|| m_type == etk::FSN_TYPE_THEME_DATA) {
|
||||||
// ----------------------------------------
|
// ----------------------------------------
|
||||||
@ -1180,7 +1191,7 @@ const etk::FSNode& etk::FSNode::operator= (const etk::FSNode &_obj ) {
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
if( NULL != m_PointerFile
|
if( NULL != m_PointerFile
|
||||||
#ifdef __TARGET_OS__Android
|
#if (defined(__TARGET_OS__Android) || defined(__TARGET_OS__Windows))
|
||||||
|| NULL != m_zipContent
|
|| NULL != m_zipContent
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
@ -1188,7 +1199,7 @@ const etk::FSNode& etk::FSNode::operator= (const etk::FSNode &_obj ) {
|
|||||||
fileClose();
|
fileClose();
|
||||||
m_PointerFile = NULL;
|
m_PointerFile = NULL;
|
||||||
}
|
}
|
||||||
#ifdef __TARGET_OS__Android
|
#if (defined(__TARGET_OS__Android) || defined(__TARGET_OS__Windows))
|
||||||
m_zipContent = NULL;
|
m_zipContent = NULL;
|
||||||
m_zipReadingOffset = 0;
|
m_zipReadingOffset = 0;
|
||||||
#endif
|
#endif
|
||||||
@ -1323,7 +1334,7 @@ std::vector<etk::FSNode *> etk::FSNode::folderGetSubList(bool _showHidenFile, bo
|
|||||||
if (m_typeNode != etk::FSN_FOLDER ) {
|
if (m_typeNode != etk::FSN_FOLDER ) {
|
||||||
return tmpp;
|
return tmpp;
|
||||||
}
|
}
|
||||||
#ifdef __TARGET_OS__Android
|
#if (defined(__TARGET_OS__Android) || defined(__TARGET_OS__Windows))
|
||||||
if( m_type == etk::FSN_TYPE_DATA
|
if( m_type == etk::FSN_TYPE_DATA
|
||||||
|| m_type == etk::FSN_TYPE_THEME_DATA) {
|
|| m_type == etk::FSN_TYPE_THEME_DATA) {
|
||||||
std::vector<std::string> listAdded;
|
std::vector<std::string> listAdded;
|
||||||
@ -1417,7 +1428,7 @@ etk::FSNode etk::FSNode::folderGetParent() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void etk::FSNode::folderGetRecursiveFiles(std::vector<std::string>& _output, bool _recursiveEnable) {
|
void etk::FSNode::folderGetRecursiveFiles(std::vector<std::string>& _output, bool _recursiveEnable) {
|
||||||
#ifdef __TARGET_OS__Android
|
#if (defined(__TARGET_OS__Android) || defined(__TARGET_OS__Windows))
|
||||||
if( m_type == etk::FSN_TYPE_DATA
|
if( m_type == etk::FSN_TYPE_DATA
|
||||||
|| m_type == etk::FSN_TYPE_THEME_DATA) {
|
|| m_type == etk::FSN_TYPE_THEME_DATA) {
|
||||||
std::string assetsName = "assets/";
|
std::string assetsName = "assets/";
|
||||||
@ -1528,7 +1539,7 @@ uint64_t etk::FSNode::fileSize() {
|
|||||||
TK_ERROR("Request size of a non file node : " << m_typeNode);
|
TK_ERROR("Request size of a non file node : " << m_typeNode);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#ifdef __TARGET_OS__Android
|
#if (defined(__TARGET_OS__Android) || defined(__TARGET_OS__Windows))
|
||||||
if( etk::FSN_TYPE_DATA == m_type
|
if( etk::FSN_TYPE_DATA == m_type
|
||||||
|| etk::FSN_TYPE_THEME_DATA == m_type) {
|
|| etk::FSN_TYPE_THEME_DATA == m_type) {
|
||||||
if (true == loadDataZip()) {
|
if (true == loadDataZip()) {
|
||||||
@ -1554,7 +1565,7 @@ uint64_t etk::FSNode::fileSize() {
|
|||||||
|
|
||||||
|
|
||||||
bool etk::FSNode::fileOpenRead() {
|
bool etk::FSNode::fileOpenRead() {
|
||||||
#ifdef __TARGET_OS__Android
|
#if (defined(__TARGET_OS__Android) || defined(__TARGET_OS__Windows))
|
||||||
if( etk::FSN_TYPE_DATA == m_type
|
if( etk::FSN_TYPE_DATA == m_type
|
||||||
|| etk::FSN_TYPE_THEME_DATA == m_type) {
|
|| etk::FSN_TYPE_THEME_DATA == m_type) {
|
||||||
if (false==loadDataZip()) {
|
if (false==loadDataZip()) {
|
||||||
@ -1577,7 +1588,7 @@ bool etk::FSNode::fileOpenRead() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool etk::FSNode::fileOpenWrite() {
|
bool etk::FSNode::fileOpenWrite() {
|
||||||
#ifdef __TARGET_OS__Android
|
#if (defined(__TARGET_OS__Android) || defined(__TARGET_OS__Windows))
|
||||||
if( etk::FSN_TYPE_DATA == m_type
|
if( etk::FSN_TYPE_DATA == m_type
|
||||||
|| etk::FSN_TYPE_THEME_DATA == m_type) {
|
|| etk::FSN_TYPE_THEME_DATA == m_type) {
|
||||||
return false;
|
return false;
|
||||||
@ -1598,7 +1609,7 @@ bool etk::FSNode::fileOpenWrite() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool etk::FSNode::fileOpenAppend() {
|
bool etk::FSNode::fileOpenAppend() {
|
||||||
#ifdef __TARGET_OS__Android
|
#if (defined(__TARGET_OS__Android) || defined(__TARGET_OS__Windows))
|
||||||
if( etk::FSN_TYPE_DATA == m_type
|
if( etk::FSN_TYPE_DATA == m_type
|
||||||
|| etk::FSN_TYPE_THEME_DATA == m_type) {
|
|| etk::FSN_TYPE_THEME_DATA == m_type) {
|
||||||
return false;
|
return false;
|
||||||
@ -1621,7 +1632,7 @@ bool etk::FSNode::fileOpenAppend() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool etk::FSNode::fileClose() {
|
bool etk::FSNode::fileClose() {
|
||||||
#ifdef __TARGET_OS__Android
|
#if (defined(__TARGET_OS__Android) || defined(__TARGET_OS__Windows))
|
||||||
if( etk::FSN_TYPE_DATA == m_type
|
if( etk::FSN_TYPE_DATA == m_type
|
||||||
|| etk::FSN_TYPE_THEME_DATA == m_type) {
|
|| etk::FSN_TYPE_THEME_DATA == m_type) {
|
||||||
if (m_zipContent == NULL) {
|
if (m_zipContent == NULL) {
|
||||||
@ -1645,7 +1656,7 @@ bool etk::FSNode::fileClose() {
|
|||||||
|
|
||||||
char* etk::FSNode::fileGets(char* _elementLine, int64_t _maxData) {
|
char* etk::FSNode::fileGets(char* _elementLine, int64_t _maxData) {
|
||||||
memset(_elementLine, 0, _maxData);
|
memset(_elementLine, 0, _maxData);
|
||||||
#ifdef __TARGET_OS__Android
|
#if (defined(__TARGET_OS__Android) || defined(__TARGET_OS__Windows))
|
||||||
char * element = _elementLine;
|
char * element = _elementLine;
|
||||||
int64_t outSize = 0;
|
int64_t outSize = 0;
|
||||||
if( m_type == etk::FSN_TYPE_DATA
|
if( m_type == etk::FSN_TYPE_DATA
|
||||||
@ -1715,7 +1726,7 @@ bool etk::FSNode::fileGets(std::string& _output) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int64_t etk::FSNode::fileRead(void* _data, int64_t _blockSize, int64_t _nbBlock) {
|
int64_t etk::FSNode::fileRead(void* _data, int64_t _blockSize, int64_t _nbBlock) {
|
||||||
#ifdef __TARGET_OS__Android
|
#if (defined(__TARGET_OS__Android) || defined(__TARGET_OS__Windows))
|
||||||
if( m_type == etk::FSN_TYPE_DATA
|
if( m_type == etk::FSN_TYPE_DATA
|
||||||
|| m_type == etk::FSN_TYPE_THEME_DATA) {
|
|| m_type == etk::FSN_TYPE_THEME_DATA) {
|
||||||
if (m_zipContent == NULL) {
|
if (m_zipContent == NULL) {
|
||||||
@ -1750,7 +1761,7 @@ bool etk::FSNode::filePuts(const std::string& _input) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int64_t etk::FSNode::fileWrite(const void * _data, int64_t _blockSize, int64_t _nbBlock) {
|
int64_t etk::FSNode::fileWrite(const void * _data, int64_t _blockSize, int64_t _nbBlock) {
|
||||||
#ifdef __TARGET_OS__Android
|
#if (defined(__TARGET_OS__Android) || defined(__TARGET_OS__Windows))
|
||||||
if( m_type == etk::FSN_TYPE_DATA
|
if( m_type == etk::FSN_TYPE_DATA
|
||||||
|| m_type == etk::FSN_TYPE_THEME_DATA) {
|
|| m_type == etk::FSN_TYPE_THEME_DATA) {
|
||||||
TK_CRITICAL("Can not write on data inside APK : " << *this);
|
TK_CRITICAL("Can not write on data inside APK : " << *this);
|
||||||
@ -1802,7 +1813,7 @@ etk::FSNode& etk::FSNode::operator<< (const float _data) {
|
|||||||
|
|
||||||
bool etk::FSNode::fileSeek(long int _offset, enum etk::seekNode _origin)
|
bool etk::FSNode::fileSeek(long int _offset, enum etk::seekNode _origin)
|
||||||
{
|
{
|
||||||
#ifdef __TARGET_OS__Android
|
#if (defined(__TARGET_OS__Android) || defined(__TARGET_OS__Windows))
|
||||||
if( m_type == etk::FSN_TYPE_DATA
|
if( m_type == etk::FSN_TYPE_DATA
|
||||||
|| m_type == etk::FSN_TYPE_THEME_DATA) {
|
|| m_type == etk::FSN_TYPE_THEME_DATA) {
|
||||||
if (NULL == m_zipContent) {
|
if (NULL == m_zipContent) {
|
||||||
@ -1850,7 +1861,7 @@ bool etk::FSNode::fileSeek(long int _offset, enum etk::seekNode _origin)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
int64_t etk::FSNode::fileTell() {
|
int64_t etk::FSNode::fileTell() {
|
||||||
#ifdef __TARGET_OS__Android
|
#if (defined(__TARGET_OS__Android) || defined(__TARGET_OS__Windows))
|
||||||
if( m_type == etk::FSN_TYPE_DATA
|
if( m_type == etk::FSN_TYPE_DATA
|
||||||
|| m_type == etk::FSN_TYPE_THEME_DATA) {
|
|| m_type == etk::FSN_TYPE_THEME_DATA) {
|
||||||
if (NULL == m_zipContent) {
|
if (NULL == m_zipContent) {
|
||||||
@ -1864,7 +1875,7 @@ int64_t etk::FSNode::fileTell() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void etk::FSNode::fileFlush() {
|
void etk::FSNode::fileFlush() {
|
||||||
#ifdef __TARGET_OS__Android
|
#if (defined(__TARGET_OS__Android) || defined(__TARGET_OS__Windows))
|
||||||
if( m_type == etk::FSN_TYPE_DATA
|
if( m_type == etk::FSN_TYPE_DATA
|
||||||
|| m_type == etk::FSN_TYPE_THEME_DATA) {
|
|| m_type == etk::FSN_TYPE_THEME_DATA) {
|
||||||
return;
|
return;
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
//http://developer.android.com/guide/topics/data/data-storage.html
|
//http://developer.android.com/guide/topics/data/data-storage.html
|
||||||
|
|
||||||
#ifdef __TARGET_OS__Android
|
#if (defined(__TARGET_OS__Android) || defined(__TARGET_OS__Windows))
|
||||||
namespace etk {
|
namespace etk {
|
||||||
class ArchiveContent;
|
class ArchiveContent;
|
||||||
}
|
}
|
||||||
@ -168,7 +168,7 @@ namespace etk {
|
|||||||
void privateSetName(const std::u32string& _newName);
|
void privateSetName(const std::u32string& _newName);
|
||||||
#endif
|
#endif
|
||||||
private:
|
private:
|
||||||
#ifdef __TARGET_OS__Android
|
#if (defined(__TARGET_OS__Android) || defined(__TARGET_OS__Windows))
|
||||||
/**
|
/**
|
||||||
* @brief Explocitly for Android that data are stored in the .apk that is a .zip not compressed
|
* @brief Explocitly for Android that data are stored in the .apk that is a .zip not compressed
|
||||||
* @return true : Load is OK
|
* @return true : Load is OK
|
||||||
|
@ -60,9 +60,9 @@ def create(target):
|
|||||||
myModule.add_export_path(tools.get_current_path(__file__) + "/binding_X11")
|
myModule.add_export_path(tools.get_current_path(__file__) + "/binding_X11")
|
||||||
|
|
||||||
if target.name=="Windows":
|
if target.name=="Windows":
|
||||||
None
|
pass
|
||||||
elif target.name=="Android":
|
elif target.name=="Android":
|
||||||
None
|
pass
|
||||||
else:
|
else:
|
||||||
myModule.add_export_flag_LD("-lpthread")
|
myModule.add_export_flag_LD("-lpthread")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user