From 21c190edeec50092bf76b7c5841b63082c107c40 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Thu, 10 Oct 2013 21:02:25 +0200 Subject: [PATCH] [DEV] correct file does not exist --- etk/Stream.cpp | 10 +++++----- etk/Stream.h | 2 +- etk/os/FSNode.cpp | 41 +++++++++++++++++++++++------------------ 3 files changed, 29 insertions(+), 24 deletions(-) diff --git a/etk/Stream.cpp b/etk/Stream.cpp index 340f2e3..66b9ab5 100644 --- a/etk/Stream.cpp +++ b/etk/Stream.cpp @@ -15,8 +15,7 @@ #include #include #define MAX_DEPTH (256) - void etk::displayBacktrace(void) - { + void etk::displayBacktrace(bool _breakAtEnd) { // retrieve call-stack void * trace[MAX_DEPTH]; int stack_depth = backtrace(trace, MAX_DEPTH); @@ -39,11 +38,12 @@ free(demangled); } } - assert(false); + if (_breakAtEnd == true) { + assert(false); + } } #else - void etk::displayBacktrace(void) - { + void etk::displayBacktrace(bool _breakAtEnd) { #if DEBUG_LEVEL > 2 assert(false); #endif diff --git a/etk/Stream.h b/etk/Stream.h index 004dcaf..d016f95 100644 --- a/etk/Stream.h +++ b/etk/Stream.h @@ -69,7 +69,7 @@ namespace etk */ etk::CCout& operator <<(etk::CCout &_os, const etk::logLevel_te _obj); - void displayBacktrace(void); + void displayBacktrace(bool _breakAtEnd=true); }; //regular colors diff --git a/etk/os/FSNode.cpp b/etk/os/FSNode.cpp index d813a95..571cb66 100644 --- a/etk/os/FSNode.cpp +++ b/etk/os/FSNode.cpp @@ -360,6 +360,9 @@ bool etk::FSNode::loadDataZip(void) if (NULL != m_zipContent) { return true; } + if (false == s_APKArchive->exist(m_systemFileName)) { + return false; + } m_zipContent = &s_APKArchive->getContent(m_systemFileName); if (NULL != m_zipContent) { return true; @@ -424,27 +427,26 @@ static int32_t FSNODE_LOCAL_mkPath(const char* _path, mode_t _mode) #undef __class__ -#define __class__ "FSNode" +#define __class__ "FSNode" etk::FSNode::FSNode(const etk::UString& _nodeName) : - m_userFileName(""), - m_type(etk::FSN_TYPE_UNKNOW), - m_typeNode(etk::FSN_UNKNOW), - m_PointerFile(NULL), - m_timeCreate(0), - m_timeModify(0), - m_timeAccess(0) - #ifdef __TARGET_OS__Android - , m_zipContent(NULL), - m_zipReadingOffset(-1) - #endif + m_userFileName(""), + m_type(etk::FSN_TYPE_UNKNOW), + m_typeNode(etk::FSN_UNKNOW), + m_PointerFile(NULL), + m_timeCreate(0), + m_timeModify(0), + m_timeAccess(0) +#ifdef __TARGET_OS__Android + , m_zipContent(NULL), + m_zipReadingOffset(-1) +#endif { privateSetName(_nodeName); } -etk::FSNode::~FSNode(void) -{ +etk::FSNode::~FSNode(void) { if( NULL != m_PointerFile #ifdef __TARGET_OS__Android || NULL != m_zipContent @@ -456,8 +458,7 @@ etk::FSNode::~FSNode(void) } -void etk::FSNode::sortElementList(etk::Vector& _list) -{ +void etk::FSNode::sortElementList(etk::Vector& _list) { etk::Vector tmpList = _list; _list.clear(); for(int32_t iii=0; iiiexist(m_systemFileName) == true) { + m_typeNode=FSN_FILE; + } m_rights.setUserReadable(true); // TODO : Set the time of the file (time program compilation) // TODO : Set the USER ID in the group and the user Id ... @@ -1233,7 +1238,7 @@ void etk::FSNode::folderGetRecursiveFiles(etk::Vector& _output, bo tmpString = "THEME:"; } if (true == filename.startWith(assetsName)) { - filename.remove(0,assetsName.Size()); + filename.remove(0,assetsName.size()); } tmpString += filename; _output.pushBack(tmpString);