Select Git revision
ReleaseNotes.txt
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
ReleaseNotes.txt 20.27 KiB
YAT history file
1.19.1 (2022/07/18)
===================
Fixed bad version numbers
1.19.0 (2022/07/08)
===================
Fixes:
class Pulser
Synchronization between Pulser config and PulserCoreImpl
class StringTemplate
Fixed method value() when UNCHANGE_STRING mode is set
class UDPListener
member variable m_received_events was never incremented
class Atomic
was unusable due to bad header file!
Changes:
class Format
Complete rewriting for better performances (~x5 speedup) and thread-safety
Several fixes
Added argument ordering support
New subclass Formatter<T> in order to define formatting for any class type
with custom format specification ability
-> see <yat/utils/String.h>
new YAT_PTR_BYTES_LEN define value
-> see <yat/config-linux.h>
-> see <yat/config-win32.h>
class UDPTrigger
c-tor now throw an excpetion if the port number is > MAX_INT32/2
class FileName
Added suid & guid boolean fields to FileName::Info struct
-> see <yat/file/FileName.h>
Take care of the sgid bit when creating a subdirectory structure and
when copying a file as root
Logging utilities
new free functions fcout/fcerr/fclog ('f' stands for 'format') that can
be used as replacements to std::cout/std::cerr/std::clog.
Those three functions use the Format class for string formatting.
The free function 'log' is removed.
-> see <yat/utils/Logging.h>
template class Format::Formatter<T>
Added implementations for:
all basic types and C-pointer type,
Time/CurrentTime/CurrentUTime/UnixTime/LocalTime,
Duration
FileName/File/FileEnum/TempFileName/CfgFile/DirectoryWatcher
URI
Dictionary<T>
-> see <yat/utils/String.h>
<yat/time/Time.h>
<yat/time/FileName.h>
<yat/utils/URI.h>
<yat/utils/Dictionary.h>
1.18.9 (2022/04/22)
===================
Fixes:
class Barrier
Documentation was wrong: a barrier object is not re-usable
-> see <yat/threading/Barrier.h>
class FileName
set(path, name, ext) wrong behavior when ext was empty
mod_time(): wrong conversion local <-> utc
recursive_chown() : this method was not functional
class FileEnum
calling close() caused the process to crash (sigabrt)
classes SharedPtr/WeakPtr
a type conversion between pointers to base and derived class was not compiling
class Semaphore
fixed timed_wait method that was not functionnal on linux
class Time
fixed to_string formats
class Duration
any negative value passed in c-tor is automatically converted to positive one
Changes:
class FileName
file_access() now take an optional argument defing the access type to check
-> see <yat/file/FileName.h>
1.18.8 (2022/02/14)
===================
Additions:
class Atomic<T>
Fully inspired by std::atomic. This class is aimed to offer the same
functionnlity as std::atomic. 1st implementation is non-lock free,
using Mutex.
-> see <yat/threading/Atomic.h>
1.18.7 (2021/12/01)
===================
Fixes:
class Time
Timezone bias was not properly read from the system
Changes:
StringTemplate now accept to substition string with "$var" when the variable
name is not followed by an alphanumeric character
1.18.6 (2021/09/21)
===================
Additions:
class Regex::Match
new method: void ready()
-> see <yat/regex/Regex.h>
Logging
- log functions: debug, info, notice, result, warning, error, fatal, critical, emergency, log
now accept formatted messages (using an underlying yat::Format object)
class String
New methods
static ExtractTokenRes extract_token(std::string* str_p, char c, std::string *pstrToken, char escape_char);
static ExtractTokenRes extract_token(std::string* str_p, char c, std::string *pstrToken);
static ExtractTokenRes extract_token_right(std::string* str_p, char c, std::string *pstrToken, char escape_char);
static ExtractTokenRes extract_token_right(std::string* str_p, char c, std::string *pstrToken);
The following methods are now marked as deprecated:
static ExtractTokenRes extract_token(std::string* str_p, char c, std::string *pstrToken, bool apply_escape);
static ExtractTokenRes extract_token_right(std::string* str_p, char c, std::string *pstrToken, bool apply_escape);
-> see <yat/utils/String.h>
class Time
new methods:
static String to_string(const DateFields& df, const std::string& format, unsigned short precision=0);
static int sys_time_zone_bias();
static void get_current_local(DateFields* df_p);
static void get_current_uts(DateFields* df_p);
-> see <yat/time/Time.h>
1.18.5 (2021/07/13)
===================
Fixes
Another (the last one!) invalid use of yat::Format in macro YAT_TRY in Exception.h
1.18.4 (2021/07/08)
===================
Fixes
Invalid use of yat::Format in macro YAT_TRY in Exception.h
1.18.3 (2021/07/07)
===================
Fixes
class Regex
Compiled regex was never properly discarded, oups !
Additions
class FileName
Added support for the null file ('/dev/null' on Linux, '<any_path>\nul' on Windows)
The null file is used for writing data into nil, it therefore always exist but its size
is 0 forever.
Changes
StringFormat
class StringFormat renamed to Format (but original name is still available)
'format' method in StringFormat is renamed as 'arg' (but original name is still available)
Logging
- log functions log_verbose, log_info, log_error,... become verbose, info, error,....
The old ones are marked as deprecated
Switch YAT_DEPRECATED removed
1.18.2 (2021/04/09)
===================
Fixes
class URI
path part was not properly parsed if the uri does not define any authority
1.18.1 (2021/04/08)
===================
Fixes
class Regex
- regex match with 'nosubs' flag was returning a wrong result
- regex flags have to be passed through a 'int' value rather than CompFlags enum type
-> see <yat/regex/Regex.h>
class URI
To solve the ambiguous difference beween regular host name and ipv4 address,
the parsing algorithm now considere that host name like x.y.z.t
(where x/y/z/t are numerical values) should be ipv4 address and therefore is
checked against ipv4 syntax (four values in [0-255] range).
1.18.0 (2021/02/08)
===================
Additions
classes Regex, Regex::Match, Regex::Match::iterator, Regex::SubMatch
The Regex class is a wrapper on the GNU Regex implementation
It offer a simple object-type interface to use regular expressions
Its interface is intended to easely encapsulate the std:regex classes
family, that will be done in a few months, ensuring smooth transition to cpp11+.
The default grammar is GNU ERE (Extended Regular Expression).
This example:
yat::Regex re(R"((www)\.([-_[:alnum:]]+)\.([[:lower:]]{2,4}))");
yat::Regex::Match m;
re.search("http://www.cppreference.com/w/cpp", &m);
for( yat::Regex::Match::iterator it = m.begin(); it != m.end(); ++it )
{
std::cout << *it <<std::endl;
}
should output:
www.cppreference.com
www
cppreference
com
-> see <yat/regex/Regex.h>
YAT_DEPRECATED switch to be set in Makefile or CMakeLists.txt or pom.xml,...
if set then deprecated methods will be still available
1.17.6 (2020/12/16)
===================
Fixes
class StringFormat
Format string begining with '{}' failed to be properly parsed
yat::String was not supported!
1.17.5 (2020/12/07)
===================
Changes
class StringUtil
The following methods are deprecated: str_format, printf
class String
The following method is deprecated: printf
-> see <yat/utils/String.h>
Additions
class String:
New constructor: String(std::ostringstream& oss)
-> see <yat/utils/String.h>
New class StringFormat
This class is aimed to build strings using a format specification
It is inspired by the Python method 'format' of the String class.
Format spec is:
[[fill]align][sign][#][width][.precision][type]
fill ::= <any character>
align ::= "<" | ">"
sign ::= "+"
width ::= integer
precision ::= integer
type ::= "b" | "B" | "e" | "E" | "f" | "F" | "g" | "G" | "o" | "s" | "x"
Verbatim
yat::StringFormat strfmt("a: {}; b:{}; c: {>+12.4f}");
YAT_INFO << strfmt.format(12).format(true).format(25.36) << YAT_EOL;
-> see <yat/utils/String.h>
Fixes
class String & StringUtil
fixed method 'match' that was returned wrong vector of tokens
-> see <yat/utils/String.h>
1.17.4 (2020/09/25)
===================
Fix
class StringUtil
in extract_token(std::string* str_p, char cLeft, char cRight, std::string *pstrToken, bool apply_escape);
& extract_token_right(std::string* str_p, char cLeft, char cRight, std::string *pstrToken, bool apply_escape);
Both methods was returning left and right remnants from token extraction
1.17.3 (2020/07/09)
===================
Fix
Link failure with vc12 concerning the WaitableMessage class
1.17.2 (2020/06/15)
===================
Fix
class Message
- Remove constructor Message(std::size_t msg_type, bool waitable)
added with v1.17.1 because of a compilation error in code using
'int' type for msg_type and msg_priority arguments when constructing
a Message object with the other c-tor
Additions
class WaitableMessage
- Convenience class c-tor aimed to explicitaly construct waitable Message
object
1.17.1 (2020/05/28)
===================
Additions
Class StringDictionary
New methods that return converted values to numeric types
- get_numeric<T>(const std::string& key)
- get_bool(const std::string& key)
Class Task
Ability to dispatch periodic messages with high precision in time.
When this mode is set periodic messages are dispatched with at time precision
of ~100µs (0.1ms) on Linux platform and not better than 1ms on Windows platform
There is also no long term shifting
- void enable_precise_periodic_timing (bool enable)
-> see <yat/threading/Task.h>
Class SharedPtr
Ability to instantiate an AutoMutex objet on a SharedPtr to allow
threadsafe manipulations on pointed data.
Verbatim
typedef SharedPtr<MyClass> MyClassPtr;
{ // In thread A
MyClassPtr ptr_on_MyClass_obj(new MyClass);
thread_B->set_ptr(ptr_on_MyClass_obj);
...
AutoMutex<MyClassPtr> _lock(ptr_on_MyClass_obj);
ptr_on_MyClass_obj->do_some_action();
}
...
{
// In thread B
AutoMutex<MyClassPtr> _lock(ptr_on_MyClass_obj);
ptr_on_MyClass_obj->do_some_other_action();
}
Class DataBuffer
Append an element at buffer end, increase length by one
- void append(const T &val)
-> see <yat/memory/DataBuffer.h>
Changes
Class Task
Periodic message period is now expressed as double float instead of integer
- void set_periodic_msg_period (double ms)
- double get_periodic_msg_period () const
-> see <yat/threading/Task.h>
1.16.3 (2019/12/14)
===================
Additions
Class Version
New method add_dependency_module
-> see <yat/utils/Version.h>
Class XString is now marked as deprecated
use yat::String methods instead
Class SysUtils
- new method exec_script: securely exec a shell script with timeout
-> see <yat/system/SysUtils.h>
Fixes
Class String
Infinite loop then calling String::from_num
-> see <yat/utils/String.h>
Added missing reference to md5/md5.cpp in src/CMakeLists.txt
1.15.1 (2019/10/01)
===================
Fixes
Class String
Infinite loop when calling methods:
- find_first_of(const std::string& str, size_type pos = 0)
- iterator insert(iterator pos, char c)
Added some missing YAT_DECL for Visual C++
-> see <yat/utils/String.h>
Additions
typedef yat::md5::md5_t yat::MD5
-> see <yat/utils/md5.h>
1.15.0 (2019/07/15)
===================
Additions
class md5::md5_t
md5sum processor
New method FileName::copy_with_md5(const std::string& strDest, yat::String* md5sum_str_p, bool keep_metadata=false);
-> see <yat/file.FileName.h>
1.14.6 (2019/04/16)
===================
Additions
CPPunit tests (using libcppunit 1.13.2). To be completed...
Changes
StringTemplate
Now support substitutions directives 'uc' & 'lc' (which means upper-case & lower-case respectively):
If MY_VAR is "Foo" then $(uc:MY_VAR) will be replaced by "FOO" and $(lc:MY_VAR) will replaced by "foo"
-> see <yat/utils/String.h>
Fixes
Bug fixed in StringUtil::extract_token(std::string* str_p, char cLeft, char cRight, std::string *pstrToken)
-> see <yat/utils/String.h>
In FileName::FSBytes changed the base unit: 1000 instead of 1024
-> see <yat/file.FileName.h>
1.14.5 (2019/02/13)
===================
Fixes
Fixed incorrect error management in yat::URI::parse
Added '|' character in allowed list of characters in the query part
1.14.4 (2018/11/06)
===================
Fixes
Bad calls of std::string methods from yat::String
1.14.3 (2018/10/10)
===================
Fixes
Added missing implementation of method yat::String::str_format()
Added missing method:
yat::String::split(char c, std::vector<yat::String> *vec_p, bool clear_vector=true);
yat::String::split(char c, std::vector<yat::String> *vec_p, bool clear_vector=true) const;
yat::String::operator+=(char c);
yat::StringUtil::split(std::string* str_p, char c, std::vector<yat::String> *vec_p, bool clear_vector=true);
yat::StringUtil::split(const std::string& str, char c, std::vector<yat::String> *vec_p, bool clear_vector=true) const;
yat::File::load(yat::string *);
yat::SysUtils::get_env(const std::string &strVar, yat::String *pstrValue, const char *pszDef=NULL);
1.14.1 (2018/09/27)
===================
Additions
New methods in yat::Dictionary
void to_vector(std::vector<std::string>* vec_p, char sep_key=':');
void to_string(std::string* str_p, char sep_pair='\n', char sep_key=':');
-> See <yat/utils/Dictionary.h>
New methods in yat::Time
std::string to_local_ISO8601_micro() const;
std::string to_ISO8601_micro() const;
std::string to_ISO8601_micro_TU() const;
-> See <yat/time/Time.h>
Changes
Old String class no longer deprecated!! It was refactored and is now fully usable
It does no longer inherit from std::string (which was a big error) but fully compatible with it
-> See <yat/utils/String.h>
Fixes
Classes RLockFile & WLockFile
constructors was not public
-> See <yat/file/FileName.h>
1.13.17 (2018/07/23)
====================
Additions
void URI::clear();
bool URI::empty();
-> See <yat/Utils/URI.h>
Macro YAT_FREQUENCY_LIMITED_STATEMENT
Use this macro to limit the execution frequency of a specific statement, for instance
a log message in a high frequency loop
-> See <yat/utils/Logging.h>
Changes
static ExtractTokenRes StringUtil::extract_token(std::string* str_p, char c, std::string *pstrToken,
bool apply_escape = false);
static ExtractTokenRes StringUtil::extract_token_right(std::string* str_p, char c, std::string *pstrToken,
bool apply_escape = false);
'apply_escape' is a new parameter to allow the sperarator character as a part of the tokens
-> See <yat/utils/String.h>
1.13.16 (2018/04/06)
====================
Additions
bool StringTemplate::substitute_ex(std::string *pstrTemplate, std::vector<std::string>* not_found_p);
The new method return 'false' if at leat one substitution fail and returns a list of unresolved symbols
-> <yat/utils/StringTemplate.h>
Fixes
UDPListener::Config
Bug in the constructor
-> See <yat/network/UDPListener.h>
1.13.15 (2018/03/09)
====================
Additions
void Time::from_string(const std::string& date_time, const std::string& format);
Set date/time object from a formatted string
-> See <yat/time/Time.h>
Changes
THROW_YAT_EXCEPTION & RETHROW_YAT_EXCEPTION
The description field now support stream-like notation
-> See <yat/Exception.h>
Fixes
YAT_LOG_EXCEPTION
Thread-safety
-> See <yat/utils/Logging.h>
1.13.12 (2017/12/22)
====================
Additions
YAT_VERBOSE, YAT_INFO, YAT_WARNING, YAT_ERROR
New logging macro to be use as streams
-> See <yat/utils/Logging.h>
void FileName::set_path(const std::string& strPath);
New method to set the path part
-> See <yat/file/FileName.h>
Fixes
FileName::name_ext()
An unexpected exception was throwed in the case of the full path was an empty string
1.13.9 (2017/07/11)
===================
Additions
class picojison
Added open source picojson implementation
-> See <yat/utils/picojson.h>
1.13.6 (2017/03/31)
===================
Additions
FileName::FileName(const std::string& strPath, const std::string& strName, const std::string& strExt);
New constructor
-> See <yat/file/FileName.h>
bool SysUtils::is_root();
Return 'True' if the current process is executed as root
-> See <yat/system/sysUtils.h>
static void URI::pct_encode(std::string* to_encode, const std::string& reserved=URI_RESERVED);
static void URI::pct_decode(std::string* to_encode);
Percent encoding/decoding to allow using reserved characters in URIs. Automatically called when needed.
-> See <yat/utils/URI.h>
StringDictionary::StringDictionary(const std::vector<std::string>& vec, char sep);
StringDictionary::StringDictionary(const std::string& s, char sep_pair, char sep_key);
New constructors
-> See <yat/utils/Dictionary.h>
typedef std::vector<std::string> type StringVector;
-> See <yat/utils/String.h>
1.13.5 (2017/02/08)
===================
Additions
UDPTrigger::next_trigger
Allow manually sending udp frames. Parameter {{trigger_period_ms}} must be set to '0'.
-> See <yat/network/UDPTrigger.h>
1.13.4 (2016/12/05)
===================
Additions
Class FileName::FSBytes
Class FileName::FSStat
FileName::FSStat FileName::file_system_statistics() const
Return statistics about a file system
-> See <yat/file/FileName.h>
1.13.1 (2016/07/20)
===================
Additions
class LockFile
SWMR (Single Writer Multiple Reader) file locking class
-> See <yat/file/FileName.h>
class AutoLockFile
Convenience class to ensure unlocking
-> See <yat/file/FileName.h>
class Dictionary
Simple dictionary class using an underlying std::map object
-> See <yat/utils/Dictionary.h>
class UDPListener
FORWARDS THE UDP PACKETS (SENT BY THE SPI BOARD) TO A SPITASK
-> See <yat/network/UDPListener.h>
1.10.5 (2016/02/11)
===================
Additions
class FileName::Info
A structure used to describe a file
-> See <yat/file/FileName.h>
void FileName::info( FileName::Info* ) const
Get information about a file
-> See <yat/file/FileName.h>
template<typename T> bool fp_is_equal(T a, T b, T precision)
Floating point comparison operator
-> See <yat/CommonHeader.h>
template<typename T> class UniquePtr
Unique pointer implementation
-> See <yat/memory/UniquePtr.h>
bool Pulser::is_done()
Check pulser activity
-> See <yat/threading/Pulser.h>