[DEV] add a corect path of the windows folders (not the installed one but a local
This commit is contained in:
parent
6fde63610d
commit
302f121b2d
@ -26,8 +26,8 @@ void GeneralDebugSetLevel(etk::logLevel_te ccc);
|
||||
#define ETK_DBG_COMMON(libName, info, data) do { \
|
||||
if (info <= g_requestedLevel) { \
|
||||
etk::cout << etk::cstart << info; \
|
||||
TOOLS_DisplayTime(); \
|
||||
TOOLS_DisplayFuncName(__LINE__, __class__, __func__, libName); \
|
||||
/*TOOLS_DisplayTime();*/ \
|
||||
/*TOOLS_DisplayFuncName(__LINE__, __class__, __func__, libName);*/ \
|
||||
etk::cout << data; \
|
||||
etk::cout <<etk::endl; \
|
||||
} \
|
||||
|
@ -44,7 +44,9 @@
|
||||
#else
|
||||
void etk::DisplayBacktrace(void)
|
||||
{
|
||||
|
||||
#if DEBUG_LEVEL > 2
|
||||
assert(false);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -267,7 +269,9 @@ etk::CCout& etk::CCout::operator << (CStart ccc)
|
||||
|
||||
etk::CCout& etk::CCout::operator << (etk::CEndl t)
|
||||
{
|
||||
#if !defined(__TARGET_OS__Windows)
|
||||
strncat(m_tmpChar, ETK_BASH_COLOR_NORMAL, MAX_LOG_SIZE);
|
||||
#endif
|
||||
strncat(m_tmpChar, "\n", MAX_LOG_SIZE);
|
||||
m_tmpChar[MAX_LOG_SIZE] = '\0';
|
||||
#if defined(__TARGET_OS__Android)
|
||||
|
@ -855,6 +855,15 @@ etk::Vector<etk::UString> etk::UString::Split(const etk::UniChar& _val)
|
||||
}
|
||||
|
||||
|
||||
void etk::UString::Replace(const etk::UniChar& _out, const etk::UniChar& _in)
|
||||
{
|
||||
for(int32_t iii=0 ; iii<m_data.Size() ; iii++) {
|
||||
if (m_data[iii]==_out) {
|
||||
m_data[iii]=_in;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void etk::UString::Lower(void)
|
||||
{
|
||||
for( int32_t iii=0 ; iii<m_data.Size() ; iii++) {
|
||||
|
@ -154,6 +154,12 @@ namespace etk
|
||||
* @return The list of all sthe string splited.
|
||||
*/
|
||||
etk::Vector<etk::UString> Split(const etk::UniChar& _val);
|
||||
/**
|
||||
* @brief Replace a char with an other
|
||||
* @param[in] _out element to replace.
|
||||
* @param[in] _in Element to set.
|
||||
*/
|
||||
void Replace(const etk::UniChar& _out, const etk::UniChar& _in);
|
||||
|
||||
etk::Vector<etk::UniChar> GetVector(void);
|
||||
etk::UniChar* pointer(void) { return &m_data[0]; };
|
||||
|
@ -14,7 +14,9 @@
|
||||
#include <stdlib.h>
|
||||
#include <etk/tool.h>
|
||||
#include <etk/Vector.h>
|
||||
|
||||
#ifdef __TARGET_OS__Windows
|
||||
#include "windows.h"
|
||||
#endif
|
||||
extern "C" {
|
||||
// file browsing ...
|
||||
#include <dirent.h>
|
||||
@ -265,6 +267,7 @@ etk::UString GetApplicationPath(void)
|
||||
}
|
||||
// and now we will really in a bad mood ...
|
||||
#endif
|
||||
TK_INFO("Binary name : " << binaryName);
|
||||
return binaryName;
|
||||
}
|
||||
|
||||
@ -298,10 +301,21 @@ void etk::InitDefaultFolder(const char * applName)
|
||||
|
||||
#ifndef __TARGET_OS__Android
|
||||
etk::UString binaryPath = GetApplicationPath();
|
||||
binaryPath.Replace('\\', '/');
|
||||
int32_t pos = binaryPath.FindBack('/');
|
||||
etk::UString binaryName = binaryPath.Extract(pos);
|
||||
binaryPath.Remove(pos, binaryName.Size());
|
||||
TK_VERBOSE("Bianry name : '" << binaryPath << "' && '" << binaryName << "'" );
|
||||
TK_INFO("Bianry name : '" << binaryPath << "' && '" << binaryName << "'" );
|
||||
#ifdef __TARGET_OS__Windows
|
||||
baseFolderData = binaryPath;
|
||||
baseFolderData += "/data/";
|
||||
|
||||
baseFolderDataUser = binaryPath;
|
||||
baseFolderDataUser += "/user/";
|
||||
|
||||
baseFolderCache = binaryPath;
|
||||
baseFolderCache += "/tmp/";
|
||||
#else
|
||||
// if element is installed :
|
||||
baseFolderData = "/usr/share";
|
||||
baseFolderData += binaryName;
|
||||
@ -332,6 +346,7 @@ void etk::InitDefaultFolder(const char * applName)
|
||||
baseFolderCache += binaryName;
|
||||
baseFolderCache += "/";
|
||||
#endif
|
||||
#endif
|
||||
TK_INFO("baseFolderHome : '" << baseFolderHome << "'");
|
||||
TK_INFO("baseFolderData : '" << baseFolderData << "'");
|
||||
TK_INFO("baseFolderDataUser : '" << baseFolderDataUser << "'");
|
||||
|
@ -51,6 +51,7 @@ def Create(target):
|
||||
myModule.AddExportFlag_CC("-DDEBUG_LEVEL=3")
|
||||
myModule.AddExportFlag_CC("-DDEBUG=1")
|
||||
# Bor backtrace display :
|
||||
if target.name!="Windows":
|
||||
myModule.AddExportflag_LD("-ldl -rdynamic")
|
||||
|
||||
if target.name=="Windows":
|
||||
|
Loading…
Reference in New Issue
Block a user