Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f1717633cc | |||
| 7c3bc1935e | |||
| 18b7d7675e | |||
| 903edc9349 | |||
| a9699e3e00 | |||
| d4d832fa72 |
1
authors.txt
Normal file
1
authors.txt
Normal file
@@ -0,0 +1 @@
|
||||
Mr DUPIN Edouard <yui.heero@gmail.com>
|
||||
@@ -6,7 +6,7 @@
|
||||
* @license BSD v3 (see license file)
|
||||
*/
|
||||
|
||||
#include <date/date.h>
|
||||
#include <date/date.hpp>
|
||||
#ifndef BUILD_YEAR
|
||||
#define BUILD_YEAR 1070
|
||||
#endif
|
||||
|
||||
20
date/date.h
20
date/date.h
@@ -1,20 +0,0 @@
|
||||
/**
|
||||
* @author Edouard DUPIN
|
||||
*
|
||||
* @copyright 2011, Edouard DUPIN, all right reserved
|
||||
*
|
||||
* @license BSD v3 (see license file)
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
namespace date {
|
||||
int32_t getYear();
|
||||
int32_t getMonth();
|
||||
int32_t getDay();
|
||||
int32_t getHour();
|
||||
int32_t getMinute();
|
||||
int32_t getSecond();
|
||||
};
|
||||
|
||||
47
date/date.hpp
Normal file
47
date/date.hpp
Normal file
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* @author Edouard DUPIN
|
||||
*
|
||||
* @copyright 2011, Edouard DUPIN, all right reserved
|
||||
*
|
||||
* @license BSD v3 (see license file)
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
/**
|
||||
* @brief date library namespace
|
||||
*/
|
||||
namespace date {
|
||||
/**
|
||||
* @brief Get the Build year of the program
|
||||
* @return The number of the year (ex: 2015 or 1995)
|
||||
*/
|
||||
int32_t getYear();
|
||||
/**
|
||||
* @brief Get the Build month id
|
||||
* @return The number of the month (ex: 1 for january or 9 for september ...)
|
||||
*/
|
||||
int32_t getMonth();
|
||||
/**
|
||||
* @brief Get the Build day in the month
|
||||
* @return The number of the month day [1..31]
|
||||
*/
|
||||
int32_t getDay();
|
||||
/**
|
||||
* @brief Get the Build hour
|
||||
* @return The number of the hour [0..23]
|
||||
*/
|
||||
int32_t getHour();
|
||||
/**
|
||||
* @brief Get the Build Minute
|
||||
* @return The number of the minute [0..59]
|
||||
*/
|
||||
int32_t getMinute();
|
||||
/**
|
||||
* @brief Get the Build second
|
||||
* @return The number of the second [0..59]
|
||||
*/
|
||||
int32_t getSecond();
|
||||
};
|
||||
|
||||
60
doc/mainpage.md
Normal file
60
doc/mainpage.md
Normal file
@@ -0,0 +1,60 @@
|
||||
DATE library {#mainpage}
|
||||
===============
|
||||
|
||||
@tableofcontents
|
||||
|
||||
What is DATE, and how can I use it? {#date_mainpage_what}
|
||||
====================================
|
||||
|
||||
Get the build date of the binary (simply externalyse to permit to not change the compilation flags of the program (just regenerate the SO and binary)
|
||||
|
||||
What languages are supported? {#date_mainpage_lang}
|
||||
=============================
|
||||
|
||||
DATE is written in C++.
|
||||
|
||||
Are there any licensing restrictions? {#date_mainpage_license_restriction}
|
||||
=====================================
|
||||
|
||||
DATE is **FREE software** and _all sub-library are FREE and staticly linkable !!!_
|
||||
|
||||
License (APACHE-2.0) {#date_mainpage_license}
|
||||
====================
|
||||
|
||||
Copyright DATE Edouard DUPIN
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
<http://www.apache.org/licenses/LICENSE-2.0>
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
|
||||
Usage? {#date_mainpage_tutorial}
|
||||
======
|
||||
|
||||
Use Date lib is really simple:
|
||||
|
||||
Include library header
|
||||
```{.cpp}
|
||||
#include <date/date.h>
|
||||
```
|
||||
Call the fucntion you need:
|
||||
```{.cpp}
|
||||
std::cout << "Build year:" << date::getYear() << std::endl;
|
||||
std::cout << "Build month:" << date::getMonth() << std::endl;
|
||||
std::cout << "Build day:" << date::getDay() << std::endl;
|
||||
std::cout << "Build hour:" << date::getHour() << std::endl;
|
||||
std::cout << "Build minute:" << date::getMinute() << std::endl;
|
||||
std::cout << "Build second:" << date::getSecond() << std::endl;
|
||||
// or :
|
||||
std::cout << "Build date:" << date::getDay() << "/" << date::getMonth() << "/" << date::getYear() << std::endl;
|
||||
std::cout << "Build time:" << date::getHour() << "h" << date::getMinute() << ":" << date::getSecond() << std::endl;
|
||||
```
|
||||
|
||||
22
doxy_date.py
Normal file
22
doxy_date.py
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/python
|
||||
import os
|
||||
import doxy.module as module
|
||||
import doxy.debug as debug
|
||||
import doxy.tools as tools
|
||||
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name)
|
||||
my_module.set_version("version.txt")
|
||||
my_module.set_title("date: basic build dator")
|
||||
my_module.set_website("http://atria-soft.github.io/" + module_name)
|
||||
my_module.set_website_sources("http://github.com/atria-soft/" + module_name)
|
||||
my_module.add_path([
|
||||
module_name,
|
||||
"doc"
|
||||
])
|
||||
my_module.add_file_patterns([
|
||||
'*.hpp',
|
||||
'*.md',
|
||||
])
|
||||
|
||||
return my_module
|
||||
@@ -1,10 +1,10 @@
|
||||
#!/usr/bin/python
|
||||
import lutin.module as module
|
||||
import lutin.debug as debug
|
||||
import lutin.tools as tools
|
||||
import datetime
|
||||
|
||||
def get_type():
|
||||
return "LIBRARY"
|
||||
return "LIBRARY_STATIC"
|
||||
|
||||
def get_desc():
|
||||
return "Date buid date of the program"
|
||||
@@ -19,30 +19,29 @@ def get_compagny_name():
|
||||
return "atria-soft"
|
||||
|
||||
def get_maintainer():
|
||||
return ["Mr DUPIN Edouard <yui.heero@gmail.com>"]
|
||||
return "authors.txt"
|
||||
|
||||
def get_version():
|
||||
return [0,2,0]
|
||||
return "version.txt"
|
||||
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name, get_type())
|
||||
def configure(target, my_module):
|
||||
my_module.add_src_file([
|
||||
'date/date.cpp'
|
||||
])
|
||||
'date/date.cpp'
|
||||
])
|
||||
my_module.add_header_file([
|
||||
'date/date.h'
|
||||
])
|
||||
'date/date.hpp'
|
||||
])
|
||||
now = datetime.datetime.now()
|
||||
my_module.add_flag('c++', [
|
||||
'-Wno-write-strings',
|
||||
'-Wall',
|
||||
"-DBUILD_DAY=\""+str(now.day)+"\"",
|
||||
"-DBUILD_MONTH=\""+str(now.month)+"\"",
|
||||
"-DBUILD_YEAR=\""+str(now.year)+"\"",
|
||||
"-DBUILD_HOUR=\""+str(now.hour)+"\"",
|
||||
"-DBUILD_MINUTE=\""+str(now.minute)+"\"",
|
||||
"-DBUILD_SECOND=\""+str(now.second)+"\""])
|
||||
my_module.add_path(tools.get_current_path(__file__))
|
||||
return my_module
|
||||
'-Wno-write-strings',
|
||||
'-Wall',
|
||||
"-DBUILD_DAY=\""+str(now.day)+"\"",
|
||||
"-DBUILD_MONTH=\""+str(now.month)+"\"",
|
||||
"-DBUILD_YEAR=\""+str(now.year)+"\"",
|
||||
"-DBUILD_HOUR=\""+str(now.hour)+"\"",
|
||||
"-DBUILD_MINUTE=\""+str(now.minute)+"\"",
|
||||
"-DBUILD_SECOND=\""+str(now.second)+"\""
|
||||
])
|
||||
return True
|
||||
|
||||
|
||||
|
||||
1
version.txt
Normal file
1
version.txt
Normal file
@@ -0,0 +1 @@
|
||||
0.3.0
|
||||
Reference in New Issue
Block a user