[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 { \
|
#define ETK_DBG_COMMON(libName, info, data) do { \
|
||||||
if (info <= g_requestedLevel) { \
|
if (info <= g_requestedLevel) { \
|
||||||
etk::cout << etk::cstart << info; \
|
etk::cout << etk::cstart << info; \
|
||||||
TOOLS_DisplayTime(); \
|
/*TOOLS_DisplayTime();*/ \
|
||||||
TOOLS_DisplayFuncName(__LINE__, __class__, __func__, libName); \
|
/*TOOLS_DisplayFuncName(__LINE__, __class__, __func__, libName);*/ \
|
||||||
etk::cout << data; \
|
etk::cout << data; \
|
||||||
etk::cout <<etk::endl; \
|
etk::cout <<etk::endl; \
|
||||||
} \
|
} \
|
||||||
|
@ -44,7 +44,9 @@
|
|||||||
#else
|
#else
|
||||||
void etk::DisplayBacktrace(void)
|
void etk::DisplayBacktrace(void)
|
||||||
{
|
{
|
||||||
|
#if DEBUG_LEVEL > 2
|
||||||
|
assert(false);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -267,7 +269,9 @@ etk::CCout& etk::CCout::operator << (CStart ccc)
|
|||||||
|
|
||||||
etk::CCout& etk::CCout::operator << (etk::CEndl t)
|
etk::CCout& etk::CCout::operator << (etk::CEndl t)
|
||||||
{
|
{
|
||||||
|
#if !defined(__TARGET_OS__Windows)
|
||||||
strncat(m_tmpChar, ETK_BASH_COLOR_NORMAL, MAX_LOG_SIZE);
|
strncat(m_tmpChar, ETK_BASH_COLOR_NORMAL, MAX_LOG_SIZE);
|
||||||
|
#endif
|
||||||
strncat(m_tmpChar, "\n", MAX_LOG_SIZE);
|
strncat(m_tmpChar, "\n", MAX_LOG_SIZE);
|
||||||
m_tmpChar[MAX_LOG_SIZE] = '\0';
|
m_tmpChar[MAX_LOG_SIZE] = '\0';
|
||||||
#if defined(__TARGET_OS__Android)
|
#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)
|
void etk::UString::Lower(void)
|
||||||
{
|
{
|
||||||
for( int32_t iii=0 ; iii<m_data.Size() ; iii++) {
|
for( int32_t iii=0 ; iii<m_data.Size() ; iii++) {
|
||||||
|
@ -154,6 +154,12 @@ namespace etk
|
|||||||
* @return The list of all sthe string splited.
|
* @return The list of all sthe string splited.
|
||||||
*/
|
*/
|
||||||
etk::Vector<etk::UString> Split(const etk::UniChar& _val);
|
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::Vector<etk::UniChar> GetVector(void);
|
||||||
etk::UniChar* pointer(void) { return &m_data[0]; };
|
etk::UniChar* pointer(void) { return &m_data[0]; };
|
||||||
|
@ -14,7 +14,9 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <etk/tool.h>
|
#include <etk/tool.h>
|
||||||
#include <etk/Vector.h>
|
#include <etk/Vector.h>
|
||||||
|
#ifdef __TARGET_OS__Windows
|
||||||
|
#include "windows.h"
|
||||||
|
#endif
|
||||||
extern "C" {
|
extern "C" {
|
||||||
// file browsing ...
|
// file browsing ...
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
@ -265,6 +267,7 @@ etk::UString GetApplicationPath(void)
|
|||||||
}
|
}
|
||||||
// and now we will really in a bad mood ...
|
// and now we will really in a bad mood ...
|
||||||
#endif
|
#endif
|
||||||
|
TK_INFO("Binary name : " << binaryName);
|
||||||
return binaryName;
|
return binaryName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,39 +301,51 @@ void etk::InitDefaultFolder(const char * applName)
|
|||||||
|
|
||||||
#ifndef __TARGET_OS__Android
|
#ifndef __TARGET_OS__Android
|
||||||
etk::UString binaryPath = GetApplicationPath();
|
etk::UString binaryPath = GetApplicationPath();
|
||||||
|
binaryPath.Replace('\\', '/');
|
||||||
int32_t pos = binaryPath.FindBack('/');
|
int32_t pos = binaryPath.FindBack('/');
|
||||||
etk::UString binaryName = binaryPath.Extract(pos);
|
etk::UString binaryName = binaryPath.Extract(pos);
|
||||||
binaryPath.Remove(pos, binaryName.Size());
|
binaryPath.Remove(pos, binaryName.Size());
|
||||||
TK_VERBOSE("Bianry name : '" << binaryPath << "' && '" << binaryName << "'" );
|
TK_INFO("Bianry name : '" << binaryPath << "' && '" << binaryName << "'" );
|
||||||
// if element is installed :
|
#ifdef __TARGET_OS__Windows
|
||||||
baseFolderData = "/usr/share";
|
|
||||||
baseFolderData += binaryName;
|
|
||||||
baseFolderData += "/";
|
|
||||||
|
|
||||||
etk::UString theoricInstalledName = "/usr/bin";
|
|
||||||
theoricInstalledName += binaryName;
|
|
||||||
TK_VERBOSE(" position : '" << binaryPath << "' installed position : '" << theoricInstalledName << "'");
|
|
||||||
if (binaryPath != theoricInstalledName) {
|
|
||||||
TK_INFO(" base path is not correct try to find it : (must only appear in test and not when installed) base name : '" << binaryPath << "'");
|
|
||||||
// remove bin/applName
|
|
||||||
baseFolderData = binaryPath;
|
baseFolderData = binaryPath;
|
||||||
#ifdef __TARGET_OS__MacOs
|
baseFolderData += "/data/";
|
||||||
baseFolderData += "/../../Resources/";
|
|
||||||
#else
|
baseFolderDataUser = binaryPath;
|
||||||
baseFolderData += "/../../share";
|
baseFolderDataUser += "/user/";
|
||||||
baseFolderData += binaryName;
|
|
||||||
baseFolderData += "/";
|
baseFolderCache = binaryPath;
|
||||||
#endif
|
baseFolderCache += "/tmp/";
|
||||||
baseFolderData = SimplifyPathAbstractPath(baseFolderData);
|
#else
|
||||||
}
|
// if element is installed :
|
||||||
baseFolderDataUser = baseFolderHome;
|
baseFolderData = "/usr/share";
|
||||||
baseFolderDataUser += "/.local/share/";
|
baseFolderData += binaryName;
|
||||||
baseFolderDataUser += binaryName;
|
baseFolderData += "/";
|
||||||
baseFolderDataUser += "/";
|
|
||||||
|
etk::UString theoricInstalledName = "/usr/bin";
|
||||||
baseFolderCache = "/tmp/";
|
theoricInstalledName += binaryName;
|
||||||
baseFolderCache += binaryName;
|
TK_VERBOSE(" position : '" << binaryPath << "' installed position : '" << theoricInstalledName << "'");
|
||||||
baseFolderCache += "/";
|
if (binaryPath != theoricInstalledName) {
|
||||||
|
TK_INFO(" base path is not correct try to find it : (must only appear in test and not when installed) base name : '" << binaryPath << "'");
|
||||||
|
// remove bin/applName
|
||||||
|
baseFolderData = binaryPath;
|
||||||
|
#ifdef __TARGET_OS__MacOs
|
||||||
|
baseFolderData += "/../../Resources/";
|
||||||
|
#else
|
||||||
|
baseFolderData += "/../../share";
|
||||||
|
baseFolderData += binaryName;
|
||||||
|
baseFolderData += "/";
|
||||||
|
#endif
|
||||||
|
baseFolderData = SimplifyPathAbstractPath(baseFolderData);
|
||||||
|
}
|
||||||
|
baseFolderDataUser = baseFolderHome;
|
||||||
|
baseFolderDataUser += "/.local/share/";
|
||||||
|
baseFolderDataUser += binaryName;
|
||||||
|
baseFolderDataUser += "/";
|
||||||
|
|
||||||
|
baseFolderCache = "/tmp/";
|
||||||
|
baseFolderCache += binaryName;
|
||||||
|
baseFolderCache += "/";
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
TK_INFO("baseFolderHome : '" << baseFolderHome << "'");
|
TK_INFO("baseFolderHome : '" << baseFolderHome << "'");
|
||||||
TK_INFO("baseFolderData : '" << baseFolderData << "'");
|
TK_INFO("baseFolderData : '" << baseFolderData << "'");
|
||||||
|
@ -51,7 +51,8 @@ def Create(target):
|
|||||||
myModule.AddExportFlag_CC("-DDEBUG_LEVEL=3")
|
myModule.AddExportFlag_CC("-DDEBUG_LEVEL=3")
|
||||||
myModule.AddExportFlag_CC("-DDEBUG=1")
|
myModule.AddExportFlag_CC("-DDEBUG=1")
|
||||||
# Bor backtrace display :
|
# Bor backtrace display :
|
||||||
myModule.AddExportflag_LD("-ldl -rdynamic")
|
if target.name!="Windows":
|
||||||
|
myModule.AddExportflag_LD("-ldl -rdynamic")
|
||||||
|
|
||||||
if target.name=="Windows":
|
if target.name=="Windows":
|
||||||
None
|
None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user