removed: dependencies to 'tz' system structure
now we are using PT::Date from pikotools git-svn-id: svn://ttmath.org/publicrep/winix/trunk@839 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
db.o: db.h dbbase.h dbconn.h dbtextstream.h ../core/textstream.h
|
||||
db.o: ../core/misc.h ../core/item.h ../../pikotools/space/space.h
|
||||
db.o: ../core/requesttypes.h ../../pikotools/date/date.h ../core/error.h
|
||||
db.o: ../../pikotools/date/date.h ../core/requesttypes.h ../core/error.h
|
||||
db.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||
db.o: dbitemquery.h ../core/item.h dbitemcolumns.h ../core/user.h
|
||||
db.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
|
||||
@@ -13,20 +13,21 @@ db.o: ../core/session.h ../core/user.h ../core/plugindata.h ../core/rebus.h
|
||||
db.o: ../core/mount.h ../templates/locale.h ../core/log.h ../core/misc.h
|
||||
dbbase.o: dbbase.h dbconn.h dbtextstream.h ../core/textstream.h
|
||||
dbbase.o: ../core/misc.h ../core/item.h ../../pikotools/space/space.h
|
||||
dbbase.o: ../core/requesttypes.h ../../pikotools/date/date.h ../core/error.h
|
||||
dbbase.o: ../../pikotools/date/date.h ../core/requesttypes.h ../core/error.h
|
||||
dbbase.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||
dbbase.o: ../core/log.h ../core/misc.h ../../pikotools/utf8/utf8.h
|
||||
dbconn.o: dbconn.h dbtextstream.h ../core/textstream.h ../core/misc.h
|
||||
dbconn.o: ../core/item.h ../../pikotools/space/space.h ../core/requesttypes.h
|
||||
dbconn.o: ../../pikotools/date/date.h ../core/log.h ../core/error.h
|
||||
dbconn.o: ../core/item.h ../../pikotools/space/space.h
|
||||
dbconn.o: ../../pikotools/date/date.h ../core/requesttypes.h ../core/log.h
|
||||
dbconn.o: ../core/error.h
|
||||
dbitemcolumns.o: dbitemcolumns.h ../core/item.h dbbase.h dbconn.h
|
||||
dbitemcolumns.o: dbtextstream.h ../core/textstream.h ../core/misc.h
|
||||
dbitemcolumns.o: ../core/item.h ../../pikotools/space/space.h
|
||||
dbitemcolumns.o: ../core/requesttypes.h ../../pikotools/date/date.h
|
||||
dbitemcolumns.o: ../../pikotools/date/date.h ../core/requesttypes.h
|
||||
dbitemcolumns.o: ../core/error.h ../../pikotools/space/spaceparser.h
|
||||
dbitemcolumns.o: ../../pikotools/space/space.h ../core/log.h
|
||||
dbitemquery.o: dbitemquery.h ../core/item.h
|
||||
dbtextstream.o: dbtextstream.h ../core/textstream.h ../core/misc.h
|
||||
dbtextstream.o: ../core/item.h ../../pikotools/space/space.h
|
||||
dbtextstream.o: ../core/requesttypes.h ../../pikotools/date/date.h
|
||||
dbtextstream.o: ../../pikotools/date/date.h ../core/requesttypes.h
|
||||
dbtextstream.o: ../../pikotools/utf8/utf8.h
|
||||
|
||||
@@ -223,6 +223,14 @@ tm DbBase::AssertValueTm(PGresult * r, int row, int col)
|
||||
}
|
||||
|
||||
|
||||
PT::Date DbBase::AssertValueDate(PGresult * r, int row, int col)
|
||||
{
|
||||
PT::Date date = AssertValue(r, row, col);
|
||||
|
||||
return date;
|
||||
}
|
||||
|
||||
|
||||
bool DbBase::AssertValueSpace(PGresult * r, int row, int col, PT::Space & space, bool split_single)
|
||||
{
|
||||
const char * res = AssertValue(r, row, col);
|
||||
@@ -354,8 +362,6 @@ tm t;
|
||||
t.tm_hour = Toi(str + 11); /* hours (0 - 23) */
|
||||
t.tm_min = Toi(str + 14); /* minutes (0 - 59) */
|
||||
t.tm_sec = Toi(str + 17); /* seconds (0 - 60) */
|
||||
|
||||
t = Time(Time(t));
|
||||
|
||||
// t.tm_wday = 0; /* day of week (Sunday = 0) */
|
||||
// t.tm_yday = 0; /* day of year (0 - 365) */
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
#include <string>
|
||||
#include "core/error.h"
|
||||
#include "space/spaceparser.h"
|
||||
#include "date/date.h"
|
||||
|
||||
|
||||
|
||||
class DbBase
|
||||
@@ -49,6 +51,7 @@ public:
|
||||
static unsigned long AssertValueULong(PGresult * r, int row, int col);
|
||||
static unsigned int AssertValueUInt(PGresult * r, int row, int col);
|
||||
static tm AssertValueTm(PGresult * r, int row, int col);
|
||||
static PT::Date AssertValueDate(PGresult * r, int row, int col);
|
||||
|
||||
// non static assignments
|
||||
bool AssertValueSpace(PGresult * r, int row, int col, PT::Space & space, bool split_single = true);
|
||||
|
||||
@@ -588,12 +588,12 @@ return buffer;
|
||||
|
||||
DbTextStream & DbTextStream::operator<<(const PT::Space & space)
|
||||
{
|
||||
space_stream.Clear();
|
||||
tmp_stream.Clear();
|
||||
// !! IMPROVE ME
|
||||
// we can calculate how much memory is needed before serializing
|
||||
space.Serialize(space_stream, true, false);
|
||||
operator<<(space_stream.Str());
|
||||
space_stream.Clear();
|
||||
space.Serialize(tmp_stream, true, false);
|
||||
operator<<(tmp_stream.Str());
|
||||
tmp_stream.Clear();
|
||||
|
||||
return *this;
|
||||
}
|
||||
@@ -601,13 +601,10 @@ return *this;
|
||||
|
||||
DbTextStream & DbTextStream::operator<<(const PT::Date & date)
|
||||
{
|
||||
if( was_param )
|
||||
buffer += ", ";
|
||||
|
||||
buffer += '\'';
|
||||
date.Serialize(*this);
|
||||
buffer += '\'';
|
||||
was_param = true;
|
||||
tmp_stream.Clear();
|
||||
date.Serialize(tmp_stream);
|
||||
operator<<(tmp_stream.Str());
|
||||
tmp_stream.Clear();
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -163,9 +163,7 @@ private:
|
||||
|
||||
bool was_param;
|
||||
bool ext_escape;
|
||||
|
||||
// a temporarily stream used when serializing spaces
|
||||
TextStream<std::wstring> space_stream;
|
||||
TextStream<std::wstring> tmp_stream;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user