changed: now we do not use std::string and char* in the Winix API

everywhere we are using std::wstring and wchar_t*
         (std::string and char* is used only locally in some places
         especially when creating a path to OS file system etc.)
added:   to the special thread when winix closes:
         a write function for curl: FetchPageOnExitCurlCallback()
         without this function the curl library will print
         the page's content to the standart output
changed: TextStream<> class from core can make
         UTF8<->wide strings conversions
removed: from config: utf8 option
         now winix expects UTF8 from the user's input (html forms, url-es)
         and outputs strings in the UTF8 format




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@965 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2014-10-09 20:44:56 +00:00
parent 4abf6642f7
commit 8196fb77d1
74 changed files with 1911 additions and 1612 deletions

View File

@@ -8,9 +8,10 @@ db.o: ../../pikotools/textstream/textstream.h
db.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
db.o: ../../pikotools/membuffer/membuffer.h
db.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
db.o: ../../winix/core/error.h ../../pikotools/space/spaceparser.h
db.o: ../../pikotools/space/space.h dbitemquery.h ../../winix/core/item.h
db.o: dbitemcolumns.h ../../winix/core/user.h ../../winix/core/group.h
db.o: ../../winix/core/winix_const.h ../../winix/core/error.h
db.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
db.o: dbitemquery.h ../../winix/core/item.h dbitemcolumns.h
db.o: ../../winix/core/user.h ../../winix/core/group.h
db.o: ../../winix/core/dircontainer.h ../../winix/core/ugcontainer.h
db.o: ../../winix/core/log.h ../../winix/core/textstream.h
db.o: ../../winix/core/logmanipulators.h ../../winix/core/slog.h
@@ -31,9 +32,9 @@ dbbase.o: ../../pikotools/convert/convert.h
dbbase.o: ../../pikotools/convert/inttostr.h
dbbase.o: ../../pikotools/membuffer/membuffer.h
dbbase.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
dbbase.o: ../../winix/core/error.h ../../pikotools/space/spaceparser.h
dbbase.o: ../../pikotools/space/space.h ../../winix/core/log.h
dbbase.o: ../../winix/core/misc.h
dbbase.o: ../../winix/core/winix_const.h ../../winix/core/error.h
dbbase.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
dbbase.o: ../../winix/core/log.h ../../winix/core/misc.h
dbconn.o: dbconn.h dbtextstream.h ../../winix/core/textstream.h
dbconn.o: ../../winix/core/misc.h ../../winix/core/item.h
dbconn.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
@@ -43,7 +44,8 @@ dbconn.o: ../../pikotools/convert/convert.h
dbconn.o: ../../pikotools/convert/inttostr.h
dbconn.o: ../../pikotools/membuffer/membuffer.h
dbconn.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
dbconn.o: ../../winix/core/log.h ../../winix/core/error.h
dbconn.o: ../../winix/core/winix_const.h ../../winix/core/log.h
dbconn.o: ../../winix/core/error.h
dbitemcolumns.o: dbitemcolumns.h ../../winix/core/item.h dbbase.h dbconn.h
dbitemcolumns.o: dbtextstream.h ../../winix/core/textstream.h
dbitemcolumns.o: ../../winix/core/misc.h ../../winix/core/item.h
@@ -55,8 +57,8 @@ dbitemcolumns.o: ../../pikotools/convert/convert.h
dbitemcolumns.o: ../../pikotools/convert/inttostr.h
dbitemcolumns.o: ../../pikotools/membuffer/membuffer.h
dbitemcolumns.o: ../../pikotools/textstream/types.h
dbitemcolumns.o: ../../pikotools/utf8/utf8.h ../../winix/core/error.h
dbitemcolumns.o: ../../pikotools/space/spaceparser.h
dbitemcolumns.o: ../../pikotools/utf8/utf8.h ../../winix/core/winix_const.h
dbitemcolumns.o: ../../winix/core/error.h ../../pikotools/space/spaceparser.h
dbitemcolumns.o: ../../pikotools/space/space.h ../../winix/core/log.h
dbitemquery.o: dbitemquery.h ../../winix/core/item.h
dbtextstream.o: dbtextstream.h ../../winix/core/textstream.h
@@ -69,4 +71,4 @@ dbtextstream.o: ../../pikotools/convert/convert.h
dbtextstream.o: ../../pikotools/convert/inttostr.h
dbtextstream.o: ../../pikotools/membuffer/membuffer.h
dbtextstream.o: ../../pikotools/textstream/types.h
dbtextstream.o: ../../pikotools/utf8/utf8.h
dbtextstream.o: ../../pikotools/utf8/utf8.h ../../winix/core/winix_const.h

View File

@@ -259,7 +259,6 @@ bool DbBase::AssertValueSpace(PGresult * r, int row, int col, PT::Space & space,
{
const char * res = AssertValue(r, row, col);
conf_parser.UTF8(true);
conf_parser.SplitSingle(split_single);
conf_parser.SetSpace(space);
space.Clear();

View File

@@ -65,7 +65,7 @@ PGconn * DbConn::GetPgConn()
void DbConn::SetConnParam(const std::string & d, const std::string & u, const std::string & p)
void DbConn::SetConnParam(const std::wstring & d, const std::wstring & u, const std::wstring & p)
{
db_database = d;
db_user = u;

View File

@@ -52,7 +52,7 @@ public:
DbConn();
~DbConn();
void SetConnParam(const std::string & database, const std::string & user, const std::string & pass);
void SetConnParam(const std::wstring & database, const std::wstring & user, const std::wstring & pass);
void Connect();
void WaitForConnection();
void Close();
@@ -65,7 +65,7 @@ private:
void LogConnectionSocket();
PGconn * pg_conn;
std::string db_database, db_user, db_pass;
std::wstring db_database, db_user, db_pass;
DbTextStream conn_info;
// a helper method for escaping strings

View File

@@ -63,7 +63,7 @@ void DbTextStream::SetExtented(bool ext)
DbTextStream & DbTextStream::PutText(const char * str)
{
buffer += str;
TextStream<std::string>::operator<<(str);
was_param = false;
return *this;
@@ -85,7 +85,7 @@ DbTextStream & DbTextStream::PutText(const std::string & str)
DbTextStream & DbTextStream::PutText(const wchar_t * str)
{
PT::WideToUTF8(str, buffer, false);
TextStream<std::string>::operator<<(str);
was_param = false;
return *this;
@@ -229,7 +229,7 @@ DbTextStream & DbTextStream::operator<<(RawText<PT::Date> date)
{
tmp_stream.Clear();
date.par.Serialize(tmp_stream);
AssignString(tmp_stream.CStr(), buffer, false);
PT::WideToUTF8(tmp_stream.CStr(), buffer, false);
tmp_stream.Clear();
was_param = false;
@@ -246,30 +246,6 @@ return *this;
*/
/*
old PostgreSQL Escape Format
*/
/*
DbTextStream & DbTextStream::EBinPutChar(char c_)
{
char buf[20];
int c = (unsigned char)c_;
if( (c>=0 && c<=31) || c>=127 || c=='\'' || c=='\\' )
{
sprintf(buf, "\\\\%03o", c);
buffer += buf;
}
else
{
buffer += c;
}
return *this;
}
*/
// get hex digit for c_ between <0, 15>
char DbTextStream::EBinGetHex(char c)
{