[DEV] uptate new lutin declaration model

This commit is contained in:
Edouard DUPIN 2021-10-25 07:48:44 +02:00
parent fb07f88a58
commit 5cea268261
4 changed files with 56 additions and 58 deletions

38
GLD_echrono.json Normal file
View File

@ -0,0 +1,38 @@
{
"type":"LIBRARY",
"group-id":"com.atria-soft",
"description":"E-chrono: Ewol chrono",
"license":"MPL-2",
"license-file":"file://LICENCE.txt",
"maintainer":"file://authors.txt",
"author":"file://authors.txt",
"version":"file://version.txt",
"code-quality":"MEDIUM",
"source": [
"echrono/echrono.cpp",
"echrono/debug.cpp",
"echrono/Duration.cpp",
"echrono/Time.cpp",
"echrono/Steady.cpp",
"echrono/Clock.cpp"
],
"header": [
"echrono/echrono.hpp",
"echrono/Duration.hpp",
"echrono/Time.hpp",
"echrono/Steady.hpp",
"echrono/Clock.hpp"
],
"path":[
"."
],
"compilation-version": {
"language": "c++",
"version": 2017
},
"dependency": [
"elog",
"etk-core"
]
}

View File

@ -122,6 +122,20 @@ void echrono::Time::reset() {
m_data = 0;
}
etk::String echrono::Time::getIso8601() const {
time_t now;
now = m_data/1000000000LL;
int32_t nsec = m_data%1000000000LL;
struct tm ts = *gmtime(&now);
return etk::toString(ts.tm_year) + "-" + etk::toString(ts.tm_mon+1) + "-" + etk::toString(ts.tm_mday)
+ "T"
+ etk::toString(ts.tm_hour) + ":" + etk::toString(ts.tm_min) + ":" + etk::toString(ts.tm_sec)
+ ".000Z";
}
void echrono::Time::setIso8601(const etk::String& _value) {
}
etk::Stream& echrono::operator <<(etk::Stream& _os, const echrono::Time& _obj) {
int64_t ns = _obj.get();
@ -171,10 +185,10 @@ etk::Stream& echrono::operator <<(etk::Stream& _os, const echrono::Time& _obj) {
namespace etk {
template<> etk::String toString<echrono::Time>(const echrono::Time& _obj) {
return etk::toString(_obj.get());
return _obj.getIso8601();
}
template<> etk::UString toUString<echrono::Time>(const echrono::Time& _obj) {
return etk::toUString(_obj.get());
return etk::toUString(_obj.getIso8601());
}
}

View File

@ -50,6 +50,8 @@ namespace echrono {
Time operator- (const echrono::Duration& _obj) const;
Duration operator- (const echrono::Time& _obj) const;
void reset();
etk::String getIso8601() const;
void setIso8601(const etk::String& _value);
};
etk::Stream& operator <<(etk::Stream& _os, const echrono::Time& _obj);
}

View File

@ -1,56 +0,0 @@
#!/usr/bin/python
import realog.debug as debug
import lutin.tools as tools
def get_type():
return "LIBRARY"
def get_desc():
return "E-chrono: Ewol chrono"
def get_licence():
return "MPL-2"
def get_compagny_type():
return "com"
def get_compagny_name():
return "atria-soft"
def get_maintainer():
return "authors.txt"
def get_version():
return "version.txt"
def configure(target, my_module):
# add extra compilation flags:
my_module.add_extra_flags()
# add the file to compile:
my_module.add_src_file([
'echrono/echrono.cpp',
'echrono/debug.cpp',
'echrono/Duration.cpp',
'echrono/Time.cpp',
'echrono/Steady.cpp',
'echrono/Clock.cpp',
])
my_module.add_header_file([
'echrono/echrono.hpp',
'echrono/Duration.hpp',
'echrono/Time.hpp',
'echrono/Steady.hpp',
'echrono/Clock.hpp',
])
# name of the dependency
my_module.add_depend([
'elog',
'etk-core',
])
my_module.add_path(".")
return True