[STYLE] remove (void) in () to be c++ coherent
This commit is contained in:
parent
2059e5f06a
commit
d2997292a5
16
etk/Buffer.h
16
etk/Buffer.h
@ -82,7 +82,7 @@ namespace etk {
|
||||
/**
|
||||
* @brief Destructor of the current Class
|
||||
*/
|
||||
~Buffer(void) {
|
||||
~Buffer() {
|
||||
if (m_data != NULL) {
|
||||
free(m_data);
|
||||
}
|
||||
@ -104,8 +104,8 @@ namespace etk {
|
||||
}
|
||||
bool ret = true;
|
||||
// write Data
|
||||
(void)file.fileWrite(m_data, sizeof(int8_t), m_gapStart);
|
||||
(void)file.fileWrite(&m_data[m_gapEnd], sizeof(int8_t), m_allocated - m_gapEnd);
|
||||
file.fileWrite(m_data, sizeof(int8_t), m_gapStart);
|
||||
file.fileWrite(&m_data[m_gapEnd], sizeof(int8_t), m_allocated - m_gapEnd);
|
||||
file.fileClose();
|
||||
return ret;
|
||||
}
|
||||
@ -384,7 +384,7 @@ namespace etk {
|
||||
/**
|
||||
* @brief Remove the last element of the Buffer.
|
||||
*/
|
||||
void pop_back(void) {
|
||||
void pop_back() {
|
||||
if (size() > 0) {
|
||||
remove( size() );
|
||||
}
|
||||
@ -392,7 +392,7 @@ namespace etk {
|
||||
/**
|
||||
* @brief Remove all the data in the buffer.
|
||||
*/
|
||||
void clear(void) {
|
||||
void clear() {
|
||||
remove(0, size() );
|
||||
}
|
||||
protected:
|
||||
@ -409,7 +409,7 @@ namespace etk {
|
||||
* @brief Get the number of element in the vector. This does not contain the gap size.
|
||||
* @return The size of the set data.
|
||||
*/
|
||||
int32_t size(void) const {
|
||||
int32_t size() const {
|
||||
return m_allocated - gapSize();
|
||||
};
|
||||
private:
|
||||
@ -516,13 +516,13 @@ namespace etk {
|
||||
* @brief Get the current gap size.
|
||||
* @return The number of element in the gap.
|
||||
*/
|
||||
int32_t gapSize(void) const {
|
||||
int32_t gapSize() const {
|
||||
return m_gapEnd - m_gapStart;
|
||||
}
|
||||
/**
|
||||
* @brief Control if the writing gap is not too big (automatic call when resize the buffer).
|
||||
*/
|
||||
void gapCheckMaxSize(void) {
|
||||
void gapCheckMaxSize() {
|
||||
if(gapSize() > GAP_SIZE_MAX) {
|
||||
int32_t currentSize = size();
|
||||
// Change the gap Size
|
||||
|
@ -44,8 +44,8 @@ typedef struct {
|
||||
etk::Color<> color;
|
||||
} colorList_ts;
|
||||
|
||||
static int32_t getColorSize(void);
|
||||
static const colorList_ts* getColorList(void);
|
||||
static int32_t getColorSize();
|
||||
static const colorList_ts* getColorList();
|
||||
|
||||
namespace etk {
|
||||
template<> void Color<uint8_t>::set(float _r, float _g, float _b, float _a) {
|
||||
@ -76,14 +76,14 @@ namespace etk {
|
||||
m_a = ((float)_a)/255.0f;
|
||||
}
|
||||
|
||||
template<> uint32_t Color<uint8_t>::get(void) const {
|
||||
template<> uint32_t Color<uint8_t>::get() const {
|
||||
return (((uint32_t)m_r)<<24)
|
||||
+ (((uint32_t)m_g)<<16)
|
||||
+ (((uint32_t)m_b)<<8)
|
||||
+ (uint32_t)m_a;
|
||||
}
|
||||
|
||||
template<> uint32_t Color<float>::get(void) const {
|
||||
template<> uint32_t Color<float>::get() const {
|
||||
return Color<uint8_t>(*this).get();
|
||||
}
|
||||
|
||||
@ -537,12 +537,12 @@ static const colorList_ts listOfColor[] = {
|
||||
{ "YellowGreen", etk::color::yellowGreen}
|
||||
};
|
||||
|
||||
static const colorList_ts* getColorList(void)
|
||||
static const colorList_ts* getColorList()
|
||||
{
|
||||
return listOfColor;
|
||||
}
|
||||
|
||||
static int32_t getColorSize(void)
|
||||
static int32_t getColorSize()
|
||||
{
|
||||
static const int32_t tmpp = sizeof(listOfColor) / sizeof(colorList_ts);
|
||||
return tmpp;
|
||||
|
16
etk/Color.h
16
etk/Color.h
@ -41,7 +41,7 @@ namespace etk {
|
||||
/**
|
||||
* @brief Constructor. It does not initialise element of class.
|
||||
*/
|
||||
Color(void) { };
|
||||
Color() { };
|
||||
/**
|
||||
* @brief Contructor with request initialisation.
|
||||
* @param[in] _r Red color.
|
||||
@ -145,7 +145,7 @@ namespace etk {
|
||||
* @breif Get the Generic uint32_t value of the color
|
||||
* @return Color in unsigned integer
|
||||
*/
|
||||
uint32_t get(void) const;
|
||||
uint32_t get() const;
|
||||
/**
|
||||
* @brief Set the specified color elements.
|
||||
* @param[in] _r Red color.
|
||||
@ -167,7 +167,7 @@ namespace etk {
|
||||
* @brief Convert the color in an hexedecimal string ("0xFEDCBA98")
|
||||
* @return The formated string
|
||||
*/
|
||||
std::string getHexString(void) const {
|
||||
std::string getHexString() const {
|
||||
std::ostringstream oss;
|
||||
oss << "0x" << std::setw(8) << std::setfill('0') << std::hex << get();
|
||||
return oss.str();
|
||||
@ -176,7 +176,7 @@ namespace etk {
|
||||
* @brief Convert the color in an generic string value ("#FEDCBA98")
|
||||
* @return The formated string
|
||||
*/
|
||||
std::string getString(void) const {
|
||||
std::string getString() const {
|
||||
std::ostringstream oss;
|
||||
oss << "#" << std::setw(8) << std::setfill('0') << std::hex << get();
|
||||
return oss.str();
|
||||
@ -185,28 +185,28 @@ namespace etk {
|
||||
* @brief Get red color.
|
||||
* @return The red color.
|
||||
*/
|
||||
MY_TYPE r(void) const {
|
||||
MY_TYPE r() const {
|
||||
return m_r;
|
||||
};
|
||||
/**
|
||||
* @brief Get green color.
|
||||
* @return The green color.
|
||||
*/
|
||||
MY_TYPE g(void) const {
|
||||
MY_TYPE g() const {
|
||||
return m_g;
|
||||
};
|
||||
/**
|
||||
* @brief Get blue color.
|
||||
* @return The blue color.
|
||||
*/
|
||||
MY_TYPE b(void) const {
|
||||
MY_TYPE b() const {
|
||||
return m_b;
|
||||
};
|
||||
/**
|
||||
* @brief Get alpha blending.
|
||||
* @return The alpha blending.
|
||||
*/
|
||||
MY_TYPE a(void) const {
|
||||
MY_TYPE a() const {
|
||||
return m_a;
|
||||
};
|
||||
/**
|
||||
|
@ -77,14 +77,14 @@ namespace etk {
|
||||
/**
|
||||
* @brief Destructor of the Hash table(clear all element in the table)
|
||||
*/
|
||||
~Hash(void) {
|
||||
~Hash() {
|
||||
clear();
|
||||
}
|
||||
/**
|
||||
* @brief Remove all entry in the Hash table.
|
||||
* @note It does not delete pointer if your value is a pointer type...
|
||||
*/
|
||||
void clear(void) {
|
||||
void clear() {
|
||||
for (size_t iii = 0; iii < m_data.size(); ++iii) {
|
||||
if (m_data[iii] != NULL) {
|
||||
delete(m_data[iii]);
|
||||
@ -194,7 +194,7 @@ namespace etk {
|
||||
* @brief Get the number of element in the hash table
|
||||
* @return number of elements
|
||||
*/
|
||||
int32_t size(void) const {
|
||||
int32_t size() const {
|
||||
return m_data.size();
|
||||
}
|
||||
/**
|
||||
@ -230,7 +230,7 @@ namespace etk {
|
||||
* @brief Get all the element name (keys).
|
||||
* @return a vector of all name (key).
|
||||
*/
|
||||
std::vector<std::string> getKeys(void) const {
|
||||
std::vector<std::string> getKeys() const {
|
||||
std::vector<std::string> keys;
|
||||
for (size_t iii = 0; iii < m_data.size(); ++iii) {
|
||||
if (m_data[iii] != NULL) {
|
||||
|
@ -28,7 +28,7 @@ etk::BaseNoise::BaseNoise(ivec2 _size, float _min, float _max) :
|
||||
}
|
||||
}
|
||||
|
||||
etk::BaseNoise::~BaseNoise(void)
|
||||
etk::BaseNoise::~BaseNoise()
|
||||
{
|
||||
|
||||
}
|
||||
@ -154,7 +154,7 @@ etk::Noise::Noise(enum noise _type, ivec2 _size, int32_t _depth) :
|
||||
|
||||
}
|
||||
|
||||
etk::Noise::~Noise(void)
|
||||
etk::Noise::~Noise()
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ namespace etk {
|
||||
ivec2 m_size;
|
||||
public:
|
||||
BaseNoise(ivec2 _size, float _min, float _max);
|
||||
~BaseNoise(void);
|
||||
~BaseNoise();
|
||||
float get(int32_t _x, int32_t _y) const;
|
||||
};
|
||||
class Noise {
|
||||
@ -44,7 +44,7 @@ namespace etk {
|
||||
float turbulenceNoSmooth(float _x, float _y, float _size, const etk::BaseNoise& _noise);
|
||||
public:
|
||||
Noise(enum noise _type, ivec2 _size, int32_t _depth);
|
||||
~Noise(void);
|
||||
~Noise();
|
||||
float get(int32_t _x, int32_t _y) const;
|
||||
};
|
||||
};
|
||||
|
88
etk/RegExp.h
88
etk/RegExp.h
@ -154,7 +154,7 @@ template<class CLASS_TYPE> class RegExpNode {
|
||||
/**
|
||||
* @brief Constructor
|
||||
*/
|
||||
RegExpNode(void) :
|
||||
RegExpNode() :
|
||||
m_multipleMin(1),
|
||||
m_multipleMax(1) {
|
||||
|
||||
@ -162,7 +162,7 @@ template<class CLASS_TYPE> class RegExpNode {
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
virtual ~RegExpNode(void) { };
|
||||
virtual ~RegExpNode() { };
|
||||
/**
|
||||
* @brief Generate the regular expression with the current "converted string"
|
||||
* @param[in] _data Property of the regexp
|
||||
@ -202,14 +202,14 @@ template<class CLASS_TYPE> class RegExpNode {
|
||||
* @brief Get the minimum multiplicity.
|
||||
* @return The minimum appear availlable.
|
||||
*/
|
||||
uint32_t getMultMin(void) const {
|
||||
uint32_t getMultMin() const {
|
||||
return m_multipleMin;
|
||||
};
|
||||
/**
|
||||
* @brief Get the maximum multiplicity.
|
||||
* @return The maximum appear availlable.
|
||||
*/
|
||||
uint32_t getMultMax(void) const {
|
||||
uint32_t getMultMax() const {
|
||||
return m_multipleMax;
|
||||
};
|
||||
};
|
||||
@ -226,12 +226,12 @@ template<class CLASS_TYPE> class RegExpNodeValue : public etk::RegExpNode<CLASS_
|
||||
/**
|
||||
* @brief Constructor
|
||||
*/
|
||||
RegExpNodeValue(void) { };
|
||||
RegExpNodeValue() { };
|
||||
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
~RegExpNodeValue(void) { };
|
||||
~RegExpNodeValue() { };
|
||||
|
||||
int32_t generate(const std::vector<char32_t>& _data) {
|
||||
RegExpNode<CLASS_TYPE>::m_RegExpData = _data;
|
||||
@ -307,11 +307,11 @@ template<class CLASS_TYPE> class RegExpNodeBracket : public etk::RegExpNode<CLAS
|
||||
/**
|
||||
* @brief Constructor
|
||||
*/
|
||||
RegExpNodeBracket(void) { };
|
||||
RegExpNodeBracket() { };
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
~RegExpNodeBracket(void) { };
|
||||
~RegExpNodeBracket() { };
|
||||
int32_t generate(const std::vector<char32_t>& _data) {
|
||||
RegExpNode<CLASS_TYPE>::m_RegExpData = _data;
|
||||
TK_REG_EXP_DBG_MODE("Request Parse [...] data=" /*<< etk::displayElem(RegExpNode<CLASS_TYPE>::m_RegExpData)*/ );
|
||||
@ -395,11 +395,11 @@ template<class CLASS_TYPE> class RegExpNodeDigit : public etk::RegExpNode<CLASS_
|
||||
/**
|
||||
* @brief Constructor
|
||||
*/
|
||||
RegExpNodeDigit(void) { };
|
||||
RegExpNodeDigit() { };
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
~RegExpNodeDigit(void) { };
|
||||
~RegExpNodeDigit() { };
|
||||
virtual bool parse(const CLASS_TYPE& _data, int64_t _currentPos, int64_t _lenMax, int64_t& _findLen) {
|
||||
_findLen = 0;
|
||||
TK_REG_EXP_DBG_MODE("Parse node : Digit{" << RegExpNode<CLASS_TYPE>::m_multipleMin << "," << RegExpNode<CLASS_TYPE>::m_multipleMax << "} : "<< _data[_currentPos] << " lenMax=" << _lenMax);
|
||||
@ -447,11 +447,11 @@ template<class CLASS_TYPE> class RegExpNodeDigitNot : public etk::RegExpNode<CLA
|
||||
/**
|
||||
* @brief Constructor
|
||||
*/
|
||||
RegExpNodeDigitNot(void) { };
|
||||
RegExpNodeDigitNot() { };
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
~RegExpNodeDigitNot(void) { };
|
||||
~RegExpNodeDigitNot() { };
|
||||
virtual bool parse(const CLASS_TYPE& _data, int64_t _currentPos, int64_t _lenMax, int64_t& _findLen) {
|
||||
_findLen = 0;
|
||||
TK_REG_EXP_DBG_MODE("Parse node : DigitNot{" << RegExpNode<CLASS_TYPE>::m_multipleMin << "," << RegExpNode<CLASS_TYPE>::m_multipleMax << "}");
|
||||
@ -492,11 +492,11 @@ template<class CLASS_TYPE> class RegExpNodeLetter : public etk::RegExpNode<CLASS
|
||||
/**
|
||||
* @brief Constructor
|
||||
*/
|
||||
RegExpNodeLetter(void) { };
|
||||
RegExpNodeLetter() { };
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
~RegExpNodeLetter(void) { };
|
||||
~RegExpNodeLetter() { };
|
||||
virtual bool parse(const CLASS_TYPE& _data, int64_t _currentPos, int64_t _lenMax, int64_t& _findLen) {
|
||||
_findLen = 0;
|
||||
TK_REG_EXP_DBG_MODE("Parse node : Letter{" << RegExpNode<CLASS_TYPE>::m_multipleMin << "," << RegExpNode<CLASS_TYPE>::m_multipleMax << "}");
|
||||
@ -542,11 +542,11 @@ template<class CLASS_TYPE> class RegExpNodeLetterNot : public etk::RegExpNode<CL
|
||||
/**
|
||||
* @brief Constructor
|
||||
*/
|
||||
RegExpNodeLetterNot(void) { };
|
||||
RegExpNodeLetterNot() { };
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
~RegExpNodeLetterNot(void) { };
|
||||
~RegExpNodeLetterNot() { };
|
||||
virtual bool parse(const CLASS_TYPE& _data, int64_t _currentPos, int64_t _lenMax, int64_t& _findLen) {
|
||||
_findLen = 0;
|
||||
TK_REG_EXP_DBG_MODE("Parse node : LetterNot{" << RegExpNode<CLASS_TYPE>::m_multipleMin << "," << RegExpNode<CLASS_TYPE>::m_multipleMax << "}");
|
||||
@ -592,11 +592,11 @@ template<class CLASS_TYPE> class RegExpNodeWhiteSpace : public etk::RegExpNode<C
|
||||
/**
|
||||
* @brief Constructor
|
||||
*/
|
||||
RegExpNodeWhiteSpace(void) { };
|
||||
RegExpNodeWhiteSpace() { };
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
~RegExpNodeWhiteSpace(void) { };
|
||||
~RegExpNodeWhiteSpace() { };
|
||||
virtual bool parse(const CLASS_TYPE& _data, int64_t _currentPos, int64_t _lenMax, int64_t& _findLen) {
|
||||
_findLen = 0;
|
||||
TK_REG_EXP_DBG_MODE("Parse node : Space{" << RegExpNode<CLASS_TYPE>::m_multipleMin << "," << RegExpNode<CLASS_TYPE>::m_multipleMax << "}");
|
||||
@ -644,11 +644,11 @@ template<class CLASS_TYPE> class RegExpNodeWhiteSpaceNot : public etk::RegExpNod
|
||||
/**
|
||||
* @brief Constructor
|
||||
*/
|
||||
RegExpNodeWhiteSpaceNot(void) { };
|
||||
RegExpNodeWhiteSpaceNot() { };
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
~RegExpNodeWhiteSpaceNot(void) { };
|
||||
~RegExpNodeWhiteSpaceNot() { };
|
||||
virtual bool parse(const CLASS_TYPE& _data, int64_t _currentPos, int64_t _lenMax, int64_t& _findLen) {
|
||||
_findLen = 0;
|
||||
TK_REG_EXP_DBG_MODE("Parse node : SpaceNot{" << RegExpNode<CLASS_TYPE>::m_multipleMin << "," << RegExpNode<CLASS_TYPE>::m_multipleMax << "}");
|
||||
@ -696,11 +696,11 @@ template<class CLASS_TYPE> class RegExpNodeWordChar : public etk::RegExpNode<CLA
|
||||
/**
|
||||
* @brief Constructor
|
||||
*/
|
||||
RegExpNodeWordChar(void) { };
|
||||
RegExpNodeWordChar() { };
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
~RegExpNodeWordChar(void) { };
|
||||
~RegExpNodeWordChar() { };
|
||||
virtual bool parse(const CLASS_TYPE& _data, int64_t _currentPos, int64_t _lenMax, int64_t& _findLen) {
|
||||
_findLen = 0;
|
||||
TK_REG_EXP_DBG_MODE("Parse node : Word{" << RegExpNode<CLASS_TYPE>::m_multipleMin << "," << RegExpNode<CLASS_TYPE>::m_multipleMax << "}");
|
||||
@ -747,11 +747,11 @@ template<class CLASS_TYPE> class RegExpNodeWordCharNot : public etk::RegExpNode<
|
||||
/**
|
||||
* @brief Constructor
|
||||
*/
|
||||
RegExpNodeWordCharNot(void) { };
|
||||
RegExpNodeWordCharNot() { };
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
~RegExpNodeWordCharNot(void) { };
|
||||
~RegExpNodeWordCharNot() { };
|
||||
virtual bool parse(const CLASS_TYPE& _data, int64_t _currentPos, int64_t _lenMax, int64_t& _findLen) {
|
||||
_findLen = 0;
|
||||
TK_REG_EXP_DBG_MODE("Parse node : WordNot{" << RegExpNode<CLASS_TYPE>::m_multipleMin << "," << RegExpNode<CLASS_TYPE>::m_multipleMax << "}");
|
||||
@ -799,11 +799,11 @@ template<class CLASS_TYPE> class RegExpNodeDot : public etk::RegExpNode<CLASS_TY
|
||||
/**
|
||||
* @brief Constructor
|
||||
*/
|
||||
RegExpNodeDot(void) { };
|
||||
RegExpNodeDot() { };
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
~RegExpNodeDot(void) { };
|
||||
~RegExpNodeDot() { };
|
||||
virtual bool parse(const CLASS_TYPE& _data, int64_t _currentPos, int64_t _lenMax, int64_t& _findLen) {
|
||||
_findLen = 0;
|
||||
TK_REG_EXP_DBG_MODE("Parse node : '.'{" << RegExpNode<CLASS_TYPE>::m_multipleMin << "," << RegExpNode<CLASS_TYPE>::m_multipleMax << "}");
|
||||
@ -853,11 +853,11 @@ template<class CLASS_TYPE> class RegExpNodeSOL : public etk::RegExpNode<CLASS_TY
|
||||
/**
|
||||
* @brief Constructor
|
||||
*/
|
||||
RegExpNodeSOL(void) { };
|
||||
RegExpNodeSOL() { };
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
~RegExpNodeSOL(void) { };
|
||||
~RegExpNodeSOL() { };
|
||||
virtual bool parse(const CLASS_TYPE& _data, int64_t _currentPos, int64_t _lenMax, int64_t& _findLen) {
|
||||
_findLen = 0;
|
||||
// TODO : ...
|
||||
@ -883,11 +883,11 @@ template<class CLASS_TYPE> class RegExpNodeEOL : public etk::RegExpNode<CLASS_TY
|
||||
/**
|
||||
* @brief Constructor
|
||||
*/
|
||||
RegExpNodeEOL(void) { };
|
||||
RegExpNodeEOL() { };
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
~RegExpNodeEOL(void) { };
|
||||
~RegExpNodeEOL() { };
|
||||
virtual bool parse(const CLASS_TYPE& _data, int64_t _currentPos, int64_t _lenMax, int64_t& _findLen) {
|
||||
_findLen = 0;
|
||||
// TODO : ...
|
||||
@ -924,11 +924,11 @@ template<class CLASS_TYPE> class RegExpNodePTheseElem : public etk::RegExpNode<C
|
||||
/**
|
||||
* @brief Constructor
|
||||
*/
|
||||
RegExpNodePTheseElem(void) { };
|
||||
RegExpNodePTheseElem() { };
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
~RegExpNodePTheseElem(void) { };
|
||||
~RegExpNodePTheseElem() { };
|
||||
int32_t generate(const std::vector<char32_t>& _data) {
|
||||
RegExpNode<CLASS_TYPE>::m_RegExpData = _data;
|
||||
TK_REG_EXP_DBG_MODE("Request Parse (elem) data=" /*<< etk::displayElem(RegExpNode<CLASS_TYPE>::m_RegExpData)*/ );
|
||||
@ -1125,11 +1125,11 @@ template<class CLASS_TYPE> class RegExpNodePThese : public etk::RegExpNode<CLASS
|
||||
/**
|
||||
* @brief Constructor
|
||||
*/
|
||||
RegExpNodePThese(void) { };
|
||||
RegExpNodePThese() { };
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
~RegExpNodePThese(void) { }
|
||||
~RegExpNodePThese() { }
|
||||
int32_t generate(const std::vector<char32_t>& _data) {
|
||||
RegExpNode<CLASS_TYPE>::m_RegExpData = _data;
|
||||
TK_REG_EXP_DBG_MODE("Request Parse (...) data=" /*<< etk::displayElem(RegExpNode<CLASS_TYPE>::m_RegExpData)*/ );
|
||||
@ -1206,7 +1206,7 @@ template<class CLASS_TYPE> class RegExpNodePThese : public etk::RegExpNode<CLASS
|
||||
/**
|
||||
* @brief Just display the regExp in color ...
|
||||
*/
|
||||
void drawColoredRegEx(void) {
|
||||
void drawColoredRegEx() {
|
||||
TK_INFO("regExp :" /*<< etk::displayElem(RegExpNode<CLASS_TYPE>::m_RegExpData)*/ );
|
||||
}
|
||||
};
|
||||
@ -1291,7 +1291,7 @@ template<class CLASS_TYPE> class RegExp {
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
~RegExp(void) {
|
||||
~RegExp() {
|
||||
m_isOk = false;
|
||||
};
|
||||
|
||||
@ -1445,13 +1445,13 @@ template<class CLASS_TYPE> class RegExp {
|
||||
* @brief Get the regular expression string
|
||||
* @return the string representing the RegExp
|
||||
*/
|
||||
std::string getRegExp(void) const {
|
||||
std::string getRegExp() const {
|
||||
return std::to_string(m_expressionRequested);
|
||||
};
|
||||
/**
|
||||
* @previous
|
||||
*/
|
||||
const std::u32string& getURegExp(void) const {
|
||||
const std::u32string& getURegExp() const {
|
||||
return m_expressionRequested;
|
||||
};
|
||||
|
||||
@ -1460,7 +1460,7 @@ template<class CLASS_TYPE> class RegExp {
|
||||
* @return true : the regExp is correctly parsed
|
||||
* @return false : an error occcured (check log ...)
|
||||
*/
|
||||
bool getStatus(void) {
|
||||
bool getStatus() {
|
||||
return m_isOk;
|
||||
};
|
||||
// process the regular expression
|
||||
@ -1618,7 +1618,7 @@ template<class CLASS_TYPE> class RegExp {
|
||||
* @brief Get the expression start position detected
|
||||
* @return position of the start regExp
|
||||
*/
|
||||
int64_t start(void) {
|
||||
int64_t start() {
|
||||
return m_areaFind.start;
|
||||
};
|
||||
|
||||
@ -1626,27 +1626,27 @@ template<class CLASS_TYPE> class RegExp {
|
||||
* @brief Get the expression stop position detected
|
||||
* @return position of the stop regExp
|
||||
*/
|
||||
int64_t stop(void) {
|
||||
int64_t stop() {
|
||||
return m_areaFind.stop;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Display the reg Exp
|
||||
*/
|
||||
void display(void) {
|
||||
void display() {
|
||||
m_exprRootNode.display(0);
|
||||
};
|
||||
/**
|
||||
* @brief Just display the regExp in color ...
|
||||
*/
|
||||
void drawColoredRegEx(void) {
|
||||
void drawColoredRegEx() {
|
||||
m_exprRootNode.drawColoredRegEx();
|
||||
}
|
||||
/**
|
||||
* @brief Get decorated regular expression. This generate a [class[ewol::compositing::Text]] decoration text. Note that can be use in [class[ewol::widget::Label]].
|
||||
* @return The decorated string
|
||||
*/
|
||||
std::string getRegExDecorated(void) {
|
||||
std::string getRegExDecorated() {
|
||||
// TODO : do it...
|
||||
return "";
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ bool etk::Archive::exist(const std::string& _key) const {
|
||||
return m_content.find(_key) != m_content.end();
|
||||
}
|
||||
|
||||
void etk::Archive::display(void)
|
||||
void etk::Archive::display()
|
||||
{
|
||||
for (auto &it : m_content) {
|
||||
int32_t size = it.second.getTheoricSize();
|
||||
|
@ -20,19 +20,19 @@ namespace etk {
|
||||
private:
|
||||
int32_t m_link; //!< number of element open on this file
|
||||
public:
|
||||
void increaseRef(void) {
|
||||
void increaseRef() {
|
||||
m_link++;
|
||||
};
|
||||
void decreaseRef(void) {
|
||||
void decreaseRef() {
|
||||
m_link--;
|
||||
};
|
||||
int32_t getNumberOfRef(void) const {
|
||||
int32_t getNumberOfRef() const {
|
||||
return m_link;
|
||||
};
|
||||
private:
|
||||
int32_t m_theoricSize; //!< number of element open on this file
|
||||
public:
|
||||
int32_t getTheoricSize(void) const {
|
||||
int32_t getTheoricSize() const {
|
||||
return m_theoricSize;
|
||||
};
|
||||
private:
|
||||
@ -41,13 +41,13 @@ namespace etk {
|
||||
Content(int32_t _basicSize=0) :
|
||||
m_link(-1),
|
||||
m_theoricSize(_basicSize) { };
|
||||
int32_t size(void) const {
|
||||
int32_t size() const {
|
||||
return m_data.size();
|
||||
};
|
||||
void* data(void) const {
|
||||
void* data() const {
|
||||
return (void*)&m_data[0];
|
||||
};
|
||||
std::vector<char>& getDataVector(void) {
|
||||
std::vector<char>& getDataVector() {
|
||||
return m_data;
|
||||
};
|
||||
};
|
||||
@ -56,7 +56,7 @@ namespace etk {
|
||||
m_fileName(_fileName) {
|
||||
|
||||
};
|
||||
virtual ~Archive(void) { };
|
||||
virtual ~Archive() { };
|
||||
protected:
|
||||
std::string m_fileName; //!< File name when it came from an file
|
||||
public:
|
||||
@ -64,7 +64,7 @@ namespace etk {
|
||||
* @brief Get the current file name.
|
||||
* @return the requested file name.
|
||||
*/
|
||||
const std::string& getFileName(void) {
|
||||
const std::string& getFileName() {
|
||||
return m_fileName;
|
||||
};
|
||||
protected:
|
||||
@ -74,7 +74,7 @@ namespace etk {
|
||||
* @brief Get the number of elements
|
||||
* @return nb files in the archive
|
||||
*/
|
||||
int32_t size(void) const {
|
||||
int32_t size() const {
|
||||
return m_content.size();
|
||||
};
|
||||
/**
|
||||
@ -114,7 +114,7 @@ namespace etk {
|
||||
/**
|
||||
* @brief Display all Element in the archive
|
||||
*/
|
||||
void display(void);
|
||||
void display();
|
||||
protected:
|
||||
/**
|
||||
* @brief Request the load in memory of the concerned file.
|
||||
|
@ -48,7 +48,7 @@ etk::archive::Zip::Zip(const std::string& _fileName) :
|
||||
}
|
||||
}
|
||||
|
||||
etk::archive::Zip::~Zip(void) {
|
||||
etk::archive::Zip::~Zip() {
|
||||
if (m_ctx!= NULL) {
|
||||
unzClose(m_ctx);
|
||||
m_ctx = NULL;
|
||||
|
@ -22,7 +22,7 @@ namespace etk {
|
||||
unz_global_info m_info; //!< global information of the Zip
|
||||
public:
|
||||
Zip(const std::string& _fileName);
|
||||
virtual ~Zip(void);
|
||||
virtual ~Zip();
|
||||
protected: // herited functions :
|
||||
virtual void loadFile(const std::map<std::string, Content>::iterator& it);
|
||||
};
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include <etk/debug.h>
|
||||
|
||||
int32_t etk::getLogId(void) {
|
||||
int32_t etk::getLogId() {
|
||||
static int32_t g_val = etk::log::registerInstance("etk");
|
||||
return g_val;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <etk/log.h>
|
||||
|
||||
namespace etk {
|
||||
int32_t getLogId(void);
|
||||
int32_t getLogId();
|
||||
};
|
||||
// TODO : Review this problem of multiple intanciation of "std::stringbuf sb"
|
||||
#define ETK_BASE(info,data) \
|
||||
|
14
etk/log.cpp
14
etk/log.cpp
@ -70,12 +70,12 @@
|
||||
#define DEFAULT_LOG_TIME true
|
||||
#endif
|
||||
|
||||
enum etk::log::level& getDefaultLevel(void) {
|
||||
enum etk::log::level& getDefaultLevel() {
|
||||
static enum etk::log::level g_val = DEFAULT_LOG_LEVEL;
|
||||
return g_val;
|
||||
}
|
||||
|
||||
std::vector<std::pair<std::string, enum etk::log::level>>& getList(void) {
|
||||
std::vector<std::pair<std::string, enum etk::log::level>>& getList() {
|
||||
static std::vector<std::pair<std::string, enum etk::log::level>> g_val;
|
||||
return g_val;
|
||||
}
|
||||
@ -125,7 +125,7 @@ int32_t etk::log::getLevel(int32_t _id) {
|
||||
return (int32_t)getList()[_id].second;
|
||||
}
|
||||
|
||||
std::vector<std::string> etk::log::getListInstance(void) {
|
||||
std::vector<std::string> etk::log::getListInstance() {
|
||||
std::vector<std::string> out;
|
||||
for (size_t iii = 0; iii < getList().size(); ++iii) {
|
||||
out.push_back(getList()[iii].first);
|
||||
@ -151,7 +151,7 @@ void etk::log::logStream1(int32_t _id, int32_t _level, const std::ostream& _log)
|
||||
etk::log::logChar(_id, _level, -1, NULL, NULL, sss.c_str());
|
||||
}
|
||||
|
||||
static bool& getColor(void) {
|
||||
static bool& getColor() {
|
||||
static bool g_val = DEFAULT_LOG_COLOR;
|
||||
return g_val;
|
||||
}
|
||||
@ -160,7 +160,7 @@ void etk::log::setColor(bool _status) {
|
||||
getColor() = _status;
|
||||
}
|
||||
|
||||
static bool& getTime(void) {
|
||||
static bool& getTime() {
|
||||
static bool g_val = DEFAULT_LOG_TIME;
|
||||
return g_val;
|
||||
}
|
||||
@ -168,7 +168,7 @@ void etk::log::setTime(bool _status) {
|
||||
getTime() = _status;
|
||||
}
|
||||
|
||||
static bool& getLine(void) {
|
||||
static bool& getLine() {
|
||||
static bool g_val = DEFAULT_LOG_LINE;
|
||||
return g_val;
|
||||
}
|
||||
@ -176,7 +176,7 @@ void etk::log::setLine(bool _status) {
|
||||
getLine() = _status;
|
||||
}
|
||||
|
||||
static bool& getFunction(void) {
|
||||
static bool& getFunction() {
|
||||
static bool g_val = DEFAULT_LOG_CLASS;
|
||||
return g_val;
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ namespace etk {
|
||||
* @brief Get list of all intance
|
||||
* @return the name list of all intance
|
||||
*/
|
||||
std::vector<std::string> getListInstance(void);
|
||||
std::vector<std::string> getListInstance();
|
||||
/**
|
||||
* @brief Set Color enable or disable.
|
||||
* @param[in] _status New value of color.
|
||||
|
@ -85,7 +85,7 @@ namespace etk
|
||||
/*****************************************************
|
||||
* Destructor
|
||||
*****************************************************/
|
||||
virtual ~Matrix(void) {};
|
||||
virtual ~Matrix() {};
|
||||
|
||||
/*****************************************************
|
||||
* = assigment
|
||||
@ -255,7 +255,7 @@ namespace etk
|
||||
/*****************************************************
|
||||
* - operator
|
||||
*****************************************************/
|
||||
Matrix<T> operator - (void) {
|
||||
Matrix<T> operator - () {
|
||||
Matrix<T> tmp(m_size);
|
||||
for (int32_t iii=0; iii<m_data.Size(); iii++) {
|
||||
tmp.m_data[iii] = -m_data[iii];
|
||||
@ -268,7 +268,7 @@ namespace etk
|
||||
* @ brief Transpose Matrix
|
||||
* @ return the transpose matrix
|
||||
*/
|
||||
Matrix<T> transpose(void)
|
||||
Matrix<T> transpose()
|
||||
{
|
||||
// create a matrix with the inverted size
|
||||
Matrix<T> tmpMatrix(m_size.x, m_size.y);
|
||||
@ -379,7 +379,7 @@ namespace etk
|
||||
* x x x x x
|
||||
* </pre>
|
||||
*/
|
||||
void clearUpperTriangle(void)
|
||||
void clearUpperTriangle()
|
||||
{
|
||||
if (m_size.x != m_size.y) {
|
||||
TK_WARNING("better to do with square Matrix");
|
||||
@ -400,7 +400,7 @@ namespace etk
|
||||
* 0 0 0 0 x
|
||||
* </pre>
|
||||
*/
|
||||
void clearLowerTriangle(void)
|
||||
void clearLowerTriangle()
|
||||
{
|
||||
if (m_size.x != m_size.y) {
|
||||
TK_WARNING("better to do with square Matrix");
|
||||
@ -447,7 +447,7 @@ namespace etk
|
||||
/**
|
||||
* @brief Clear all the matrix.
|
||||
*/
|
||||
void clear(void) {
|
||||
void clear() {
|
||||
// copy data for the same size :
|
||||
for (int32_t iii=0; iii< m_size.x*m_size.y; iii++) {
|
||||
m_data[iii] = (T)0;
|
||||
@ -456,7 +456,7 @@ namespace etk
|
||||
/**
|
||||
* @brief Set the diagonal at 1
|
||||
*/
|
||||
void identity(void)
|
||||
void identity()
|
||||
{
|
||||
// copy data for the same size :
|
||||
for (int32_t iii=0; iii< etk_min(m_size.x, m_size.y); iii++) {
|
||||
@ -466,7 +466,7 @@ namespace etk
|
||||
/**
|
||||
* @brief Clear and set the diagonal at 1
|
||||
*/
|
||||
void eye(void)
|
||||
void eye()
|
||||
{
|
||||
clear();
|
||||
identity();
|
||||
@ -475,7 +475,7 @@ namespace etk
|
||||
* @brief Get the size of the current Matrix.
|
||||
* @return Dimention of the matrix
|
||||
*/
|
||||
Vector2D<int32_t> size(void)
|
||||
Vector2D<int32_t> size()
|
||||
{
|
||||
return m_size;
|
||||
};
|
||||
|
@ -21,7 +21,7 @@ namespace etk {
|
||||
class Matrix4 {
|
||||
public:
|
||||
float m_mat[4*4];
|
||||
void identity(void) {
|
||||
void identity() {
|
||||
for(int32_t iii=0; iii<4*4 ; iii++) {
|
||||
m_mat[iii] = 0;
|
||||
}
|
||||
@ -33,7 +33,7 @@ namespace etk {
|
||||
/*****************************************************
|
||||
* Constructor
|
||||
*****************************************************/
|
||||
Matrix4(void) {
|
||||
Matrix4() {
|
||||
identity();
|
||||
}
|
||||
Matrix4(const Matrix4& obj) {
|
||||
@ -74,7 +74,7 @@ namespace etk {
|
||||
/*****************************************************
|
||||
* Destructor
|
||||
*****************************************************/
|
||||
virtual ~Matrix4(void) {
|
||||
virtual ~Matrix4() {
|
||||
|
||||
}
|
||||
/*****************************************************
|
||||
@ -185,7 +185,7 @@ namespace etk {
|
||||
/*****************************************************
|
||||
* other basic function :
|
||||
*****************************************************/
|
||||
void transpose(void)
|
||||
void transpose()
|
||||
{
|
||||
float tmpVal = m_mat[1];
|
||||
m_mat[1] = m_mat[4];
|
||||
@ -243,13 +243,13 @@ namespace etk {
|
||||
* @brief Computes the determinant of the matrix.
|
||||
* @return The determinent Value.
|
||||
*/
|
||||
float determinant(void) const;
|
||||
float determinant() const;
|
||||
/**
|
||||
* @brief Inverts the matrix.
|
||||
* @note The determinant must be != 0, otherwithe the matrix can't be inverted.
|
||||
* @return The inverted matrix.
|
||||
*/
|
||||
Matrix4 invert(void);
|
||||
Matrix4 invert();
|
||||
};
|
||||
Matrix4 matFrustum(float xmin, float xmax, float ymin, float ymax, float zNear, float zFar);
|
||||
Matrix4 matPerspective(float foxy, float aspect, float zNear, float zFar);
|
||||
|
@ -24,7 +24,7 @@ namespace etk {
|
||||
/*****************************************************
|
||||
* Constructor
|
||||
*****************************************************/
|
||||
Plane(void) :
|
||||
Plane() :
|
||||
m_normal(0, 0, 0),
|
||||
m_intercept(0) {
|
||||
|
||||
@ -42,7 +42,7 @@ namespace etk {
|
||||
/*****************************************************
|
||||
* Destructor
|
||||
*****************************************************/
|
||||
~Plane(void) {
|
||||
~Plane() {
|
||||
|
||||
};
|
||||
|
||||
@ -91,7 +91,7 @@ namespace etk {
|
||||
* @param[in,out]
|
||||
* @return
|
||||
*/
|
||||
void normalize(void) {
|
||||
void normalize() {
|
||||
float normalLength=m_normal.getLength();
|
||||
m_normal/=normalLength;
|
||||
m_intercept/=normalLength;
|
||||
@ -102,7 +102,7 @@ namespace etk {
|
||||
* @param[in,out]
|
||||
* @return
|
||||
*/
|
||||
etk::Vector3D<T> getNormal(void) {
|
||||
etk::Vector3D<T> getNormal() {
|
||||
return m_normal;
|
||||
};
|
||||
|
||||
@ -111,7 +111,7 @@ namespace etk {
|
||||
* @param[in,out]
|
||||
* @return
|
||||
*/
|
||||
float getIntercept(void) {
|
||||
float getIntercept() {
|
||||
return m_intercept;
|
||||
}
|
||||
|
||||
@ -194,7 +194,7 @@ namespace etk {
|
||||
* @param[in,out]
|
||||
* @return
|
||||
*/
|
||||
Plane<T> operator-(void) const {
|
||||
Plane<T> operator-() const {
|
||||
return Plane<T>(-m_normal, -m_intercept);
|
||||
}
|
||||
|
||||
@ -203,7 +203,7 @@ namespace etk {
|
||||
* @param[in,out]
|
||||
* @return
|
||||
*/
|
||||
Plane<T> operator+(void) const {
|
||||
Plane<T> operator+() const {
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
@ -85,7 +85,7 @@ std::ostream& etk::operator <<(std::ostream& _os, const std::vector<bvec2 >& _ob
|
||||
}
|
||||
|
||||
namespace etk {
|
||||
template<> Vector2D<bool>::operator std::string(void) const {
|
||||
template<> Vector2D<bool>::operator std::string() const {
|
||||
std::string str;
|
||||
str = "(";
|
||||
str += std::to_string(x());
|
||||
@ -94,7 +94,7 @@ namespace etk {
|
||||
str += ")";
|
||||
return str;
|
||||
}
|
||||
template<> Vector2D<bool>::operator std::u32string(void) const {
|
||||
template<> Vector2D<bool>::operator std::u32string() const {
|
||||
std::u32string str;
|
||||
str = U"(";
|
||||
str += std::to_u32string(x());
|
||||
@ -153,7 +153,7 @@ namespace etk {
|
||||
TK_VERBOSE("Parse : '" << _str << "' ==> " << *this);
|
||||
}
|
||||
|
||||
template<> Vector2D<int32_t>::operator std::string(void) const {
|
||||
template<> Vector2D<int32_t>::operator std::string() const {
|
||||
std::string str;
|
||||
str = "(";
|
||||
str += std::to_string(x());
|
||||
@ -162,7 +162,7 @@ namespace etk {
|
||||
str += ")";
|
||||
return str;
|
||||
}
|
||||
template<> Vector2D<int32_t>::operator std::u32string(void) const {
|
||||
template<> Vector2D<int32_t>::operator std::u32string() const {
|
||||
std::u32string str;
|
||||
str = U"(";
|
||||
str += std::to_u32string(x());
|
||||
@ -223,7 +223,7 @@ namespace etk {
|
||||
TK_VERBOSE("Parse : \"" << _str << "\" ==> " << *this);
|
||||
}
|
||||
|
||||
template<> Vector2D<uint32_t>::operator std::string(void) const {
|
||||
template<> Vector2D<uint32_t>::operator std::string() const {
|
||||
std::string str;
|
||||
str = "(";
|
||||
str += std::to_string(x());
|
||||
@ -233,7 +233,7 @@ namespace etk {
|
||||
return str;
|
||||
}
|
||||
|
||||
template<> Vector2D<uint32_t>::operator std::u32string(void) const {
|
||||
template<> Vector2D<uint32_t>::operator std::u32string() const {
|
||||
std::u32string str;
|
||||
str = U"(";
|
||||
str += std::to_u32string(x());
|
||||
@ -294,7 +294,7 @@ namespace etk {
|
||||
TK_VERBOSE("Parse : \"" << _str << "\" ==> " << *this);
|
||||
}
|
||||
|
||||
template<> Vector2D<float>::operator std::string(void) const {
|
||||
template<> Vector2D<float>::operator std::string() const {
|
||||
std::string str;
|
||||
str = "(";
|
||||
str += std::to_string(x());
|
||||
@ -303,7 +303,7 @@ namespace etk {
|
||||
str += ")";
|
||||
return str;
|
||||
}
|
||||
template<> Vector2D<float>::operator std::u32string(void) const {
|
||||
template<> Vector2D<float>::operator std::u32string() const {
|
||||
std::u32string str;
|
||||
str = U"(";
|
||||
str += std::to_u32string(x());
|
||||
|
@ -23,7 +23,7 @@ namespace etk {
|
||||
/* ****************************************************
|
||||
* Constructor
|
||||
*****************************************************/
|
||||
Vector2D(void) {
|
||||
Vector2D() {
|
||||
#ifdef DEBUG
|
||||
// in debug mode we set supid value to prevent forget of the inits ...
|
||||
m_floats[0] = (T)34673363;
|
||||
@ -49,7 +49,7 @@ namespace etk {
|
||||
};
|
||||
Vector2D(const std::string& _str);
|
||||
Vector2D(const std::u32string& _str);
|
||||
~Vector2D(void) { };
|
||||
~Vector2D() { };
|
||||
/* ****************************************************
|
||||
* = assigment
|
||||
*****************************************************/
|
||||
@ -179,7 +179,7 @@ namespace etk {
|
||||
/* ****************************************************
|
||||
* ++ operator
|
||||
*****************************************************/
|
||||
Vector2D<T>& operator++(void) {
|
||||
Vector2D<T>& operator++() {
|
||||
++m_floats[0];
|
||||
++m_floats[1];
|
||||
return *this;
|
||||
@ -192,7 +192,7 @@ namespace etk {
|
||||
/* ****************************************************
|
||||
* -- operator
|
||||
*****************************************************/
|
||||
Vector2D<T>& operator--(void) {
|
||||
Vector2D<T>& operator--() {
|
||||
--m_floats[0];
|
||||
--m_floats[1];
|
||||
return *this;
|
||||
@ -213,13 +213,13 @@ namespace etk {
|
||||
/**
|
||||
* @brief Return the length of the vector squared
|
||||
*/
|
||||
btScalar length2(void) const {
|
||||
btScalar length2() const {
|
||||
return dot(*this);
|
||||
}
|
||||
/**
|
||||
* @brief Return the length of the vector
|
||||
*/
|
||||
btScalar length(void) const {
|
||||
btScalar length() const {
|
||||
return btSqrt(length2());
|
||||
}
|
||||
/**
|
||||
@ -240,19 +240,19 @@ namespace etk {
|
||||
* @brief Normalize this vector
|
||||
* x^2 + y^2 + z^2 = 1
|
||||
*/
|
||||
Vector3D<T>& normalize(void) {
|
||||
Vector3D<T>& normalize() {
|
||||
return *this /= length();
|
||||
}
|
||||
/**
|
||||
* @brief Return a normalized version of this vector
|
||||
*/
|
||||
Vector2D<T> normalized(void) const {
|
||||
Vector2D<T> normalized() const {
|
||||
return *this / length();
|
||||
}
|
||||
/**
|
||||
* @brief Return a vector will the absolute values of each element
|
||||
*/
|
||||
Vector2D<T> absolute(void) const {
|
||||
Vector2D<T> absolute() const {
|
||||
return Vector2D<T>( abs(m_floats[0]),
|
||||
abs(m_floats[1]));
|
||||
}
|
||||
@ -260,32 +260,32 @@ namespace etk {
|
||||
* @brief Return the axis with the smallest value
|
||||
* Note return values are 0,1,2 for x, y, or z
|
||||
*/
|
||||
int32_t minAxis(void) const {
|
||||
int32_t minAxis() const {
|
||||
return m_floats[0] < m_floats[1] ? 0 : 1;
|
||||
}
|
||||
/**
|
||||
* @brief Return the axis with the largest value
|
||||
* Note return values are 0,1,2 for x, y, or z
|
||||
*/
|
||||
int32_t maxAxis(void) const {
|
||||
int32_t maxAxis() const {
|
||||
return m_floats[0] < m_floats[1] ? 1 : 0;
|
||||
}
|
||||
int32_t furthestAxis(void) const {
|
||||
int32_t furthestAxis() const {
|
||||
return absolute().minAxis();
|
||||
}
|
||||
int32_t closestAxis(void) const {
|
||||
int32_t closestAxis() const {
|
||||
return absolute().maxAxis();
|
||||
}
|
||||
/**
|
||||
* @brief Return the x value
|
||||
*/
|
||||
const T& getX(void) const {
|
||||
const T& getX() const {
|
||||
return m_floats[0];
|
||||
}
|
||||
/**
|
||||
* @brief Return the y value
|
||||
*/
|
||||
const T& getY(void) const {
|
||||
const T& getY() const {
|
||||
return m_floats[1];
|
||||
}
|
||||
/**
|
||||
@ -303,19 +303,19 @@ namespace etk {
|
||||
/**
|
||||
* @brief Return the x value
|
||||
*/
|
||||
const T& x(void) const {
|
||||
const T& x() const {
|
||||
return m_floats[0];
|
||||
}
|
||||
/**
|
||||
* @brief Return the y value
|
||||
*/
|
||||
const T& y(void) const {
|
||||
const T& y() const {
|
||||
return m_floats[1];
|
||||
}
|
||||
operator T *(void) {
|
||||
operator T *() {
|
||||
return &m_floats[0];
|
||||
}
|
||||
operator const T *(void) const {
|
||||
operator const T *() const {
|
||||
return &m_floats[0];
|
||||
}
|
||||
/**
|
||||
@ -338,15 +338,15 @@ namespace etk {
|
||||
m_floats[0]=_x;
|
||||
m_floats[1]=_y;
|
||||
}
|
||||
void setZero(void) {
|
||||
void setZero() {
|
||||
setValue(0,0);
|
||||
}
|
||||
bool isZero(void) const {
|
||||
bool isZero() const {
|
||||
return m_floats[0] == 0 && m_floats[1] == 0;
|
||||
}
|
||||
//!< string cast :
|
||||
operator std::string(void) const;
|
||||
operator std::u32string(void) const;
|
||||
operator std::string() const;
|
||||
operator std::u32string() const;
|
||||
};
|
||||
/**
|
||||
* @brief Debug operator To display the curent element in a Human redeable information
|
||||
|
@ -28,7 +28,7 @@ namespace etk
|
||||
/**
|
||||
* @brief No initialization constructor (faster ...)
|
||||
*/
|
||||
Vector3D(void) {
|
||||
Vector3D() {
|
||||
#ifdef DEBUG
|
||||
// in debug mode we set supid value to prevent forget of the inits ...
|
||||
m_floats[0] = (T)34673363;
|
||||
@ -136,14 +136,14 @@ namespace etk
|
||||
/**
|
||||
* @brief Return the length of the vector squared
|
||||
*/
|
||||
btScalar length2(void) const {
|
||||
btScalar length2() const {
|
||||
return dot(*this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the length of the vector
|
||||
*/
|
||||
btScalar length(void) const {
|
||||
btScalar length() const {
|
||||
return btSqrt(length2());
|
||||
}
|
||||
|
||||
@ -163,7 +163,7 @@ namespace etk
|
||||
return (_v - *this).length();
|
||||
}
|
||||
|
||||
Vector3D<T>& safeNormalize(void) {
|
||||
Vector3D<T>& safeNormalize() {
|
||||
Vector3D<T> absVec = this->absolute();
|
||||
int maxIndex = absVec.maxAxis();
|
||||
if (absVec[maxIndex]>0)
|
||||
@ -179,14 +179,14 @@ namespace etk
|
||||
* @brief Normalize this vector
|
||||
* x^2 + y^2 + z^2 = 1
|
||||
*/
|
||||
Vector3D<T>& normalize(void) {
|
||||
Vector3D<T>& normalize() {
|
||||
return *this /= length();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return a normalized version of this vector
|
||||
*/
|
||||
Vector3D<T> normalized(void) const {
|
||||
Vector3D<T> normalized() const {
|
||||
return *this / length();
|
||||
}
|
||||
|
||||
@ -218,7 +218,7 @@ namespace etk
|
||||
/**
|
||||
* @brief Return a vector will the absolute values of each element
|
||||
*/
|
||||
Vector3D<T> absolute(void) const {
|
||||
Vector3D<T> absolute() const {
|
||||
return Vector3D<T>( abs(m_floats[0]),
|
||||
abs(m_floats[1]),
|
||||
abs(m_floats[2]));
|
||||
@ -244,7 +244,7 @@ namespace etk
|
||||
* @brief Return the axis with the smallest value
|
||||
* Note return values are 0,1,2 for x, y, or z
|
||||
*/
|
||||
int32_t minAxis(void) const {
|
||||
int32_t minAxis() const {
|
||||
if (m_floats[0] < m_floats[1]) {
|
||||
return m_floats[0] < m_floats[2] ? 0 : 2;
|
||||
}
|
||||
@ -255,18 +255,18 @@ namespace etk
|
||||
* @brief Return the axis with the largest value
|
||||
* Note return values are 0,1,2 for x, y, or z
|
||||
*/
|
||||
int32_t maxAxis(void) const {
|
||||
int32_t maxAxis() const {
|
||||
if (m_floats[0] < m_floats[1]) {
|
||||
return m_floats[1] < m_floats[2] ? 2 : 1;
|
||||
}
|
||||
return m_floats[0] < m_floats[2] ? 2 : 0;
|
||||
}
|
||||
|
||||
int32_t furthestAxis(void) const {
|
||||
int32_t furthestAxis() const {
|
||||
return absolute().minAxis();
|
||||
}
|
||||
|
||||
int32_t closestAxis(void) const {
|
||||
int32_t closestAxis() const {
|
||||
return absolute().maxAxis();
|
||||
}
|
||||
|
||||
@ -431,11 +431,11 @@ namespace etk
|
||||
_v2->setValue(-y() ,x() ,0.);
|
||||
}
|
||||
|
||||
void setZero(void) {
|
||||
void setZero() {
|
||||
setValue(0,0,0);
|
||||
}
|
||||
|
||||
bool isZero(void) const {
|
||||
bool isZero() const {
|
||||
return m_floats[0] == 0 && m_floats[1] == 0 && m_floats[2] == 0;
|
||||
}
|
||||
};
|
||||
|
@ -28,7 +28,7 @@ namespace etk
|
||||
/**
|
||||
* @brief No initialization constructor (faster ...)
|
||||
*/
|
||||
Vector4D(void)
|
||||
Vector4D()
|
||||
{
|
||||
#ifdef DEBUG
|
||||
// in debug mode we set supid value to prevent forget of the inits ...
|
||||
@ -244,7 +244,7 @@ namespace etk
|
||||
/**
|
||||
* @brief Return a vector will the absolute values of each element
|
||||
*/
|
||||
Vector4D<T> absolute(void) const
|
||||
Vector4D<T> absolute() const
|
||||
{
|
||||
return Vector4D<T>( abs(m_floats[0]),
|
||||
abs(m_floats[1]),
|
||||
@ -276,7 +276,7 @@ namespace etk
|
||||
* Note return values are 0,1,2 for x, y, or z
|
||||
*/
|
||||
/*
|
||||
int32_t minAxis(void) const
|
||||
int32_t minAxis() const
|
||||
{
|
||||
return m_floats[0] < m_floats[1] ? (m_floats[0] <m_floats[2] ? 0 : 2) : (m_floats[1] <m_floats[2] ? 1 : 2);
|
||||
}
|
||||
@ -286,17 +286,17 @@ namespace etk
|
||||
* Note return values are 0,1,2 for x, y, or z
|
||||
*/
|
||||
/*
|
||||
int32_t maxAxis(void) const
|
||||
int32_t maxAxis() const
|
||||
{
|
||||
return m_floats[0] < m_floats[1] ? (m_floats[1] <m_floats[2] ? 2 : 1) : (m_floats[0] <m_floats[2] ? 2 : 0);
|
||||
}
|
||||
|
||||
int32_t furthestAxis(void) const
|
||||
int32_t furthestAxis() const
|
||||
{
|
||||
return absolute().minAxis();
|
||||
}
|
||||
|
||||
int32_t closestAxis(void) const
|
||||
int32_t closestAxis() const
|
||||
{
|
||||
return absolute().maxAxis();
|
||||
}
|
||||
@ -453,12 +453,12 @@ namespace etk
|
||||
v2->setValue(-y() ,x() ,0.);
|
||||
}
|
||||
*/
|
||||
void setZero(void)
|
||||
void setZero()
|
||||
{
|
||||
setValue(0,0,0,0);
|
||||
}
|
||||
|
||||
bool isZero(void) const
|
||||
bool isZero() const
|
||||
{
|
||||
return m_floats[0] == 0 && m_floats[1] == 0 && m_floats[2] == 0 && m_floats[3] == 0;
|
||||
}
|
||||
|
@ -205,7 +205,7 @@ void etk::setArgZero(const std::string& _val) {
|
||||
Note that it is up to the calling process to set argv[0] correctly. It is right most of the times however there are occasions when the calling process cannot be trusted (ex. setuid executable).
|
||||
On Windows: use GetModuleFileName(NULL, buf, bufsize)
|
||||
*/
|
||||
std::string getApplicationPath(void) {
|
||||
std::string getApplicationPath() {
|
||||
std::string binaryName = "no-name";
|
||||
char binaryCompleatePath[FILENAME_MAX];
|
||||
memset(binaryCompleatePath, 0, FILENAME_MAX);
|
||||
@ -274,7 +274,7 @@ std::string getApplicationPath(void) {
|
||||
TK_INFO("Binary name : " << binaryName);
|
||||
return binaryName;
|
||||
}
|
||||
std::u32string getUApplicationPath(void) {
|
||||
std::u32string getUApplicationPath() {
|
||||
return to_u32string(getApplicationPath());
|
||||
}
|
||||
|
||||
@ -383,23 +383,23 @@ void etk::initDefaultFolder(const char* _applName) {
|
||||
TK_INFO("baseFolderCache : '" << baseFolderCache << "'");
|
||||
}
|
||||
|
||||
std::string etk::getUserHomeFolder(void) {
|
||||
std::string etk::getUserHomeFolder() {
|
||||
return baseFolderHome;
|
||||
}
|
||||
std::u32string etk::getUUserHomeFolder(void) {
|
||||
std::u32string etk::getUUserHomeFolder() {
|
||||
return to_u32string(baseFolderHome);
|
||||
}
|
||||
|
||||
std::string etk::getUserRunFolder(void) {
|
||||
std::string etk::getUserRunFolder() {
|
||||
return baseRunPath;
|
||||
}
|
||||
std::u32string etk::getUUserRunFolder(void) {
|
||||
std::u32string etk::getUUserRunFolder() {
|
||||
return to_u32string(baseRunPath);
|
||||
}
|
||||
|
||||
|
||||
#ifdef __TARGET_OS__Android
|
||||
bool etk::FSNode::loadDataZip(void)
|
||||
bool etk::FSNode::loadDataZip()
|
||||
{
|
||||
if (NULL == s_APKArchive) {
|
||||
return false;
|
||||
@ -500,7 +500,7 @@ etk::FSNode::FSNode(const std::u32string& _nodeName) :
|
||||
}
|
||||
|
||||
|
||||
etk::FSNode::~FSNode(void) {
|
||||
etk::FSNode::~FSNode() {
|
||||
if( NULL != m_PointerFile
|
||||
#ifdef __TARGET_OS__Android
|
||||
|| NULL != m_zipContent
|
||||
@ -725,7 +725,7 @@ bool directCheckFile(std::u32string _tmpFileNameDirect, bool _checkInAPKIfNeeded
|
||||
return directCheckFile(std::to_string(_tmpFileNameDirect));
|
||||
}
|
||||
// Now we generate the real FS path:
|
||||
void etk::FSNode::generateFileSystemPath(void) {
|
||||
void etk::FSNode::generateFileSystemPath() {
|
||||
switch (m_type) {
|
||||
default:
|
||||
case etk::FSN_TYPE_UNKNOW:
|
||||
@ -820,7 +820,7 @@ void etk::FSNode::generateFileSystemPath(void) {
|
||||
|
||||
|
||||
// now we get all the right if the file existed:
|
||||
void etk::FSNode::updateFileSystemProperty(void) {
|
||||
void etk::FSNode::updateFileSystemProperty() {
|
||||
// clean general properties :
|
||||
m_rights.clear();
|
||||
m_timeCreate = 0;
|
||||
@ -918,25 +918,25 @@ void etk::FSNode::setName(const std::u32string& _newName) {
|
||||
privateSetName(_newName);
|
||||
}
|
||||
|
||||
std::string etk::FSNode::getNameFolder(void) const {
|
||||
std::string etk::FSNode::getNameFolder() const {
|
||||
size_t lastPos = m_systemFileName.rfind('/');
|
||||
if (lastPos != std::string::npos) {
|
||||
return std::string(m_systemFileName, 0, lastPos);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
std::u32string etk::FSNode::getUNameFolder(void) const {
|
||||
std::u32string etk::FSNode::getUNameFolder() const {
|
||||
return to_u32string(getNameFolder());
|
||||
}
|
||||
|
||||
std::string etk::FSNode::getFileSystemName(void) const {
|
||||
std::string etk::FSNode::getFileSystemName() const {
|
||||
return m_systemFileName;
|
||||
}
|
||||
std::u32string etk::FSNode::getUFileSystemName(void) const {
|
||||
std::u32string etk::FSNode::getUFileSystemName() const {
|
||||
return to_u32string(getFileSystemName());
|
||||
}
|
||||
|
||||
std::string etk::FSNode::getName(void) const {
|
||||
std::string etk::FSNode::getName() const {
|
||||
std::string output;
|
||||
switch (m_type) {
|
||||
default:
|
||||
@ -969,22 +969,22 @@ std::string etk::FSNode::getName(void) const {
|
||||
output += m_userFileName;
|
||||
return output;
|
||||
}
|
||||
std::u32string etk::FSNode::getUName(void) const {
|
||||
std::u32string etk::FSNode::getUName() const {
|
||||
return to_u32string(getName());
|
||||
}
|
||||
|
||||
std::string etk::FSNode::getNameFile(void) const {
|
||||
std::string etk::FSNode::getNameFile() const {
|
||||
size_t lastPos = m_systemFileName.rfind('/');
|
||||
if (lastPos != std::string::npos) {
|
||||
return std::string(m_systemFileName, lastPos+1);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
std::u32string etk::FSNode::getUNameFile(void) const {
|
||||
std::u32string etk::FSNode::getUNameFile() const {
|
||||
return to_u32string(getNameFile());
|
||||
}
|
||||
|
||||
std::string etk::FSNode::getRelativeFolder(void) const {
|
||||
std::string etk::FSNode::getRelativeFolder() const {
|
||||
std::string tmppp = getName();
|
||||
TK_DBG_MODE("get REF folder : " << tmppp );
|
||||
switch (m_typeNode) {
|
||||
@ -1022,12 +1022,12 @@ std::string etk::FSNode::getRelativeFolder(void) const {
|
||||
TK_DBG_MODE(" ==> : ''" );
|
||||
return "";
|
||||
}
|
||||
std::u32string etk::FSNode::getURelativeFolder(void) const {
|
||||
std::u32string etk::FSNode::getURelativeFolder() const {
|
||||
return to_u32string(getRelativeFolder());
|
||||
}
|
||||
|
||||
|
||||
bool etk::FSNode::touch(void) {
|
||||
bool etk::FSNode::touch() {
|
||||
TK_DEBUG("Touch FILE : " << getName());
|
||||
//just open in write an close ==> this will update the time
|
||||
if (fileOpenAppend() == false) {
|
||||
@ -1056,7 +1056,7 @@ bool etk::FSNode::move(const std::u32string& _path) {
|
||||
return move(std::to_string(_path));
|
||||
}
|
||||
|
||||
bool etk::FSNode::remove(void) {
|
||||
bool etk::FSNode::remove() {
|
||||
if (getNodeType()==etk::FSN_FOLDER) {
|
||||
// remove the folder
|
||||
if( 0!=rmdir(m_systemFileName.c_str()) ) {
|
||||
@ -1075,11 +1075,11 @@ bool etk::FSNode::remove(void) {
|
||||
return true;
|
||||
}
|
||||
|
||||
uint64_t etk::FSNode::timeCreated(void) const {
|
||||
uint64_t etk::FSNode::timeCreated() const {
|
||||
return m_timeCreate;
|
||||
}
|
||||
|
||||
std::string etk::FSNode::timeCreatedString(void) const {
|
||||
std::string etk::FSNode::timeCreatedString() const {
|
||||
time_t tmpVal = (int32_t)m_timeCreate;
|
||||
std::string tmpTime = ctime(&tmpVal);
|
||||
if (tmpTime[tmpTime.size()-1] == '\n') {
|
||||
@ -1087,15 +1087,15 @@ std::string etk::FSNode::timeCreatedString(void) const {
|
||||
}
|
||||
return tmpTime;
|
||||
}
|
||||
std::u32string etk::FSNode::timeUCreatedString(void) const {
|
||||
std::u32string etk::FSNode::timeUCreatedString() const {
|
||||
return to_u32string(timeCreatedString());
|
||||
}
|
||||
|
||||
uint64_t etk::FSNode::timeModified(void) const {
|
||||
uint64_t etk::FSNode::timeModified() const {
|
||||
return m_timeModify;
|
||||
}
|
||||
|
||||
std::string etk::FSNode::timeModifiedString(void) const {
|
||||
std::string etk::FSNode::timeModifiedString() const {
|
||||
time_t tmpVal = (int32_t)m_timeModify;
|
||||
std::string tmpTime = ctime(&tmpVal);
|
||||
if (tmpTime[tmpTime.size()-1] == '\n') {
|
||||
@ -1103,15 +1103,15 @@ std::string etk::FSNode::timeModifiedString(void) const {
|
||||
}
|
||||
return tmpTime;
|
||||
}
|
||||
std::u32string etk::FSNode::timeUModifiedString(void) const {
|
||||
std::u32string etk::FSNode::timeUModifiedString() const {
|
||||
return to_u32string(timeModifiedString());
|
||||
}
|
||||
|
||||
uint64_t etk::FSNode::timeAccessed(void) const {
|
||||
uint64_t etk::FSNode::timeAccessed() const {
|
||||
return m_timeAccess;
|
||||
}
|
||||
|
||||
std::string etk::FSNode::timeAccessedString(void) const {
|
||||
std::string etk::FSNode::timeAccessedString() const {
|
||||
time_t tmpVal = (int32_t)m_timeAccess;
|
||||
std::string tmpTime = ctime(&tmpVal);
|
||||
if (tmpTime[tmpTime.size()-1] == '\n') {
|
||||
@ -1119,7 +1119,7 @@ std::string etk::FSNode::timeAccessedString(void) const {
|
||||
}
|
||||
return tmpTime;
|
||||
}
|
||||
std::u32string etk::FSNode::timeUAccessedString(void) const {
|
||||
std::u32string etk::FSNode::timeUAccessedString() const {
|
||||
return to_u32string(timeAccessedString());
|
||||
}
|
||||
/*
|
||||
@ -1243,7 +1243,7 @@ std::ostream& etk::operator <<(std::ostream &_os, const enum etk::typeNode &_obj
|
||||
/*
|
||||
Folder specific :
|
||||
*/
|
||||
int64_t etk::FSNode::folderCount(void) {
|
||||
int64_t etk::FSNode::folderCount() {
|
||||
int64_t counter=0;
|
||||
DIR *dir = NULL;
|
||||
struct dirent *ent = NULL;
|
||||
@ -1362,7 +1362,7 @@ std::vector<etk::FSNode *> etk::FSNode::folderGetSubList(bool _showHidenFile, bo
|
||||
return tmpp;
|
||||
}
|
||||
|
||||
etk::FSNode etk::FSNode::folderGetParent(void) {
|
||||
etk::FSNode etk::FSNode::folderGetParent() {
|
||||
etk::FSNode tmpp;
|
||||
return tmpp;
|
||||
}
|
||||
@ -1447,7 +1447,7 @@ void etk::FSNode::folderGetRecursiveFiles(std::vector<std::u32string>& _output,
|
||||
/*
|
||||
File Specific :
|
||||
*/
|
||||
bool etk::FSNode::fileHasExtention(void) {
|
||||
bool etk::FSNode::fileHasExtention() {
|
||||
size_t lastPos = m_userFileName.rfind('.');
|
||||
if( lastPos != std::string::npos // Find a . at the fist position .jdlskjdfklj ==> hiden file
|
||||
&& m_userFileName.size() != lastPos ) { // Remove file ended with .
|
||||
@ -1457,7 +1457,7 @@ bool etk::FSNode::fileHasExtention(void) {
|
||||
}
|
||||
}
|
||||
|
||||
std::string etk::FSNode::fileGetExtention(void) {
|
||||
std::string etk::FSNode::fileGetExtention() {
|
||||
size_t lastPos = m_userFileName.rfind('.');
|
||||
if( lastPos != std::string::npos // Find a . at the fist position .jdlskjdfklj ==> hiden file
|
||||
&& m_userFileName.size() != lastPos ) { // Remove file ended with .
|
||||
@ -1466,11 +1466,11 @@ std::string etk::FSNode::fileGetExtention(void) {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
std::u32string etk::FSNode::fileUGetExtention(void) {
|
||||
std::u32string etk::FSNode::fileUGetExtention() {
|
||||
return to_u32string(fileGetExtention());
|
||||
}
|
||||
|
||||
uint64_t etk::FSNode::fileSize(void) {
|
||||
uint64_t etk::FSNode::fileSize() {
|
||||
if (etk::FSN_FILE != m_typeNode) {
|
||||
TK_ERROR("Request size of a non file node : " << m_typeNode);
|
||||
return 0;
|
||||
@ -1500,7 +1500,7 @@ uint64_t etk::FSNode::fileSize(void) {
|
||||
}
|
||||
|
||||
|
||||
bool etk::FSNode::fileOpenRead(void) {
|
||||
bool etk::FSNode::fileOpenRead() {
|
||||
#ifdef __TARGET_OS__Android
|
||||
if( etk::FSN_TYPE_DATA == m_type
|
||||
|| etk::FSN_TYPE_THEME_DATA == m_type) {
|
||||
@ -1523,7 +1523,7 @@ bool etk::FSNode::fileOpenRead(void) {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
bool etk::FSNode::fileOpenWrite(void) {
|
||||
bool etk::FSNode::fileOpenWrite() {
|
||||
#ifdef __TARGET_OS__Android
|
||||
if( etk::FSN_TYPE_DATA == m_type
|
||||
|| etk::FSN_TYPE_THEME_DATA == m_type) {
|
||||
@ -1544,7 +1544,7 @@ bool etk::FSNode::fileOpenWrite(void) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool etk::FSNode::fileOpenAppend(void) {
|
||||
bool etk::FSNode::fileOpenAppend() {
|
||||
#ifdef __TARGET_OS__Android
|
||||
if( etk::FSN_TYPE_DATA == m_type
|
||||
|| etk::FSN_TYPE_THEME_DATA == m_type) {
|
||||
@ -1567,7 +1567,7 @@ bool etk::FSNode::fileOpenAppend(void) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool etk::FSNode::fileClose(void) {
|
||||
bool etk::FSNode::fileClose() {
|
||||
#ifdef __TARGET_OS__Android
|
||||
if( etk::FSN_TYPE_DATA == m_type
|
||||
|| etk::FSN_TYPE_THEME_DATA == m_type) {
|
||||
@ -1639,7 +1639,7 @@ char* etk::FSNode::fileGets(char* _elementLine, int64_t _maxData) {
|
||||
return fgets(_elementLine, _maxData, m_PointerFile);
|
||||
}
|
||||
|
||||
char etk::FSNode::fileGet(void) {
|
||||
char etk::FSNode::fileGet() {
|
||||
char data='\0';
|
||||
if (fileRead(&data, 1, 1)!=1) {
|
||||
return '\0';
|
||||
@ -1755,7 +1755,7 @@ bool etk::FSNode::fileSeek(long int _offset, enum etk::seekNode _origin)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
int64_t etk::FSNode::fileTell(void) {
|
||||
int64_t etk::FSNode::fileTell() {
|
||||
#ifdef __TARGET_OS__Android
|
||||
if( m_type == etk::FSN_TYPE_DATA
|
||||
|| m_type == etk::FSN_TYPE_THEME_DATA) {
|
||||
@ -1769,7 +1769,7 @@ int64_t etk::FSNode::fileTell(void) {
|
||||
|
||||
}
|
||||
|
||||
void etk::FSNode::fileFlush(void) {
|
||||
void etk::FSNode::fileFlush() {
|
||||
#ifdef __TARGET_OS__Android
|
||||
if( m_type == etk::FSN_TYPE_DATA
|
||||
|| m_type == etk::FSN_TYPE_THEME_DATA) {
|
||||
@ -1810,14 +1810,14 @@ std::u32string etk::theme::getName(const std::u32string& _refName) {
|
||||
}
|
||||
|
||||
// get the list of all the theme folder availlable in the user Home/appl
|
||||
std::vector<std::string> etk::theme::list(void) {
|
||||
std::vector<std::string> etk::theme::list() {
|
||||
std::vector<std::string> keys;
|
||||
for (auto &it : g_listTheme) {
|
||||
keys.push_back(it.first);
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
std::vector<std::u32string> etk::theme::listU(void) {
|
||||
std::vector<std::u32string> etk::theme::listU() {
|
||||
std::vector<std::u32string> keys;
|
||||
for (auto &it : g_listTheme) {
|
||||
keys.push_back(std::to_u32string(it.first));
|
||||
|
@ -147,16 +147,16 @@ namespace etk {
|
||||
* @brief Destructor
|
||||
* @note you will have some warning if you did not close your files
|
||||
*/
|
||||
~FSNode(void);
|
||||
~FSNode();
|
||||
private:
|
||||
/**
|
||||
* @brief Internal methode that create the internal Real system name (transform DATA: HOME: DATA:GUI: in the real name of the files)
|
||||
*/
|
||||
void generateFileSystemPath(void);
|
||||
void generateFileSystemPath();
|
||||
/**
|
||||
* @brief Update the internal data of the right type, and times
|
||||
*/
|
||||
void updateFileSystemProperty(void);
|
||||
void updateFileSystemProperty();
|
||||
/**
|
||||
* @brief Common set name of the Node (if the user decide to change the node selection
|
||||
* @param[in] _newName Name of the Node
|
||||
@ -170,7 +170,7 @@ namespace etk {
|
||||
* @return true : Load is OK
|
||||
* @return false : An error Occured
|
||||
*/
|
||||
bool loadDataZip(void);
|
||||
bool loadDataZip();
|
||||
const etk::Archive::Content* m_zipContent;
|
||||
int32_t m_zipReadingOffset;
|
||||
#endif
|
||||
@ -180,21 +180,21 @@ namespace etk {
|
||||
* @return true : The node existed.
|
||||
* @return false : The node does not exist.
|
||||
*/
|
||||
bool exist(void) const {
|
||||
bool exist() const {
|
||||
return (m_typeNode!=etk::FSN_UNKNOW);
|
||||
};
|
||||
/**
|
||||
* @brief Get the node type
|
||||
* @return the requested type, FSN_UNKNOW if it does not existed
|
||||
*/
|
||||
enum typeNode getNodeType(void) const {
|
||||
enum typeNode getNodeType() const {
|
||||
return m_typeNode;
|
||||
};
|
||||
/**
|
||||
* @brief Get the node Right
|
||||
* @return the requested right
|
||||
*/
|
||||
etk::FSNodeRight getRight(void) const {
|
||||
etk::FSNodeRight getRight() const {
|
||||
return m_rights;
|
||||
};
|
||||
/**
|
||||
@ -216,41 +216,41 @@ namespace etk {
|
||||
* @brief Get the Generate FileSystem name
|
||||
* @return the requested filename
|
||||
*/
|
||||
std::string getFileSystemName(void) const;
|
||||
std::u32string getUFileSystemName(void) const;
|
||||
std::string getFileSystemName() const;
|
||||
std::u32string getUFileSystemName() const;
|
||||
/**
|
||||
* @brief Get the current folder of the Node. (file system name)
|
||||
* @return the common name define (like /xxxxx/xxxxx/ or c:/xxxxx/xxxxx/)
|
||||
* @note Auto remove of ../../../ and //
|
||||
*/
|
||||
std::string getNameFolder(void) const;
|
||||
std::u32string getUNameFolder(void) const;
|
||||
std::string getNameFolder() const;
|
||||
std::u32string getUNameFolder() const;
|
||||
/**
|
||||
* @brief Get the current compleate node name (file system name)
|
||||
* @return All the user name definition (like /xxxxx/xxxxx/myFile.kkk or c:/xxxxx/xxxxx/myFile.kkk)
|
||||
* @note Auto remove of ../../../ and //
|
||||
*/
|
||||
std::string getName(void) const;
|
||||
std::u32string getUName(void) const;
|
||||
std::string getName() const;
|
||||
std::u32string getUName() const;
|
||||
/**
|
||||
* @brief Get the file or current file name (if it was a file)
|
||||
* @return the name of the node (like myFile.kkk)
|
||||
*/
|
||||
std::string getNameFile(void) const;
|
||||
std::u32string getUNameFile(void) const;
|
||||
std::string getNameFile() const;
|
||||
std::u32string getUNameFile() const;
|
||||
/**
|
||||
* @brief Get the current folder of the Node.
|
||||
* @return the common name define (like DATA:xxxxx/xxxxx/)
|
||||
* @note Auto remove of ../../../ and //
|
||||
*/
|
||||
std::string getRelativeFolder(void) const;
|
||||
std::u32string getURelativeFolder(void) const;
|
||||
std::string getRelativeFolder() const;
|
||||
std::u32string getURelativeFolder() const;
|
||||
/**
|
||||
* @brief update the Time of the file with the current time
|
||||
* @return true : action done
|
||||
* @return false : action not done
|
||||
*/
|
||||
bool touch(void);
|
||||
bool touch();
|
||||
/**
|
||||
* @brief Move the Node at a new path
|
||||
* @param[in] _path The new path
|
||||
@ -263,7 +263,7 @@ namespace etk {
|
||||
* @brief Get the node type (DATA/DIRECT...)
|
||||
* @return the requested type
|
||||
*/
|
||||
enum FSNType getTypeAccess(void) const {
|
||||
enum FSNType getTypeAccess() const {
|
||||
return m_type;
|
||||
};
|
||||
/**
|
||||
@ -271,40 +271,40 @@ namespace etk {
|
||||
* @return true : action done
|
||||
* @return false : action not done
|
||||
*/
|
||||
bool remove(void);
|
||||
bool remove();
|
||||
/**
|
||||
* @brief Get the creating time of the File
|
||||
* @return The time requested
|
||||
*/
|
||||
uint64_t timeCreated(void) const;
|
||||
uint64_t timeCreated() const;
|
||||
/**
|
||||
* @brief Get the creating time of the File
|
||||
* @return The time requested (in string)
|
||||
*/
|
||||
std::string timeCreatedString(void) const;
|
||||
std::u32string timeUCreatedString(void) const;
|
||||
std::string timeCreatedString() const;
|
||||
std::u32string timeUCreatedString() const;
|
||||
/**
|
||||
* @brief Get the modifying time of the File
|
||||
* @return The time requested
|
||||
*/
|
||||
uint64_t timeModified(void) const;
|
||||
uint64_t timeModified() const;
|
||||
/**
|
||||
* @brief Get the modifying time of the File
|
||||
* @return The time requested (in string)
|
||||
*/
|
||||
std::string timeModifiedString(void) const;
|
||||
std::u32string timeUModifiedString(void) const;
|
||||
std::string timeModifiedString() const;
|
||||
std::u32string timeUModifiedString() const;
|
||||
/**
|
||||
* @brief Get the Accessed time of the File
|
||||
* @return The time requested
|
||||
*/
|
||||
uint64_t timeAccessed(void) const;
|
||||
uint64_t timeAccessed() const;
|
||||
/**
|
||||
* @brief Get the Accessed time of the File
|
||||
* @return The time requested (in string)
|
||||
*/
|
||||
std::string timeAccessedString(void) const;
|
||||
std::u32string timeUAccessedString(void) const;
|
||||
std::string timeAccessedString() const;
|
||||
std::u32string timeUAccessedString() const;
|
||||
/**
|
||||
* @brief copy the other FSnode ==> for vector
|
||||
* @param[in] _obj input node
|
||||
@ -336,7 +336,7 @@ namespace etk {
|
||||
* @return >=0 nb of subElement
|
||||
* @return -1 an error occured ==> not a folder ???
|
||||
*/
|
||||
int64_t folderCount(void);
|
||||
int64_t folderCount();
|
||||
/**
|
||||
* @brief Get the List of all node inside a node (folder only)
|
||||
* @param[in] _showHidenFile Add hidden file/folder/...
|
||||
@ -353,7 +353,7 @@ namespace etk {
|
||||
* @brief Get the father node of this node
|
||||
* @return The requested node
|
||||
*/
|
||||
etk::FSNode folderGetParent(void);
|
||||
etk::FSNode folderGetParent();
|
||||
/**
|
||||
* @brief Get all the File inside a Folder (done recursively)
|
||||
* @param[out] _output List of all the File names (You must clear it before set it in)
|
||||
@ -366,44 +366,44 @@ namespace etk {
|
||||
* @return true The file have an extention.
|
||||
* @return false The file have NO extention.
|
||||
*/
|
||||
bool fileHasExtention(void);
|
||||
bool fileHasExtention();
|
||||
/**
|
||||
* @brief Get the extention of the Node
|
||||
* @return the requested extention
|
||||
*/
|
||||
std::string fileGetExtention(void);
|
||||
std::u32string fileUGetExtention(void);
|
||||
std::string fileGetExtention();
|
||||
std::u32string fileUGetExtention();
|
||||
/**
|
||||
* @brief Get the File size
|
||||
* @return the requested size
|
||||
*/
|
||||
uint64_t fileSize(void);
|
||||
uint64_t fileSize();
|
||||
/**
|
||||
* @brief Open the file in Read mode
|
||||
* @return true : action done
|
||||
* @return false : action not done
|
||||
*/
|
||||
bool fileOpenRead(void);
|
||||
bool fileOpenRead();
|
||||
/**
|
||||
* @brief Open the file in write Mode
|
||||
* @note You can not do it with the DATA: file ==> this is not allowed in some Board like Android)
|
||||
* @return true : action done
|
||||
* @return false : action not done
|
||||
*/
|
||||
bool fileOpenWrite(void);
|
||||
bool fileOpenWrite();
|
||||
/**
|
||||
* @brief Open the file in write Append Mode
|
||||
* @note You can not do it with the DATA: file ==> this is not allowed in some Board like Android)
|
||||
* @return true : action done
|
||||
* @return false : action not done
|
||||
*/
|
||||
bool fileOpenAppend(void);
|
||||
bool fileOpenAppend();
|
||||
/**
|
||||
* @brief Close the cuurent file
|
||||
* @return true : action done
|
||||
* @return false : action not done
|
||||
*/
|
||||
bool fileClose(void);
|
||||
bool fileClose();
|
||||
/**
|
||||
* @brief Get the pointer on the start line and the next line (or null)
|
||||
* @param[in,out] _elementLine Pointer to an array of chars where the string read is copied.
|
||||
@ -415,7 +415,7 @@ namespace etk {
|
||||
* @brief Get a unique data in the file
|
||||
* @return the next element in the file.
|
||||
*/
|
||||
char fileGet(void);
|
||||
char fileGet();
|
||||
/**
|
||||
* @brief Get a compleate line in a text file
|
||||
* @param[out] _output the next element in the file.
|
||||
@ -457,7 +457,7 @@ namespace etk {
|
||||
* @brief Get the position in the file.
|
||||
* @return the requested position.
|
||||
*/
|
||||
int64_t fileTell(void);
|
||||
int64_t fileTell();
|
||||
/**
|
||||
* @brief Move in the file Position
|
||||
* @param[in] _offset Offset to apply at the file
|
||||
@ -469,7 +469,7 @@ namespace etk {
|
||||
/**
|
||||
* @brief Flush the current file
|
||||
*/
|
||||
void fileFlush(void);
|
||||
void fileFlush();
|
||||
private:
|
||||
/**
|
||||
* @brief Order the list of subnode the folder first and the alphabetical order
|
||||
@ -504,14 +504,14 @@ namespace etk {
|
||||
* @brief Get the home folder of the user
|
||||
* @return the home folder : like : "/home/machin/"
|
||||
*/
|
||||
std::string getUserHomeFolder(void);
|
||||
std::u32string getUUserHomeFolder(void);
|
||||
std::string getUserHomeFolder();
|
||||
std::u32string getUUserHomeFolder();
|
||||
/**
|
||||
* @brief Get the folder of the Program is running
|
||||
* @return the basic folder name (ex : run ./appl in the pwd=/home/machin/sousFolder ==> this return the pwd folder)
|
||||
*/
|
||||
std::string getUserRunFolder(void);
|
||||
std::u32string getUUserRunFolder(void);
|
||||
std::string getUserRunFolder();
|
||||
std::u32string getUUserRunFolder();
|
||||
|
||||
namespace theme {
|
||||
// TODO : Add an INIT ...
|
||||
@ -552,9 +552,9 @@ namespace etk {
|
||||
* @brief Get the list of all the theme folder availlable in the user Home/appl
|
||||
* @return The list of elements
|
||||
*/
|
||||
std::vector<std::string> list(void);
|
||||
std::vector<std::string> list();
|
||||
//! @previous
|
||||
std::vector<std::u32string> listU(void);
|
||||
std::vector<std::u32string> listU();
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -22,7 +22,7 @@ enum {
|
||||
RIGHT_USER_READ = 1 << 8,
|
||||
};
|
||||
|
||||
etk::FSNodeRight::FSNodeRight(void) :
|
||||
etk::FSNodeRight::FSNodeRight() :
|
||||
m_rights(0)
|
||||
{
|
||||
|
||||
@ -47,17 +47,17 @@ const etk::FSNodeRight& etk::FSNodeRight::operator= (const int32_t _newVal )
|
||||
}
|
||||
|
||||
// User
|
||||
bool etk::FSNodeRight::isUserReadable(void) const
|
||||
bool etk::FSNodeRight::isUserReadable() const
|
||||
{
|
||||
return ((m_rights&RIGHT_USER_READ)!=0)?true:false;
|
||||
}
|
||||
|
||||
bool etk::FSNodeRight::isUserWritable(void) const
|
||||
bool etk::FSNodeRight::isUserWritable() const
|
||||
{
|
||||
return ((m_rights&RIGHT_USER_WRITE)!=0)?true:false;
|
||||
}
|
||||
|
||||
bool etk::FSNodeRight::isUserRunable(void) const
|
||||
bool etk::FSNodeRight::isUserRunable() const
|
||||
{
|
||||
return ((m_rights&RIGHT_USER_EXECUTE)!=0)?true:false;
|
||||
}
|
||||
@ -90,17 +90,17 @@ void etk::FSNodeRight::setUserRunable(bool _newStatus)
|
||||
}
|
||||
|
||||
// group
|
||||
bool etk::FSNodeRight::isGroupReadable(void) const
|
||||
bool etk::FSNodeRight::isGroupReadable() const
|
||||
{
|
||||
return ((m_rights&RIGHT_GROUP_READ)!=0)?true:false;
|
||||
}
|
||||
|
||||
bool etk::FSNodeRight::isGroupWritable(void) const
|
||||
bool etk::FSNodeRight::isGroupWritable() const
|
||||
{
|
||||
return ((m_rights&RIGHT_GROUP_WRITE)!=0)?true:false;
|
||||
}
|
||||
|
||||
bool etk::FSNodeRight::isGroupRunable(void) const
|
||||
bool etk::FSNodeRight::isGroupRunable() const
|
||||
{
|
||||
return ((m_rights&RIGHT_GROUP_EXECUTE)!=0)?true:false;
|
||||
}
|
||||
@ -133,17 +133,17 @@ void etk::FSNodeRight::setGroupRunable(bool _newStatus)
|
||||
}
|
||||
|
||||
// other
|
||||
bool etk::FSNodeRight::isOtherReadable(void) const
|
||||
bool etk::FSNodeRight::isOtherReadable() const
|
||||
{
|
||||
return ((m_rights&RIGHT_OTHER_READ) != 0)?true:false;
|
||||
}
|
||||
|
||||
bool etk::FSNodeRight::isOtherWritable(void) const
|
||||
bool etk::FSNodeRight::isOtherWritable() const
|
||||
{
|
||||
return ((m_rights&RIGHT_OTHER_WRITE) != 0)?true:false;
|
||||
}
|
||||
|
||||
bool etk::FSNodeRight::isOtherRunable(void) const
|
||||
bool etk::FSNodeRight::isOtherRunable() const
|
||||
{
|
||||
return ((m_rights&RIGHT_OTHER_EXECUTE) != 0)?true:false;
|
||||
}
|
||||
@ -175,11 +175,11 @@ void etk::FSNodeRight::setOtherRunable(bool _newStatus)
|
||||
}
|
||||
}
|
||||
|
||||
std::u32string etk::FSNodeRight::getURight(void) const {
|
||||
std::u32string etk::FSNodeRight::getURight() const {
|
||||
return to_u32string(getRight());
|
||||
}
|
||||
|
||||
std::string etk::FSNodeRight::getRight(void) const {
|
||||
std::string etk::FSNodeRight::getRight() const {
|
||||
std::string tmp;
|
||||
if (isUserReadable() == true) {
|
||||
tmp += "r";
|
||||
|
@ -16,41 +16,41 @@ namespace etk {
|
||||
private:
|
||||
uint16_t m_rights;
|
||||
public:
|
||||
FSNodeRight(void);
|
||||
FSNodeRight();
|
||||
FSNodeRight(int16_t _newRight);
|
||||
~FSNodeRight(void) { };
|
||||
~FSNodeRight() { };
|
||||
// copy operator :
|
||||
const etk::FSNodeRight& operator= (const etk::FSNodeRight &_obj );
|
||||
// set right :
|
||||
const etk::FSNodeRight& operator= (const int32_t _newVal );
|
||||
|
||||
void clear(void) {
|
||||
void clear() {
|
||||
m_rights = 0;
|
||||
};
|
||||
// User
|
||||
bool isUserReadable(void) const;
|
||||
bool isUserWritable(void) const;
|
||||
bool isUserRunable(void) const;
|
||||
bool isUserReadable() const;
|
||||
bool isUserWritable() const;
|
||||
bool isUserRunable() const;
|
||||
void setUserReadable(bool _newStatus);
|
||||
void setUserWritable(bool _newStatus);
|
||||
void setUserRunable(bool _newStatus);
|
||||
// group
|
||||
bool isGroupReadable(void) const;
|
||||
bool isGroupWritable(void) const;
|
||||
bool isGroupRunable(void) const;
|
||||
bool isGroupReadable() const;
|
||||
bool isGroupWritable() const;
|
||||
bool isGroupRunable() const;
|
||||
void setGroupReadable(bool _newStatus);
|
||||
void setGroupWritable(bool _newStatus);
|
||||
void setGroupRunable(bool _newStatus);
|
||||
// other
|
||||
bool isOtherReadable(void) const;
|
||||
bool isOtherWritable(void) const;
|
||||
bool isOtherRunable(void) const;
|
||||
bool isOtherReadable() const;
|
||||
bool isOtherWritable() const;
|
||||
bool isOtherRunable() const;
|
||||
void setOtherReadable(bool _newStatus);
|
||||
void setOtherWritable(bool _newStatus);
|
||||
void setOtherRunable(bool _newStatus);
|
||||
|
||||
std::u32string getURight(void) const;
|
||||
std::string getRight(void) const;
|
||||
std::u32string getURight() const;
|
||||
std::string getRight() const;
|
||||
};
|
||||
std::ostream& operator <<(std::ostream &_os, const etk::FSNodeRight &_obj);
|
||||
};
|
||||
|
@ -30,13 +30,13 @@ namespace etk {
|
||||
/**
|
||||
* @brief Create a fifo with no message.
|
||||
*/
|
||||
Fifo(void) {
|
||||
Fifo() {
|
||||
// nothing to do ...
|
||||
};
|
||||
/**
|
||||
* @brief Remove the fifo and all message inside.
|
||||
*/
|
||||
~Fifo(void) {
|
||||
~Fifo() {
|
||||
// nothing to do ...
|
||||
};
|
||||
/**
|
||||
@ -98,7 +98,7 @@ namespace etk {
|
||||
* @brief Get the number of message in the fifo.
|
||||
* @return Number of message in the fifo.
|
||||
*/
|
||||
int32_t count(void) {
|
||||
int32_t count() {
|
||||
m_mutex.lock();
|
||||
int32_t nbElement = m_data.size();
|
||||
m_mutex.unLock();
|
||||
@ -117,7 +117,7 @@ namespace etk {
|
||||
/**
|
||||
* @brief Remove all the message in the fifo.
|
||||
*/
|
||||
void clean(void) {
|
||||
void clean() {
|
||||
m_mutex.lock();
|
||||
// remove data
|
||||
m_data.clear();
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <etk/os/Mutex.h>
|
||||
#include <etk/debug.h>
|
||||
|
||||
etk::Mutex::Mutex(void)
|
||||
etk::Mutex::Mutex()
|
||||
{
|
||||
// create interface mutex :
|
||||
int ret = pthread_mutex_init(&m_mutex, NULL);
|
||||
@ -18,7 +18,7 @@ etk::Mutex::Mutex(void)
|
||||
}
|
||||
|
||||
|
||||
etk::Mutex::~Mutex(void)
|
||||
etk::Mutex::~Mutex()
|
||||
{
|
||||
// Remove mutex
|
||||
int ret = pthread_mutex_destroy(&m_mutex);
|
||||
@ -26,19 +26,19 @@ etk::Mutex::~Mutex(void)
|
||||
}
|
||||
|
||||
|
||||
void etk::Mutex::lock(void)
|
||||
void etk::Mutex::lock()
|
||||
{
|
||||
pthread_mutex_lock(&m_mutex);
|
||||
}
|
||||
|
||||
|
||||
bool etk::Mutex::tryLock(void)
|
||||
bool etk::Mutex::tryLock()
|
||||
{
|
||||
return pthread_mutex_trylock(&m_mutex) != 0;
|
||||
}
|
||||
|
||||
|
||||
void etk::Mutex::unLock(void)
|
||||
void etk::Mutex::unLock()
|
||||
{
|
||||
pthread_mutex_unlock(&m_mutex);
|
||||
}
|
||||
|
@ -9,31 +9,31 @@
|
||||
|
||||
#include <etk/os/Mutex.h>
|
||||
|
||||
etk::Mutex::Mutex(void)
|
||||
etk::Mutex::Mutex()
|
||||
{
|
||||
InitializeCriticalSection(&m_mutex);
|
||||
}
|
||||
|
||||
|
||||
etk::Mutex::~Mutex(void)
|
||||
etk::Mutex::~Mutex()
|
||||
{
|
||||
DeleteCriticalSection(&m_mutex);
|
||||
}
|
||||
|
||||
|
||||
void etk::Mutex::lock(void)
|
||||
void etk::Mutex::lock()
|
||||
{
|
||||
EnterCriticalSection(&m_mutex);
|
||||
}
|
||||
|
||||
|
||||
bool etk::Mutex::tryLock(void)
|
||||
bool etk::Mutex::tryLock()
|
||||
{
|
||||
return TryEnterCriticalSection(&m_mutex) != 0;
|
||||
}
|
||||
|
||||
|
||||
void etk::Mutex::unLock(void)
|
||||
void etk::Mutex::unLock()
|
||||
{
|
||||
LeaveCriticalSection(&m_mutex);
|
||||
}
|
||||
|
@ -32,25 +32,25 @@ namespace etk {
|
||||
/**
|
||||
* @brief Create a new mutex
|
||||
*/
|
||||
Mutex(void);
|
||||
Mutex();
|
||||
/**
|
||||
* @brief Destroy the mutex.
|
||||
*/
|
||||
~Mutex(void);
|
||||
~Mutex();
|
||||
/**
|
||||
* @brief Lock the mutex (Wait while the mutex is not lock)
|
||||
*/
|
||||
void lock(void);
|
||||
void lock();
|
||||
/**
|
||||
* @brief Try to lock the mutex (exit if mutex is already locked)
|
||||
* @return true The mutex is locked
|
||||
* @return false The mutex is already locked.
|
||||
*/
|
||||
bool tryLock(void);
|
||||
bool tryLock();
|
||||
/**
|
||||
* @brief Unloc the mutex
|
||||
*/
|
||||
void unLock(void);
|
||||
void unLock();
|
||||
};
|
||||
/**
|
||||
* @brief AutoLock and un-lock when exit fuction.
|
||||
@ -71,7 +71,7 @@ namespace etk {
|
||||
/**
|
||||
* @brief Destructor that Auto Unlock mutex when remove.
|
||||
*/
|
||||
virtual ~AutoLockMutex(void){
|
||||
virtual ~AutoLockMutex(){
|
||||
m_protect.unLock();
|
||||
}
|
||||
};
|
||||
|
@ -26,7 +26,7 @@ etk::Semaphore::Semaphore(uint32_t _nbBasicElement, uint32_t _nbMessageMax) {
|
||||
}
|
||||
|
||||
|
||||
etk::Semaphore::~Semaphore(void) {
|
||||
etk::Semaphore::~Semaphore() {
|
||||
// Remove condition
|
||||
int ret = pthread_cond_destroy(&m_condition);
|
||||
TK_ASSERT(ret == 0, "Error destroying Condition ...");
|
||||
@ -35,7 +35,7 @@ etk::Semaphore::~Semaphore(void) {
|
||||
TK_ASSERT(ret == 0, "Error destroying Mutex ...");
|
||||
}
|
||||
|
||||
uint32_t etk::Semaphore::getCount(void) {
|
||||
uint32_t etk::Semaphore::getCount() {
|
||||
int32_t tmpData = 0;
|
||||
pthread_mutex_lock(&m_mutex);
|
||||
tmpData = m_data;
|
||||
@ -43,7 +43,7 @@ uint32_t etk::Semaphore::getCount(void) {
|
||||
return tmpData;
|
||||
}
|
||||
|
||||
void etk::Semaphore::post(void) {
|
||||
void etk::Semaphore::post() {
|
||||
pthread_mutex_lock(&m_mutex);
|
||||
if (m_data>=m_maximum) {
|
||||
m_data = m_maximum;
|
||||
@ -56,7 +56,7 @@ void etk::Semaphore::post(void) {
|
||||
}
|
||||
|
||||
|
||||
void etk::Semaphore::wait(void) {
|
||||
void etk::Semaphore::wait() {
|
||||
pthread_mutex_lock(&m_mutex);
|
||||
while(m_data == 0) {
|
||||
pthread_cond_wait(&m_condition, &m_mutex);
|
||||
|
@ -16,22 +16,22 @@ etk::Semaphore::Semaphore(uint32_t _nbBasicElement, uint32_t _nbMessageMax) {
|
||||
}
|
||||
|
||||
|
||||
etk::Semaphore::~Semaphore(void) {
|
||||
etk::Semaphore::~Semaphore() {
|
||||
CloseHandle(m_semaphore);
|
||||
}
|
||||
|
||||
uint32_t etk::Semaphore::getCount(void) {
|
||||
uint32_t etk::Semaphore::getCount() {
|
||||
LONG tmpData = 0;
|
||||
releaseSemaphore(m_semaphore, 0, &tmpData);
|
||||
return tmpData;
|
||||
}
|
||||
|
||||
void etk::Semaphore::post(void) {
|
||||
void etk::Semaphore::post() {
|
||||
releaseSemaphore(m_semaphore, 1, NULL);
|
||||
}
|
||||
|
||||
|
||||
void etk::Semaphore::wait(void) {
|
||||
void etk::Semaphore::wait() {
|
||||
waitForSingleObject(m_semaphore, INFINITE);
|
||||
}
|
||||
|
||||
|
@ -41,20 +41,20 @@ namespace etk {
|
||||
/**
|
||||
* @brief Generic destructor.
|
||||
*/
|
||||
~Semaphore(void);
|
||||
~Semaphore();
|
||||
/**
|
||||
* @brief Get the number of element in the semaphore.
|
||||
* @return Number of stored elements.
|
||||
*/
|
||||
uint32_t getCount(void);
|
||||
uint32_t getCount();
|
||||
/**
|
||||
* @brief Post a new semaphore
|
||||
*/
|
||||
void post(void);
|
||||
void post();
|
||||
/**
|
||||
* @brief Wait for a new semaphore post by an other thread.
|
||||
*/
|
||||
void wait(void);
|
||||
void wait();
|
||||
/**
|
||||
* @brief Wait for a new semaphore post by an other thread,
|
||||
* with a timeout in micro-second.
|
||||
|
@ -24,7 +24,7 @@ int32_t etk::tool::irand(int32_t _a, int32_t _b)
|
||||
return (int32_t)(( rand()/(double)RAND_MAX ) * ((double)_b-(double)_a) + (double)_a);
|
||||
}
|
||||
|
||||
void etk::tool::resetRandom(void) {
|
||||
void etk::tool::resetRandom() {
|
||||
srand(time(NULL));
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ namespace etk {
|
||||
/**
|
||||
* @brief Reset the random system with a random value (time).
|
||||
*/
|
||||
void resetRandom(void);
|
||||
void resetRandom();
|
||||
/**
|
||||
* @brief Reset the random system with The specify value.
|
||||
* @param[in] _val Seek value for the pseudo random system.
|
||||
|
@ -17,15 +17,15 @@
|
||||
#undef __class__
|
||||
#define __class__ "etktest"
|
||||
|
||||
void testVector(void) {
|
||||
void testVector() {
|
||||
|
||||
}
|
||||
|
||||
void testUChar(void) {
|
||||
void testUChar() {
|
||||
|
||||
}
|
||||
|
||||
void testHash(void) {
|
||||
void testHash() {
|
||||
TK_INFO("==> Start test of Hach table");
|
||||
etk::Hash<std::string> testData;
|
||||
testData.add("TEST", "testData");
|
||||
@ -43,7 +43,7 @@ void testHash(void) {
|
||||
TK_INFO("==> End test of Hach table");
|
||||
}
|
||||
|
||||
void testFSNode(void) {
|
||||
void testFSNode() {
|
||||
TK_INFO("==> Start test of FSNode");
|
||||
std::string fileName("USERDATA:myFileTest.txt");
|
||||
etk::FSNode myNodeTest1(fileName);
|
||||
@ -103,7 +103,7 @@ void testFSNode(void) {
|
||||
}
|
||||
|
||||
|
||||
void testArchive(void) {
|
||||
void testArchive() {
|
||||
TK_INFO("==> Start test of archive");
|
||||
etk::Archive* tmpArchive = etk::Archive::load("testzip.zip");
|
||||
tmpArchive->display();
|
||||
@ -112,7 +112,7 @@ void testArchive(void) {
|
||||
}
|
||||
|
||||
/*
|
||||
void testDimension(void) {
|
||||
void testDimension() {
|
||||
TK_INFO("==> test of Dimension (START)");
|
||||
|
||||
ewol::Dimension myDimention(vec2(5,5), ewol::Dimension::Centimeter);
|
||||
|
Loading…
Reference in New Issue
Block a user