[DEV] add autobinding of CPP11 and Boost for CPP03

This commit is contained in:
Edouard DUPIN 2015-02-25 22:05:00 +01:00
parent ea899a1ed1
commit 025b59a8c7
25 changed files with 182 additions and 176 deletions

1
binding_X11/etk/chrono.h Normal file
View File

@ -0,0 +1 @@
#include <chrono>

View File

@ -0,0 +1 @@
#include <condition_variable>

View File

@ -0,0 +1 @@
#include <functional>

1
binding_X11/etk/memory.h Normal file
View File

@ -0,0 +1 @@
#include <memory>

2
binding_X11/etk/mutex.h Normal file
View File

@ -0,0 +1,2 @@
#include <mutex>

1
binding_X11/etk/thread.h Normal file
View File

@ -0,0 +1 @@
#include <thread>

View File

@ -8,12 +8,8 @@
#include <etk/log.h>
#include <time.h>
#if __cplusplus >= 201103L
#include <mutex>
#include <thread>
#else
#include <etk/mutex.h>
#endif
#include <etk/mutex.h>
#include <etk/thread.h>
#include <map>
#include <inttypes.h>
@ -228,7 +224,7 @@ static std::map<uint32_t, std::string>& getThreadList() {
}
std::string etk::log::getThreadName() {
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::map<uint32_t,std::string>& list = getThreadList();
uint32_t threadID = getThreadID();
std::string out;
@ -246,11 +242,11 @@ std::string etk::log::getThreadName() {
}
void etk::log::setThreadName(const std::string& _name) {
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::map<uint32_t,std::string>& list = getThreadList();
uint32_t threadID = getThreadID();
static std11::mutex g_lock;
g_lock.lock();-Wc++0x-compat
g_lock.lock();
auto it = list.find(threadID);
if (it == list.end()) {
list.insert(std::pair<uint32_t, std::string>(threadID,_name));
@ -262,7 +258,7 @@ void etk::log::setThreadName(const std::string& _name) {
}
uint32_t etk::log::getThreadID() {
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
uint32_t out = 0;
std::thread::id this_id = std::this_thread::get_id();
uint64_t iddd = std::hash<std::thread::id>()(this_id);
@ -407,7 +403,7 @@ void etk::log::logChar(int32_t _id, int32_t _level, int32_t _ligne, const char*
*pointer++ = ' ';
*pointer = '\0';
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
if(getThreadId() == true) {
// display thread ID
uint32_t iddd = etk::log::getThreadID();

View File

@ -118,7 +118,7 @@ namespace etk {
str += ")";
return str;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> Vector2D<bool>::operator std::u32string() const {
std::u32string str;
str = U"(";
@ -154,7 +154,7 @@ namespace etk {
}
TK_VERBOSE("Parse : '" << _str << "' ==> " << *this);
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> Vector2D<bool>::Vector2D(const std::u32string& _str) {
m_floats[0] = false;
m_floats[1] = false;
@ -190,7 +190,7 @@ namespace etk {
str += ")";
return str;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> Vector2D<int32_t>::operator std::u32string() const {
std::u32string str;
str = U"(";
@ -227,7 +227,7 @@ namespace etk {
}
TK_VERBOSE("Parse : \"" << _str << "\" ==> " << *this);
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> Vector2D<int32_t>::Vector2D(const std::u32string& _str) {
m_floats[0] = 0;
m_floats[1] = 0;
@ -264,7 +264,7 @@ namespace etk {
str += ")";
return str;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> Vector2D<uint32_t>::operator std::u32string() const {
std::u32string str;
str = U"(";
@ -300,7 +300,7 @@ namespace etk {
}
TK_VERBOSE("Parse : \"" << _str << "\" ==> " << *this);
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> Vector2D<uint32_t>::Vector2D(const std::u32string& _str) {
m_floats[0] = 0;
m_floats[1] = 0;
@ -336,7 +336,7 @@ namespace etk {
str += ")";
return str;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> Vector2D<float>::operator std::u32string() const {
std::u32string str;
str = U"(";
@ -372,7 +372,7 @@ namespace etk {
}
TK_VERBOSE("Parse : \"" << _str << "\" ==> " << *this);
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> Vector2D<float>::Vector2D(const std::u32string& _str) {
m_floats[0] = 0;
m_floats[1] = 0;
@ -408,7 +408,7 @@ namespace etk {
str += ")";
return str;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> std::u32string to_u32string<vec2>(const vec2& _obj) {
return etk::to_u32string(etk::to_string(_obj));
}
@ -423,7 +423,7 @@ namespace etk {
str += ")";
return str;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> std::u32string to_u32string<ivec2>(const ivec2& _obj) {
return etk::to_u32string(etk::to_string(_obj));
}
@ -438,7 +438,7 @@ namespace etk {
str += ")";
return str;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> std::u32string to_u32string<uivec2>(const uivec2& _obj) {
return etk::to_u32string(etk::to_string(_obj));
}
@ -453,7 +453,7 @@ namespace etk {
str += ")";
return str;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> std::u32string to_u32string<bvec2>(const bvec2& _obj) {
return etk::to_u32string(etk::to_string(_obj));
}
@ -463,7 +463,7 @@ namespace etk {
_variableRet = vec2(_value);
return true;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> bool from_string<vec2>(vec2& _variableRet, const std::u32string& _value) {
return from_string(_variableRet, etk::to_string(_value));
}
@ -473,7 +473,7 @@ namespace etk {
_variableRet = ivec2(_value);
return true;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> bool from_string<ivec2>(ivec2& _variableRet, const std::u32string& _value) {
return from_string(_variableRet, etk::to_string(_value));
}
@ -483,7 +483,7 @@ namespace etk {
_variableRet = uivec2(_value);
return true;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> bool from_string<uivec2>(uivec2& _variableRet, const std::u32string& _value) {
return from_string(_variableRet, etk::to_string(_value));
}
@ -493,7 +493,7 @@ namespace etk {
_variableRet = bvec2(_value);
return true;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> bool from_string<bvec2>(bvec2& _variableRet, const std::u32string& _value) {
return from_string(_variableRet, etk::to_string(_value));
}

View File

@ -48,7 +48,7 @@ namespace etk {
m_floats[1] = (T)_obj.y();
};
Vector2D(const std::string& _str);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
Vector2D(const std::u32string& _str);
#endif
~Vector2D() { };
@ -373,7 +373,7 @@ namespace etk {
}
//!< string cast :
operator std::string() const;
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
operator std::u32string() const;
#endif
};

View File

@ -124,7 +124,7 @@ namespace etk {
str += ")";
return str;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> std::u32string to_u32string<vec3>(const vec3& _obj) {
return etk::to_u32string(etk::to_string(_obj));
}
@ -141,7 +141,7 @@ namespace etk {
str += ")";
return str;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> std::u32string to_u32string<ivec3>(const ivec3& _obj) {
return etk::to_u32string(etk::to_string(_obj));
}
@ -158,7 +158,7 @@ namespace etk {
str += ")";
return str;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> std::u32string to_u32string<uivec3>(const uivec3& _obj) {
return etk::to_u32string(etk::to_string(_obj));
}
@ -175,7 +175,7 @@ namespace etk {
str += ")";
return str;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> std::u32string to_u32string<bvec3>(const bvec3& _obj) {
return etk::to_u32string(etk::to_string(_obj));
}
@ -220,7 +220,7 @@ namespace etk {
TK_VERBOSE("Parse : '" << _value << "' ==> " << _variableRet);
return true;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> bool from_string<vec3>(vec3& _variableRet, const std::u32string& _value) {
return from_string(_variableRet, etk::to_string(_value));
}
@ -265,7 +265,7 @@ namespace etk {
TK_VERBOSE("Parse : '" << _value << "' ==> " << _variableRet);
return true;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> bool from_string<ivec3>(ivec3& _variableRet, const std::u32string& _value) {
return from_string(_variableRet, etk::to_string(_value));
}
@ -310,7 +310,7 @@ namespace etk {
TK_VERBOSE("Parse : '" << _value << "' ==> " << _variableRet);
return true;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> bool from_string<uivec3>(uivec3& _variableRet, const std::u32string& _value) {
return from_string(_variableRet, etk::to_string(_value));
}
@ -355,7 +355,7 @@ namespace etk {
TK_VERBOSE("Parse : '" << _value << "' ==> " << _variableRet);
return true;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> bool from_string<bvec3>(bvec3& _variableRet, const std::u32string& _value) {
return from_string(_variableRet, etk::to_string(_value));
}

View File

@ -159,7 +159,7 @@ namespace etk {
#ifdef ETK_BUILD_LINEARMATH
return btSqrt(length2());
#else
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
return std::sqrt(length2());
#else
return sqrt(length2());

View File

@ -276,7 +276,7 @@ std::string getApplicationPath() {
TK_INFO("Binary name : " << binaryName);
return binaryName;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string getUApplicationPath() {
return etk::to_u32string(getApplicationPath());
}
@ -390,7 +390,7 @@ void etk::initDefaultFolder(const char* _applName) {
std::string etk::getUserHomeFolder() {
return baseFolderHome;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string etk::getUUserHomeFolder() {
return etk::to_u32string(baseFolderHome);
}
@ -399,7 +399,7 @@ std::string etk::getUserHomeFolder() {
std::string etk::getUserRunFolder() {
return baseRunPath;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string etk::getUUserRunFolder() {
return etk::to_u32string(baseRunPath);
}
@ -490,7 +490,7 @@ etk::FSNode::FSNode(const std::string& _nodeName) :
{
privateSetName(_nodeName);
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
etk::FSNode::FSNode(const std::u32string& _nodeName) :
m_userFileName(""),
m_type(etk::FSN_TYPE_UNKNOW),
@ -709,7 +709,7 @@ void etk::FSNode::privateSetName(const std::string& _newName) {
updateFileSystemProperty();
TK_DBG_MODE("6 : type : [" << m_typeNode << "] right :" << m_rights);
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
void etk::FSNode::privateSetName(const std::u32string& _newName) {
privateSetName(etk::to_string(_newName));
}
@ -732,7 +732,7 @@ bool directCheckFile(std::string _tmpFileNameDirect, bool _checkInAPKIfNeeded =
}
return true;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
bool directCheckFile(std::u32string _tmpFileNameDirect, bool _checkInAPKIfNeeded = false) {
return directCheckFile(etk::to_string(_tmpFileNameDirect));
}
@ -927,7 +927,7 @@ bool etk::FSNode::setRight(etk::FSNodeRight _newRight) {
void etk::FSNode::setName(const std::string& _newName) {
privateSetName(_newName);
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
void etk::FSNode::setName(const std::u32string& _newName) {
privateSetName(_newName);
}
@ -940,7 +940,7 @@ std::string etk::FSNode::getNameFolder() const {
}
return "";
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string etk::FSNode::getUNameFolder() const {
return etk::to_u32string(getNameFolder());
}
@ -949,7 +949,7 @@ std::string etk::FSNode::getNameFolder() const {
std::string etk::FSNode::getFileSystemName() const {
return m_systemFileName;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string etk::FSNode::getUFileSystemName() const {
return etk::to_u32string(getFileSystemName());
}
@ -988,7 +988,7 @@ std::string etk::FSNode::getName() const {
output += m_userFileName;
return output;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string etk::FSNode::getUName() const {
return etk::to_u32string(getName());
}
@ -1001,7 +1001,7 @@ std::string etk::FSNode::getNameFile() const {
}
return "";
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string etk::FSNode::getUNameFile() const {
return etk::to_u32string(getNameFile());
}
@ -1045,7 +1045,7 @@ std::string etk::FSNode::getRelativeFolder() const {
TK_DBG_MODE(" ==> : ''" );
return "";
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string etk::FSNode::getURelativeFolder() const {
return etk::to_u32string(getRelativeFolder());
}
@ -1077,7 +1077,7 @@ bool etk::FSNode::move(const std::string& _path) {
return true;
}
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
bool etk::FSNode::move(const std::u32string& _path) {
return move(etk::to_string(_path));
}
@ -1114,7 +1114,7 @@ std::string etk::FSNode::timeCreatedString() const {
}
return tmpTime;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string etk::FSNode::timeUCreatedString() const {
return etk::to_u32string(timeCreatedString());
}
@ -1132,7 +1132,7 @@ std::string etk::FSNode::timeModifiedString() const {
}
return tmpTime;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string etk::FSNode::timeUModifiedString() const {
return etk::to_u32string(timeModifiedString());
}
@ -1150,7 +1150,7 @@ std::string etk::FSNode::timeAccessedString() const {
}
return tmpTime;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string etk::FSNode::timeUAccessedString() const {
return etk::to_u32string(timeAccessedString());
}
@ -1468,7 +1468,7 @@ void etk::FSNode::folderGetRecursiveFiles(std::vector<std::string>& _output, boo
}
return;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
void etk::FSNode::folderGetRecursiveFiles(std::vector<std::u32string>& _output, bool _recursiveEnable) {
_output.clear();
std::vector<std::string> tmpVal;
@ -1501,7 +1501,7 @@ std::string etk::FSNode::fileGetExtention() {
}
return "";
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string etk::FSNode::fileUGetExtention() {
return etk::to_u32string(fileGetExtention());
}
@ -1858,7 +1858,7 @@ static std::map<std::string, std::string> g_listTheme;
void etk::theme::setName(const std::string& _refName, const std::string& _folderName) {
TK_WARNING("Change theme : '" << _refName << "' : '" << _folderName << "'");
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
auto it = g_listTheme.find(_refName);
#else
std::map<std::string, std::string>::iterator it = g_listTheme.find(_refName);
@ -1869,14 +1869,14 @@ void etk::theme::setName(const std::string& _refName, const std::string& _folder
}
g_listTheme.insert(std::pair<std::string,std::string>(_refName, _folderName));
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
void etk::theme::setName(const std::u32string& _refName, const std::u32string& _folderName) {
setName(etk::to_string(_refName), etk::to_string(_folderName));
}
#endif
std::string etk::theme::getName(const std::string& _refName) {
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
auto it = g_listTheme.find(_refName);
#else
std::map<std::string, std::string>::iterator it = g_listTheme.find(_refName);
@ -1886,7 +1886,7 @@ std::string etk::theme::getName(const std::string& _refName) {
}
return _refName;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string etk::theme::getName(const std::u32string& _refName) {
return etk::to_u32string(getName(etk::to_string(_refName)));
}
@ -1895,7 +1895,7 @@ std::string etk::theme::getName(const std::string& _refName) {
// get the list of all the theme folder availlable in the user Home/appl
std::vector<std::string> etk::theme::list() {
std::vector<std::string> keys;
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
for (auto &it : g_listTheme) {
keys.push_back(it.first);
}
@ -1906,7 +1906,7 @@ std::vector<std::string> etk::theme::list() {
#endif
return keys;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::vector<std::u32string> etk::theme::listU() {
std::vector<std::u32string> keys;
for (auto &it : g_listTheme) {
@ -1918,7 +1918,7 @@ std::vector<std::string> etk::theme::list() {
static std::map<std::string, std::string> g_listThemeDefault;
void etk::theme::setNameDefault(const std::string& _refName, const std::string& _folderName) {
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
auto it = g_listThemeDefault.find(_refName);
#else
std::map<std::string, std::string>::iterator it = g_listThemeDefault.find(_refName);
@ -1929,14 +1929,14 @@ void etk::theme::setNameDefault(const std::string& _refName, const std::string&
}
g_listThemeDefault.insert(std::pair<std::string,std::string>(_refName, _folderName));
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
void etk::theme::setNameDefault(const std::u32string& _refName, const std::u32string& _folderName) {
setNameDefault(etk::to_string(_refName), etk::to_string(_folderName));
}
#endif
std::string etk::theme::getNameDefault(const std::string& _refName) {
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
auto it=g_listThemeDefault.find(_refName);
#else
std::map<std::string, std::string>::iterator it = g_listThemeDefault.find(_refName);
@ -1946,7 +1946,7 @@ std::string etk::theme::getNameDefault(const std::string& _refName) {
}
return "default";
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string etk::theme::getNameDefault(const std::u32string& _refName) {
return etk::to_u32string(getNameDefault(etk::to_string(_refName)));
}
@ -1966,7 +1966,7 @@ bool etk::FSNodeRemove(const std::string& _path) {
}
return tmpNode.remove();
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
bool etk::FSNodeRemove(const std::u32string& _path) {
return FSNodeRemove(etk::to_string(_path));
}
@ -1979,7 +1979,7 @@ int64_t etk::FSNodeGetCount(const std::string& _path) {
}
return tmpNode.folderCount();
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
int64_t etk::FSNodeGetCount(const std::u32string& _path) {
return FSNodeGetCount(etk::to_string(_path));
}
@ -1989,7 +1989,7 @@ bool etk::FSNodeCreate(const std::string& _path, etk::FSNodeRight _right, enum e
// TODO :
return false;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
bool etk::FSNodeCreate(const std::u32string& _path, etk::FSNodeRight _right, enum etk::typeNode _type) {
return FSNodeCreate(etk::to_string(_path), _right, _type);
}
@ -1999,7 +1999,7 @@ bool etk::FSNodeExist(const std::string& _path) {
etk::FSNode tmpNode(_path);
return tmpNode.exist();
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
bool etk::FSNodeExist(const std::u32string& _path) {
return FSNodeExist(etk::to_string(_path));
}
@ -2016,7 +2016,7 @@ bool etk::FSNodeMove(const std::string& _path1, const std::string& _path2) {
//move the node
return tmpNode.move(_path2);
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
bool etk::FSNodeMove(const std::u32string& _path1, const std::u32string& _path2) {
return FSNodeMove(etk::to_string(_path1), etk::to_string(_path2));
}
@ -2026,7 +2026,7 @@ etk::FSNodeRight etk::FSNodeGetRight(const std::string& _path) {
etk::FSNode tmpNode(_path);
return tmpNode.getRight();
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
etk::FSNodeRight etk::FSNodeGetRight(const std::u32string& _path) {
return FSNodeGetRight(etk::to_string(_path));
}
@ -2036,7 +2036,7 @@ enum etk::typeNode etk::FSNodeGetType(const std::string& _path) {
etk::FSNode tmpNode(_path);
return tmpNode.getNodeType();
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
enum etk::typeNode etk::FSNodeGetType(const std::u32string& _path) {
return FSNodeGetType(etk::to_string(_path));
}
@ -2046,7 +2046,7 @@ uint64_t etk::FSNodeGetTimeCreated(const std::string& _path) {
etk::FSNode tmpNode(_path);
return tmpNode.timeCreated();
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
uint64_t etk::FSNodeGetTimeCreated(const std::u32string& _path) {
return FSNodeGetTimeCreated(etk::to_string(_path));
}
@ -2056,7 +2056,7 @@ uint64_t etk::FSNodeGetTimeModified(const std::string& _path) {
etk::FSNode tmpNode(_path);
return tmpNode.timeModified();
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
uint64_t etk::FSNodeGetTimeModified(const std::u32string& _path) {
return FSNodeGetTimeModified(etk::to_string(_path));
}
@ -2066,7 +2066,7 @@ uint64_t etk::FSNodeGetTimeAccessed(const std::string& _path) {
etk::FSNode tmpNode(_path);
return tmpNode.timeAccessed();
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
uint64_t etk::FSNodeGetTimeAccessed(const std::u32string& _path) {
return FSNodeGetTimeAccessed(etk::to_string(_path));
}
@ -2076,7 +2076,7 @@ bool etk::FSNodeTouch(const std::string& _path) {
etk::FSNode tmpNode(_path);
return tmpNode.touch();
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
bool etk::FSNodeTouch(const std::u32string& _path) {
return FSNodeTouch(etk::to_string(_path));
}
@ -2100,7 +2100,7 @@ bool etk::FSNodeEcho(const std::string& _path, const std::string& _dataTowrite)
}
return tmpNode.fileClose();
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
bool etk::FSNodeEcho(const std::u32string& _path, const std::u32string& _dataTowrite) {
return FSNodeEcho(etk::to_string(_path), etk::to_string(_dataTowrite));
}
@ -2124,7 +2124,7 @@ bool etk::FSNodeEchoAdd(const std::string& _path, const std::string& _dataTowrit
}
return tmpNode.fileClose();
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
bool etk::FSNodeEchoAdd(const std::u32string& _path, const std::u32string& _dataTowrite) {
return FSNodeEchoAdd(etk::to_string(_path), etk::to_string(_dataTowrite));
}
@ -2142,7 +2142,7 @@ void etk::FSNodeHistory(const std::string& _path, int32_t _historyCount) {
etk::FSNodeMove(_path, _path + "-1");
}
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
void etk::FSNodeHistory(const std::u32string& _path, int32_t _historyCount) {
return FSNodeHistory(etk::to_string(_path), _historyCount);
}

View File

@ -141,7 +141,7 @@ namespace etk {
* @param[in] _path Path of the curent file /folder ...
*/
FSNode(const std::string& _path = "~");
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
FSNode(const std::u32string& _path);
#endif
/**
@ -163,7 +163,7 @@ namespace etk {
* @param[in] _newName Name of the Node
*/
void privateSetName(const std::string& _newName);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
void privateSetName(const std::u32string& _newName);
#endif
private:
@ -214,7 +214,7 @@ namespace etk {
* @return false : action not done
*/
void setName(const std::string& _newName);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
void setName(const std::u32string& _newName);
#endif
/**
@ -222,7 +222,7 @@ namespace etk {
* @return the requested filename
*/
std::string getFileSystemName() const;
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string getUFileSystemName() const;
#endif
/**
@ -231,7 +231,7 @@ namespace etk {
* @note Auto remove of ../../../ and //
*/
std::string getNameFolder() const;
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string getUNameFolder() const;
#endif
/**
@ -240,7 +240,7 @@ namespace etk {
* @note Auto remove of ../../../ and //
*/
std::string getName() const;
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string getUName() const;
#endif
/**
@ -248,7 +248,7 @@ namespace etk {
* @return the name of the node (like myFile.kkk)
*/
std::string getNameFile() const;
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string getUNameFile() const;
#endif
/**
@ -257,7 +257,7 @@ namespace etk {
* @note Auto remove of ../../../ and //
*/
std::string getRelativeFolder() const;
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string getURelativeFolder() const;
#endif
/**
@ -273,7 +273,7 @@ namespace etk {
* @return false : action not done
*/
bool move(const std::string& _path);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
bool move(const std::u32string& _path);
#endif
/**
@ -299,7 +299,7 @@ namespace etk {
* @return The time requested (in string)
*/
std::string timeCreatedString() const;
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string timeUCreatedString() const;
#endif
/**
@ -312,7 +312,7 @@ namespace etk {
* @return The time requested (in string)
*/
std::string timeModifiedString() const;
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string timeUModifiedString() const;
#endif
/**
@ -325,7 +325,7 @@ namespace etk {
* @return The time requested (in string)
*/
std::string timeAccessedString() const;
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string timeUAccessedString() const;
#endif
/**
@ -383,7 +383,7 @@ namespace etk {
* @param[in] _recursiveEnable Activate the recursive mode (enable by default)
*/
void folderGetRecursiveFiles(std::vector<std::string>& _output, bool _recursiveEnable=true);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
void folderGetRecursiveFiles(std::vector<std::u32string>& _output, bool _recursiveEnable=true);
#endif
/**
@ -397,7 +397,7 @@ namespace etk {
* @return the requested extention
*/
std::string fileGetExtention();
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string fileUGetExtention();
#endif
/**
@ -524,7 +524,7 @@ namespace etk {
fileRead(&value[0], sizeof(char), fileSize()/sizeof(char));
return value;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string fileReadAllU32String() {
return utf8::convertUnicode(fileReadAllString());
}
@ -538,7 +538,7 @@ namespace etk {
void fileWriteAll(const std::string& _value) {
fileWrite(static_cast<const void*>(&(_value[0])), sizeof(char), _value.size()/sizeof(char));
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
void fileWriteAll(const std::u32string& _value) {
fileWriteAll(u32char::convertToUtf8(_value));
}
@ -578,7 +578,7 @@ namespace etk {
* @return the home folder : like : "/home/machin/"
*/
std::string getUserHomeFolder();
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string getUUserHomeFolder();
#endif
/**
@ -586,7 +586,7 @@ namespace etk {
* @return the basic folder name (ex : run ./appl in the pwd=/home/machin/sousFolder ==> this return the pwd folder)
*/
std::string getUserRunFolder();
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string getUUserRunFolder();
#endif
@ -598,7 +598,7 @@ namespace etk {
* @param[in] _folderName The associated folder of the Theme (like "myTheme/folder/folder2/")
*/
void setName(const std::string& _refName, const std::string& _folderName);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
//! @previous
void setName(const std::u32string& _refName, const std::u32string& _folderName);
#endif
@ -608,7 +608,7 @@ namespace etk {
* @return the path of the theme
*/
std::string getName(const std::string& _refName);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
//! @previous
std::u32string getName(const std::u32string& _refName);
#endif
@ -618,7 +618,7 @@ namespace etk {
* @param[in] _folderName The associated default folder of the Theme (like "myTheme/color/default/")
*/
void setNameDefault(const std::string& _refName, const std::string& _folderName);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
//! @previous
void setNameDefault(const std::u32string& _refName, const std::u32string& _folderName);
#endif
@ -628,7 +628,7 @@ namespace etk {
* @return the path of the theme
*/
std::string getNameDefault(const std::string& _refName);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
//! @previous
std::u32string getNameDefault(const std::u32string& _refName);
#endif
@ -637,7 +637,7 @@ namespace etk {
* @return The list of elements
*/
std::vector<std::string> list();
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
//! @previous
std::vector<std::u32string> listU();
#endif
@ -650,7 +650,7 @@ namespace etk {
* @return false : An error occured
*/
bool FSNodeRemove(const std::string& _path);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
bool FSNodeRemove(const std::u32string& _path);
#endif
/**
@ -660,7 +660,7 @@ namespace etk {
* @return -1 : An error occured
*/
int64_t FSNodeGetCount(const std::string& _path);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
int64_t FSNodeGetCount(const std::u32string& _path);
#endif
/**
@ -672,7 +672,7 @@ namespace etk {
* @return false : An error occured
*/
bool FSNodeCreate(const std::string& _path, etk::FSNodeRight _right, enum etk::typeNode _type=etk::FSN_FOLDER);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
bool FSNodeCreate(const std::u32string& _path, etk::FSNodeRight _right, enum etk::typeNode _type=etk::FSN_FOLDER);
#endif
/**
@ -682,7 +682,7 @@ namespace etk {
* @return false : An error occured
*/
bool FSNodeExist(const std::string& _path);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
bool FSNodeExist(const std::u32string& _path);
#endif
/**
@ -693,7 +693,7 @@ namespace etk {
* @return false : An error occured
*/
bool FSNodeMove(const std::string& _path1, const std::string& _path2);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
bool FSNodeMove(const std::u32string& _path1, const std::u32string& _path2);
#endif
/**
@ -703,7 +703,7 @@ namespace etk {
* @return false : An error occured
*/
etk::FSNodeRight FSNodeGetRight(const std::string& _path);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
etk::FSNodeRight FSNodeGetRight(const std::u32string& _path);
#endif
/**
@ -713,7 +713,7 @@ namespace etk {
* @return false : An error occured
*/
enum etk::typeNode FSNodeGetType(const std::string& _path);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
enum etk::typeNode FSNodeGetType(const std::u32string& _path);
#endif
/**
@ -723,7 +723,7 @@ namespace etk {
* @return false : An error occured
*/
uint64_t FSNodeGetTimeCreated(const std::string& _path);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
uint64_t FSNodeGetTimeCreated(const std::u32string& _path);
#endif
/**
@ -733,7 +733,7 @@ namespace etk {
* @return false : An error occured
*/
uint64_t FSNodeGetTimeModified(const std::string& _path);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
uint64_t FSNodeGetTimeModified(const std::u32string& _path);
#endif
/**
@ -743,7 +743,7 @@ namespace etk {
* @return false : An error occured
*/
uint64_t FSNodeGetTimeAccessed(const std::string& _path);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
uint64_t FSNodeGetTimeAccessed(const std::u32string& _path);
#endif
/**
@ -753,7 +753,7 @@ namespace etk {
* @return false : An error occured
*/
bool FSNodeTouch(const std::string& _path);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
bool FSNodeTouch(const std::u32string& _path);
#endif
/**
@ -764,7 +764,7 @@ namespace etk {
* @return false : An error occured
*/
bool FSNodeEcho(const std::string& _path, const std::string& _dataTowrite);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
bool FSNodeEcho(const std::u32string& _path, const std::u32string& _dataTowrite);
#endif
/**
@ -775,7 +775,7 @@ namespace etk {
* @return false : An error occured
*/
bool FSNodeEchoAdd(const std::string& _path, const std::string& _dataTowrite);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
bool FSNodeEchoAdd(const std::u32string& _path, const std::u32string& _dataTowrite);
#endif
/**
@ -784,7 +784,7 @@ namespace etk {
* @param[in] _historyCount number of saved file in the history (-xxx)
*/
void FSNodeHistory(const std::string& _path, int32_t _historyCount);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
void FSNodeHistory(const std::u32string& _path, int32_t _historyCount);
#endif
/**

View File

@ -174,7 +174,7 @@ void etk::FSNodeRight::setOtherRunable(bool _newStatus)
m_rights |= RIGHT_OTHER_EXECUTE;
}
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string etk::FSNodeRight::getURight() const {
return etk::to_u32string(getRight());
}

View File

@ -48,7 +48,7 @@ namespace etk {
void setOtherReadable(bool _newStatus);
void setOtherWritable(bool _newStatus);
void setOtherRunable(bool _newStatus);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string getURight() const;
#endif
std::string getRight() const;

View File

@ -130,7 +130,7 @@ int8_t u32char::convertUtf8(char32_t _val, char _output[5]) {
return 4;
}
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::string u32char::convertToUtf8(const std::u32string& _input) {
TK_TODO("implement this function ...");
return "TODO ... std::string u32char::convertToUtf8(const std::u32string& _input)";
@ -231,7 +231,7 @@ bool utf8::theoricFirst(const char _input) {
}
return false;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string utf8::convertUnicode(const std::string& _input) {
TK_TODO("implement this function ...");
return U"TODO ... std::u32string utf8::convertUnicode(const std::string& _input)";
@ -312,7 +312,7 @@ char32_t utf8::iterator::operator* () {
#undef __class__
#define __class__ "etk"
namespace etk {
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> std::string to_string<std::u32string>(const std::u32string& _input) {
std::string out;
for (size_t iii=0; iii<_input.size(); ++iii) {
@ -418,7 +418,7 @@ namespace etk {
}
};
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
static std::u32string transform_to_u32string(const char* _input) {
if (_input == NULL) {
return U"";
@ -471,7 +471,7 @@ namespace etk {
return out;
}
#endif
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
namespace etk {
template<> std::u32string to_u32string<char*>(char* const & _input) {
return transform_to_u32string(_input);
@ -569,7 +569,7 @@ bool etk::string_to_bool(const std::string& _str) {
if( true == compare_no_case(_str, "true")
|| true == compare_no_case(_str, "enable")
|| true == compare_no_case(_str, "yes")
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
|| _str == u8"1"
#else
|| _str == "1"
@ -579,7 +579,7 @@ bool etk::string_to_bool(const std::string& _str) {
}
return false;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
bool etk::compare_no_case(const std::u32string& _obj, const std::u32string& _val) {
if (_val.size() != _obj.size()) {
return false;
@ -610,7 +610,7 @@ struct doublette {
char32_t upper;
};
struct doublette convertionTable[] = {
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
{U'ç', U'Ç'},
{U'á', U'Á'}, {U'à', U'À'}, {U'ä', U'Ä'}, {U'â', U'Â'}, {U'å', U'Å'}, {U'ã', U'Ã'},
@ -666,7 +666,7 @@ std::string etk::tolower(std::string _obj) {
}
return _obj;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string etk::tolower(std::u32string _obj) {
for(size_t iii=0 ; iii<_obj.size() ; iii++) {
_obj[iii] = localToLower(_obj[iii]);
@ -681,7 +681,7 @@ std::string etk::toupper(std::string _obj) {
}
return _obj;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string etk::toupper(std::u32string _obj) {
for(size_t iii=0 ; iii<_obj.size() ; iii++) {
_obj[iii] = localToUpper(_obj[iii]);
@ -716,7 +716,7 @@ bool etk::end_with(const std::string& _obj, const std::string& _val, bool _caseS
}
return true;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
bool etk::end_with(const std::u32string& _obj, const std::u32string& _val, bool _caseSensitive) {
if (_val.size() == 0) {
return false;
@ -771,7 +771,7 @@ bool etk::start_with(const std::string& _obj, const std::string& _val, bool _cas
}
return true;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
bool etk::start_with(const std::u32string& _obj, const std::u32string& _val, bool _caseSensitive) {
if (_val.size() == 0) {
return false;
@ -852,7 +852,7 @@ std::string etk::extract_line(const std::string& _obj, int32_t _pos) {
}
return std::string(_obj, startPos, stopPos - startPos);
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string etk::extract_line(const std::u32string& _obj, int32_t _pos) {
// search back : '\n'
size_t startPos = _obj.rfind('\n', _pos);
@ -898,7 +898,7 @@ std::vector<std::string> etk::split(const std::string& _input, char _val) {
return list;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::vector<std::u32string> etk::split(const std::u32string& _input, char32_t _val) {
std::vector<std::u32string> list;
size_t lastStartPos = 0;
@ -1003,7 +1003,7 @@ void etk::sort(std::vector<std::string *> &_list) {
_list.insert(_list.begin()+findPos, tmpList[iii]);
}
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
void etk::sort(std::vector<std::u32string *> &_list) {
std::vector<std::u32string *> tmpList(_list);
_list.clear();
@ -1022,7 +1022,7 @@ void etk::sort(std::vector<std::string *> &_list) {
#endif
namespace etk {
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> bool from_string<std::u32string>(std::u32string& _variableRet, const std::string& _value) {
_variableRet = etk::to_u32string(_value);
return true;
@ -1080,7 +1080,7 @@ namespace etk {
_variableRet = string_to_bool(_value);
return true;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template<> bool from_string<int8_t>(int8_t& _variableRet, const std::u32string& _value) {
_variableRet = string_to_int8_t(_value);
return true;
@ -1149,7 +1149,7 @@ std::ostream& std::operator <<(std::ostream& _os, const std::vector<std::string>
_os << "}";
return _os;
}
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::ostream& std::operator <<(std::ostream& _os, const std::u32string& _obj) {
_os << etk::to_string(_obj).c_str();
return _os;

View File

@ -41,7 +41,7 @@ namespace u32char {
char32_t changeOrder(char32_t _val);
int8_t convertUtf8(char32_t _val, char _output[5]);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::string convertToUtf8(const std::u32string& _input);
#endif
};
@ -61,7 +61,7 @@ namespace utf8 {
bool theoricFirst(const char _input);
char32_t convertChar32(const char* _input);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::u32string convertUnicode(const std::string& _input);
#endif
class iterator {
@ -387,127 +387,127 @@ namespace std {
namespace etk {
// these declaration is to prevent some under template declaration of unknown type
template <class TYPE> std::string to_string(const TYPE& _variable);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template <class TYPE> std::u32string to_u32string(const TYPE& _variable);
#endif
// these declaration is to prevent some under template declaration of unknown type
template <class TYPE> bool from_string(TYPE& _variableRet, const std::string& _value);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
template <class TYPE> bool from_string(TYPE& _variableRet, const std::u32string& _value);
#endif
// TODO : Change this in :
// TODO : template <typename TYPE> TYPE string_to<TYPE>(const std::u32string& _value); ==> check exceptions ...
long double string_to_long_double(const std::string& _str);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
long double string_to_long_double(const std::u32string& _str);
#endif
double string_to_double(const std::string& _str);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
double string_to_double(const std::u32string& _str);
#endif
float string_to_float(const std::string& _str);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
float string_to_float(const std::u32string& _str);
#endif
int8_t string_to_int8_t(const std::string& _str, int _base = 10);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
int8_t string_to_int8_t(const std::u32string& _str, int _base = 10);
#endif
int16_t string_to_int16_t(const std::string& _str, int _base = 10);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
int16_t string_to_int16_t(const std::u32string& _str, int _base = 10);
#endif
int32_t string_to_int32_t(const std::string& _str, int _base = 10);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
int32_t string_to_int32_t(const std::u32string& _str, int _base = 10);
#endif
int64_t string_to_int64_t(const std::string& _str, int _base = 10);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
int64_t string_to_int64_t(const std::u32string& _str, int _base = 10);
#endif
uint8_t string_to_uint8_t(const std::string& _str, int _base = 10);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
uint8_t string_to_uint8_t(const std::u32string& _str, int _base = 10);
#endif
uint16_t string_to_uint16_t(const std::string& _str, int _base = 10);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
uint16_t string_to_uint16_t(const std::u32string& _str, int _base = 10);
#endif
uint32_t string_to_uint32_t(const std::string& _str, int _base = 10);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
uint32_t string_to_uint32_t(const std::u32string& _str, int _base = 10);
#endif
uint64_t string_to_uint64_t(const std::string& _str, int _base = 10);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
uint64_t string_to_uint64_t(const std::u32string& _str, int _base = 10);
#endif
bool string_to_bool(const std::string& _str);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
bool string_to_bool(const std::u32string& _str);
#endif
std::string tolower(std::string _obj);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
//! @previous
std::u32string tolower(std::u32string _obj);
#endif
std::string toupper(std::string _obj);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
//! @previous
std::u32string toupper(std::u32string _obj);
#endif
bool compare_no_case(const std::string& _obj, const std::string& _val);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
//! @previous
bool compare_no_case(const std::u32string& _obj, const std::u32string& _val);
#endif
bool end_with(const std::string& _obj, const std::string& _val, bool _caseSensitive = true);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
//! @previous
bool end_with(const std::u32string& _obj, const std::u32string& _val, bool _caseSensitive = true);
#endif
bool start_with(const std::string& _obj, const std::string& _val, bool _caseSensitive = true);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
//! @previous
bool start_with(const std::u32string& _obj, const std::u32string& _val, bool _caseSensitive = true);
#endif
std::string replace(const std::string& _obj, char _val, char _replace);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
//! @previous
std::u32string replace(const std::u32string& _obj, char32_t _val, char32_t _replace);
#endif
std::string extract_line(const std::string& _obj, int32_t _pos);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
//! @previous
std::u32string extract_line(const std::u32string& _obj, int32_t _pos);
#endif
std::vector<std::string> split(const std::string& _input, char _val);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
//! @previous
std::vector<std::u32string> split(const std::u32string& _input, char32_t _val);
#endif
void sort(std::vector<std::string *>& _list);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
//! @previous
void sort(std::vector<std::u32string *>& _list);
#endif
@ -531,7 +531,7 @@ namespace std {
namespace std {
std::ostream& operator <<(std::ostream& _os, const std::string& _obj);
std::ostream& operator <<(std::ostream& _os, const std::vector<std::string>& _obj);
#if __cplusplus >= 201103L
#if __CPP_VERSION__ >= 2011
std::ostream& operator <<(std::ostream& _os, const std::u32string& _obj);
std::ostream& operator <<(std::ostream& _os, const std::vector<std::u32string>& _obj);
#endif

View File

@ -41,7 +41,9 @@
#endif
#endif
#if __cplusplus <= 201103L
#if __CPP_VERSION__ < 2011
#define nullptr NULL
typedef uint32_t char32_t;
namespace boost {
@ -60,7 +62,10 @@
#endif
#ifndef _WIN32
typedef float float_t;
#include <math.h>
#ifndef _MATH_H_MATHDEF
typedef float float_t;
#endif
#endif

View File

@ -31,16 +31,6 @@ def create(target):
if target.name=="IOs":
myModule.add_src_file('etk/logIOs.m')
# force old version of C++
target.xx_version = 4005000
if target.config["compilator"] == "gcc" \
and target.xx_version < 4007000:
pass
else:
# name of the dependency
myModule.add_optionnal_module_depend('linearmath', "ETK_BUILD_LINEARMATH", export=True)
myModule.add_optionnal_module_depend('minizip', "ETK_BUILD_MINIZIP")
if target.config["mode"] == "release":
# TODO : The other way is to remove this ...
@ -55,8 +45,16 @@ def create(target):
if target.config["compilator"] == "gcc" \
and target.xx_version < 4007000:
# note : this framework depend on C++ 11, but a simple port of Boost for old compatibility has been done ...
myModule.compile_version_XX(2003)
myModule.add_optionnal_module_depend('boost', "ETK_BUILD_BOOST", export=True)
myModule.add_export_path(tools.get_current_path(__file__) + "/etk/boost_to_std")
myModule.add_export_path(tools.get_current_path(__file__) + "/binding_boost")
else:
myModule.compile_version_XX(2011)
# name of the dependency
myModule.add_optionnal_module_depend('linearmath', "ETK_BUILD_LINEARMATH", export=True)
myModule.add_optionnal_module_depend('minizip', "ETK_BUILD_MINIZIP")
myModule.add_export_path(tools.get_current_path(__file__) + "/binding_X11")
if target.name=="Windows":
None