added: TextStream<> DbTextStream<> and HtmlTextStream<> have operator<<(Space&) now
added: to db: bool DbBase::AssertValueSpace(PGresult * r, int row, int col, Space & space, bool split_single) added: environment variables for users User::env (of type Space) and User::aenv (of type Space) for admin variables (can be changed only by a super user) added: winix function 'env' for changing User::env and User::aenv ('env' winix function with a 'a' parameter) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@790 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2008-2011, Tomasz Sowa
|
||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
void DbItemColumns::SetColumns(PGresult * r)
|
||||
{
|
||||
// PQfnumber returns -1 if there is no such a column
|
||||
@@ -48,28 +49,6 @@ void DbItemColumns::SetColumns(PGresult * r)
|
||||
}
|
||||
|
||||
|
||||
void DbItemColumns::SetMeta(PGresult * r, long row, Item & item)
|
||||
{
|
||||
DbBase::AssertValueWide(r, row, meta, meta_str);
|
||||
|
||||
item.meta.Clear();
|
||||
conf_parser.SetSpace(item.meta);
|
||||
conf_parser.UTF8(true); // from the db we always have UTF-8 string
|
||||
conf_parser.SplitSingle(true);
|
||||
|
||||
if( conf_parser.ParseString(meta_str) != ConfParser::ok )
|
||||
{
|
||||
log << log1 << "Db: syntax error when parsing meta information for"
|
||||
<< " item id: " << item.id
|
||||
<< ", url: " << item.url
|
||||
<< ", line: " << conf_parser.line << logend;
|
||||
}
|
||||
|
||||
meta_str.clear();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DbItemColumns::SetItem(PGresult * r, long row, Item & item)
|
||||
{
|
||||
if( id != -1 ) item.id = DbBase::AssertValueLong(r, row, id);
|
||||
@@ -101,9 +80,9 @@ void DbItemColumns::SetItem(PGresult * r, long row, Item & item)
|
||||
if( link_to != -1 ) DbBase::AssertValueWide(r, row, link_to, item.link_to);
|
||||
if( guest_name != -1 ) DbBase::AssertValueWide(r, row, guest_name, item.guest_name);
|
||||
if( html_template != -1 ) DbBase::AssertValueWide(r, row, html_template, item.html_template);
|
||||
if( sort_index != -1 ) item.sort_index = DbBase::AssertValueInt(r, row, sort_index);
|
||||
if( sort_index != -1 ) item.sort_index = DbBase::AssertValueInt(r, row, sort_index);
|
||||
|
||||
if( meta != -1 ) SetMeta(r, row, item);
|
||||
if( meta != -1 ) db_base.AssertValueSpace(r, row, meta, item.meta);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user