added: to TextStream<> and Log:

operator<<(const tm & tm_)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@797 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
Tomasz Sowa 2012-01-19 20:50:42 +00:00
parent 8b64b5d372
commit 4311f06ade
4 changed files with 37 additions and 3 deletions

View File

@ -255,6 +255,17 @@ return *this;
}
Log & Log::operator<<(const tm & tm_)
{
if( current_level <= log_level )
{
buffer << tm_;
}
return *this;
}
Log & Log::operator<<(LogManipulators m)
{

View File

@ -46,6 +46,7 @@ public:
Log & operator<<(const PT::Space * space);
Log & operator<<(const PT::Space & space);
Log & operator<<(LogManipulators m);
Log & operator<<(const tm & tm_);
template<class StringType>

View File

@ -11,6 +11,7 @@
#define headerfile_winix_core_textstream
#include <string>
#include <ctime>
#include "misc.h"
#include "confparser/space.h"
@ -58,7 +59,7 @@ public:
TextStream & operator<<(const void *);// printing a pointer
TextStream & operator<<(const PT::Space * space);
TextStream & operator<<(const PT::Space & space);
TextStream & operator<<(const tm & tm_);
TextStream & Write(const char * buf, size_t len);
TextStream & Write(const wchar_t * buf, size_t len);
@ -309,10 +310,9 @@ TextStream<StringType> & TextStream<StringType>::write(const wchar_t * buf, size
template<class StringType>
TextStream<StringType> & TextStream<StringType>::operator<<(const PT::Space * space)
{
// !! check me pls
space->Serialize(*this, true, false);
return *this;
return *this;
}
@ -323,6 +323,26 @@ TextStream<StringType> & TextStream<StringType>::operator<<(const PT::Space & sp
}
template<class StringType>
TextStream<StringType> & TextStream<StringType>::operator<<(const tm & tm_)
{
char buf[50];
sprintf(buf, "%04d-%02d-%02d %02d:%02d:%02d",
tm_.tm_year + 1900,
tm_.tm_mon + 1,
tm_.tm_mday,
tm_.tm_hour,
tm_.tm_min,
tm_.tm_sec);
for(size_t i=0 ; buf[i] ; ++i)
buffer += buf[i];
return *this;
}
#endif

View File

@ -49,6 +49,8 @@ void SelectDefaultFunction(PluginInfo & info)
{
if( info.system->mounts.pmount->type == ticket_info.mount_type_ticket )
{
// !! moze dac fun_ticket tylko dla itemow ktore nie sa plikami statycznymi...
if( info.cur->request->is_item )
info.cur->request->function = &fun_ticket;
else