added: a new way: HEX format to saving/reading from PostgreSQL bytea columns

added: to Request:
       // binary page
       BinaryPage binary_page;

       // a compressed page ready to send to the client
       BinaryPage compressed_page;

       // if true then either page or ajaxpage will be sent to the client
       // if false then binary_page is sent
       // default: true
       bool use_text_page;

       BinaryPage is defined as (in requesttypes.h):
       typedef PT::TextStreamBase<char, 1, 4096> BinaryPage;

added: to Compress: now it can gets BinaryPage as arguments (input, output)
changed: winix version to: 0.5.0
added: in templates: TexTextStream class
       for taking input to the TeX typesetting system





git-svn-id: svn://ttmath.org/publicrep/winix/trunk@884 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2012-09-11 05:19:45 +00:00
parent 9174555ff8
commit d8260d8383
23 changed files with 1051 additions and 129 deletions

View File

@@ -217,6 +217,10 @@ return *this;
*/
/*
old PostgreSQL Escape Format
*/
/*
DbTextStream & DbTextStream::EBinPutChar(char c_)
{
char buf[20];
@@ -235,6 +239,26 @@ char buf[20];
return *this;
}
*/
// get hex digit for c_ between <0, 15>
char DbTextStream::EBinGetHex(char c)
{
if( c < 10 )
return c + '0';
return c - 10 + 'A';
}
DbTextStream & DbTextStream::EBinPutChar(char c)
{
buffer += EBinGetHex(((unsigned char)c) >> 4);
buffer += EBinGetHex(((unsigned char)c) & 0x0f);
return *this;
}
DbTextStream & DbTextStream::ETextPutChar(char c)
@@ -341,7 +365,7 @@ DbTextStream & DbTextStream::EPutBin(const char * str, size_t len)
if( ext_escape )
buffer += 'E';
buffer += '\'';
buffer += "\'\\\\x";
for(size_t i = 0 ; i < len ; ++i)
EBinPutChar(str[i]);