EgtGeneral 1.5c2 :

- Aggiunta funzione per avere string con data e ora correnti
- CmdParser migliorato con aggiunta comandi come COUNTER, SET, RUN.
This commit is contained in:
Dario Sassi
2014-03-18 08:36:02 +00:00
parent 214cd2439b
commit 2acbbf7858
4 changed files with 328 additions and 34 deletions
+23 -1
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2013-2014
//----------------------------------------------------------------------------
// File : StringUtils.cpp Data : 19.01.14 Versione : 1.5a6
// File : StringUtils.cpp Data : 17.03.14 Versione : 1.5c2
// Contenuto : Implementazione delle funzioni di utilità per le stringhe.
//
//
@@ -9,12 +9,14 @@
// Modifiche : 20.01.13 DS Creazione modulo.
// 02.12.13 DS Agg. FromString per Vector3d, Point3d e Point3d+W.
// 19.01.14 DS Tokenize con Atom ora funziona su più livelli.
// 17.03.14 DS Agg. CurrDateTime.
//
//----------------------------------------------------------------------------
//--------------------------- Include ----------------------------------------
#include "stdafx.h"
#include "/EgtDEv/Include/EgnStringUtils.h"
#include <time.h>
using namespace std ;
@@ -287,3 +289,23 @@ ReplaceString( std::string& sString, const std::string& sOld, const std::string&
return nSubs ;
}
//----------------------------------------------------------------------------
const string
CurrDateTime( void)
{
time_t nClock ;
tm newTime ;
time( &nClock) ;
localtime_s( &newTime, &nClock) ;
char strDate[10] = { '\0'} ;
char strTime[10] = { '\0'} ;
_strdate_s( strDate) ;
_strtime_s( strTime) ;
string sDT = strDate + string( " ") + strTime ;
return sDT ;
}