added: mount points have parameters now
added: to the database: table 'thread' git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@499 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
o = data.o log.o sessionmanager.o requestcontroller.o dircontainer.o session.o main.o done.o request.o misc.o httpsimpleparser.o db.o error.o db_itemcolumns.o users.o config.o dirs.o groups.o function.o functionparser.o functions.o functioncodeparser.o sessioncontainer.o lastcontainer.o mounts.o mountparser.o
|
||||
o = data.o log.o sessionmanager.o requestcontroller.o dircontainer.o session.o main.o done.o request.o misc.o httpsimpleparser.o db.o error.o db_itemcolumns.o users.o config.o dirs.o groups.o function.o functionparser.o functions.o functioncodeparser.o sessioncontainer.o lastcontainer.o mounts.o mountparser.o mount.o
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,41 +2,42 @@
|
||||
|
||||
config.o: config.h ../confparser/confparser.h error.h log.h data.h misc.h
|
||||
config.o: item.h dirs.h db.h dircontainer.h user.h group.h ugcontainer.h
|
||||
config.o: users.h groups.h functions.h function.h functioncodeparser.h
|
||||
config.o: lastcontainer.h mounts.h mount.h request.h requesttypes.h session.h
|
||||
config.o: done.h getparser.h httpsimpleparser.h postparser.h cookieparser.h
|
||||
config.o: mountparser.h
|
||||
config.o: thread.h users.h groups.h functions.h function.h
|
||||
config.o: functioncodeparser.h lastcontainer.h mounts.h mount.h request.h
|
||||
config.o: requesttypes.h session.h done.h getparser.h httpsimpleparser.h
|
||||
config.o: postparser.h cookieparser.h mountparser.h
|
||||
data.o: data.h misc.h log.h item.h error.h dirs.h db.h dircontainer.h user.h
|
||||
data.o: group.h ugcontainer.h users.h groups.h functions.h function.h
|
||||
data.o: functioncodeparser.h lastcontainer.h mounts.h mount.h request.h
|
||||
data.o: requesttypes.h session.h done.h getparser.h httpsimpleparser.h
|
||||
data.o: postparser.h cookieparser.h mountparser.h
|
||||
data.o: group.h ugcontainer.h thread.h users.h groups.h functions.h
|
||||
data.o: function.h functioncodeparser.h lastcontainer.h mounts.h mount.h
|
||||
data.o: request.h requesttypes.h session.h done.h getparser.h
|
||||
data.o: httpsimpleparser.h postparser.h cookieparser.h mountparser.h
|
||||
db.o: db.h log.h item.h misc.h error.h dircontainer.h user.h group.h
|
||||
db.o: ugcontainer.h
|
||||
db.o: ugcontainer.h thread.h
|
||||
db_itemcolumns.o: db.h log.h item.h misc.h error.h dircontainer.h user.h
|
||||
db_itemcolumns.o: group.h ugcontainer.h
|
||||
db_itemcolumns.o: group.h ugcontainer.h thread.h
|
||||
dircontainer.o: dircontainer.h item.h log.h
|
||||
dirs.o: dirs.h item.h error.h log.h db.h misc.h dircontainer.h user.h group.h
|
||||
dirs.o: ugcontainer.h
|
||||
dirs.o: ugcontainer.h thread.h
|
||||
done.o: done.h
|
||||
error.o: error.h log.h
|
||||
function.o: function.h log.h item.h
|
||||
functioncodeparser.o: functioncodeparser.h function.h log.h item.h
|
||||
functionparser.o: functionparser.h request.h requesttypes.h log.h session.h
|
||||
functionparser.o: error.h item.h done.h user.h getparser.h httpsimpleparser.h
|
||||
functionparser.o: postparser.h cookieparser.h function.h data.h misc.h dirs.h
|
||||
functionparser.o: db.h dircontainer.h group.h ugcontainer.h users.h groups.h
|
||||
functionparser.o: functions.h functioncodeparser.h lastcontainer.h mounts.h
|
||||
functionparser.o: mount.h mountparser.h ../app/content.h ../core/log.h
|
||||
functionparser.o: ../core/data.h ../core/function.h
|
||||
functionparser.o: postparser.h cookieparser.h function.h thread.h data.h
|
||||
functionparser.o: misc.h dirs.h db.h dircontainer.h group.h ugcontainer.h
|
||||
functionparser.o: users.h groups.h functions.h functioncodeparser.h
|
||||
functionparser.o: lastcontainer.h mounts.h mount.h mountparser.h
|
||||
functionparser.o: ../app/content.h ../core/log.h ../core/data.h
|
||||
functionparser.o: ../core/function.h
|
||||
functions.o: functions.h function.h log.h item.h functioncodeparser.h
|
||||
groups.o: groups.h group.h db.h log.h item.h misc.h error.h dircontainer.h
|
||||
groups.o: user.h ugcontainer.h
|
||||
groups.o: user.h ugcontainer.h thread.h
|
||||
httpsimpleparser.o: httpsimpleparser.h
|
||||
lastcontainer.o: lastcontainer.h log.h
|
||||
log.o: log.h
|
||||
main.o: requestcontroller.h data.h misc.h log.h item.h error.h dirs.h db.h
|
||||
main.o: dircontainer.h user.h group.h ugcontainer.h users.h groups.h
|
||||
main.o: dircontainer.h user.h group.h ugcontainer.h thread.h users.h groups.h
|
||||
main.o: functions.h function.h functioncodeparser.h lastcontainer.h mounts.h
|
||||
main.o: mount.h request.h requesttypes.h session.h done.h getparser.h
|
||||
main.o: httpsimpleparser.h postparser.h cookieparser.h mountparser.h
|
||||
@@ -48,16 +49,24 @@ main.o: ../app/templates.h ../core/misc.h ../core/function.h
|
||||
main.o: ../core/functionparser.h ../app/content.h sessionmanager.h
|
||||
main.o: sessioncontainer.h config.h ../confparser/confparser.h
|
||||
misc.o: misc.h log.h item.h
|
||||
mountparser.o: mountparser.h log.h mount.h error.h
|
||||
mount.o: mount.h
|
||||
mountparser.o: mountparser.h log.h mount.h error.h item.h data.h misc.h
|
||||
mountparser.o: dirs.h db.h dircontainer.h user.h group.h ugcontainer.h
|
||||
mountparser.o: thread.h users.h groups.h functions.h function.h
|
||||
mountparser.o: functioncodeparser.h lastcontainer.h mounts.h request.h
|
||||
mountparser.o: requesttypes.h session.h done.h getparser.h httpsimpleparser.h
|
||||
mountparser.o: postparser.h cookieparser.h
|
||||
mounts.o: mounts.h mount.h request.h requesttypes.h log.h session.h error.h
|
||||
mounts.o: item.h done.h user.h getparser.h httpsimpleparser.h postparser.h
|
||||
mounts.o: cookieparser.h function.h mountparser.h
|
||||
mounts.o: cookieparser.h function.h thread.h mountparser.h data.h misc.h
|
||||
mounts.o: dirs.h db.h dircontainer.h group.h ugcontainer.h users.h groups.h
|
||||
mounts.o: functions.h functioncodeparser.h lastcontainer.h
|
||||
request.o: request.h requesttypes.h log.h session.h error.h item.h done.h
|
||||
request.o: user.h getparser.h httpsimpleparser.h postparser.h cookieparser.h
|
||||
request.o: function.h
|
||||
request.o: function.h thread.h
|
||||
requestcontroller.o: requestcontroller.h data.h misc.h log.h item.h error.h
|
||||
requestcontroller.o: dirs.h db.h dircontainer.h user.h group.h ugcontainer.h
|
||||
requestcontroller.o: users.h groups.h functions.h function.h
|
||||
requestcontroller.o: thread.h users.h groups.h functions.h function.h
|
||||
requestcontroller.o: functioncodeparser.h lastcontainer.h mounts.h mount.h
|
||||
requestcontroller.o: request.h requesttypes.h session.h done.h getparser.h
|
||||
requestcontroller.o: httpsimpleparser.h postparser.h cookieparser.h
|
||||
@@ -72,12 +81,18 @@ requestcontroller.o: ../core/functionparser.h ../app/content.h
|
||||
requestcontroller.o: sessionmanager.h sessioncontainer.h
|
||||
session.o: session.h requesttypes.h error.h log.h item.h done.h user.h
|
||||
sessioncontainer.o: sessioncontainer.h session.h requesttypes.h error.h log.h
|
||||
sessioncontainer.o: item.h done.h user.h
|
||||
sessioncontainer.o: item.h done.h user.h data.h misc.h dirs.h db.h
|
||||
sessioncontainer.o: dircontainer.h group.h ugcontainer.h thread.h users.h
|
||||
sessioncontainer.o: groups.h functions.h function.h functioncodeparser.h
|
||||
sessioncontainer.o: lastcontainer.h mounts.h mount.h request.h getparser.h
|
||||
sessioncontainer.o: httpsimpleparser.h postparser.h cookieparser.h
|
||||
sessioncontainer.o: mountparser.h
|
||||
sessionmanager.o: sessionmanager.h request.h requesttypes.h log.h session.h
|
||||
sessionmanager.o: error.h item.h done.h user.h getparser.h httpsimpleparser.h
|
||||
sessionmanager.o: postparser.h cookieparser.h function.h data.h misc.h dirs.h
|
||||
sessionmanager.o: db.h dircontainer.h group.h ugcontainer.h users.h groups.h
|
||||
sessionmanager.o: functions.h functioncodeparser.h lastcontainer.h mounts.h
|
||||
sessionmanager.o: mount.h mountparser.h sessioncontainer.h
|
||||
sessionmanager.o: postparser.h cookieparser.h function.h thread.h data.h
|
||||
sessionmanager.o: misc.h dirs.h db.h dircontainer.h group.h ugcontainer.h
|
||||
sessionmanager.o: users.h groups.h functions.h functioncodeparser.h
|
||||
sessionmanager.o: lastcontainer.h mounts.h mount.h mountparser.h
|
||||
sessionmanager.o: sessioncontainer.h
|
||||
users.o: users.h user.h db.h log.h item.h misc.h error.h dircontainer.h
|
||||
users.o: group.h ugcontainer.h
|
||||
users.o: group.h ugcontainer.h thread.h
|
||||
|
||||
97
core/db.cpp
97
core/db.cpp
@@ -745,7 +745,7 @@ return result;
|
||||
|
||||
|
||||
|
||||
PGresult * Db::GetItemsQuery(Item & item_ref)
|
||||
PGresult * Db::GetItemsQuery(Item & item_ref, bool asc)
|
||||
{
|
||||
std::ostringstream query;
|
||||
query << "select * from core.item left join core.content on item.content_id = content.id where type!='0' and parent_id='" << item_ref.parent_id << "'";
|
||||
@@ -756,14 +756,22 @@ PGresult * Db::GetItemsQuery(Item & item_ref)
|
||||
if( !item_ref.url.empty() )
|
||||
query << " and url='" << Escape(item_ref.url) << "'";
|
||||
|
||||
query << " order by item.date_modification";
|
||||
|
||||
if( asc )
|
||||
query << " asc";
|
||||
else
|
||||
query << " desc";
|
||||
|
||||
query << ';';
|
||||
|
||||
|
||||
return AssertQuery(query.str());
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Db::GetItems(std::vector<Item> & item_table, Item & item_ref)
|
||||
void Db::GetItems(std::vector<Item> & item_table, Item & item_ref, bool asc)
|
||||
{
|
||||
item_table.clear();
|
||||
PGresult * r = 0;
|
||||
@@ -772,7 +780,7 @@ void Db::GetItems(std::vector<Item> & item_table, Item & item_ref)
|
||||
{
|
||||
AssertConnection();
|
||||
|
||||
r = GetItemsQuery(item_ref);
|
||||
r = GetItemsQuery(item_ref, asc);
|
||||
AssertResultStatus(r, PGRES_TUPLES_OK);
|
||||
|
||||
Item item;
|
||||
@@ -1358,3 +1366,86 @@ return buffer;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Error Db::GetThreadByDirId(long dir_id, Thread & thread)
|
||||
{
|
||||
PGresult * r = 0;
|
||||
Error status = Error::ok;
|
||||
|
||||
try
|
||||
{
|
||||
AssertConnection();
|
||||
|
||||
std::ostringstream query;
|
||||
query << "select id, dir_id, subject, closed from core.thread where thread.dir_id = " << dir_id << ";";
|
||||
|
||||
r = AssertQuery( query.str() );
|
||||
AssertResultStatus(r, PGRES_TUPLES_OK);
|
||||
|
||||
int rows = PQntuples(r);
|
||||
|
||||
if( rows > 1 )
|
||||
log << log1 << "Db: there is more than one thread with dir_id: " << dir_id << logend;
|
||||
else
|
||||
if( rows == 0 )
|
||||
{
|
||||
log << log1 << "Db: there is no a thread with dir_id: " << dir_id << logend;
|
||||
throw Error(Error::no_thread);
|
||||
}
|
||||
|
||||
int cid = AssertColumn(r, "id");
|
||||
int cdir_id = AssertColumn(r, "dir_id");
|
||||
int csubject = AssertColumn(r, "subject");
|
||||
int cclosed = AssertColumn(r, "closed");
|
||||
|
||||
thread.id = atol( AssertValue(r, 0, cid) );
|
||||
thread.dir_id = atol( AssertValue(r, 0, cdir_id) );
|
||||
thread.subject = AssertValue(r, 0, csubject);
|
||||
thread.closed = atol( AssertValue(r, 0, cclosed) ) == 0 ? false : true;
|
||||
}
|
||||
catch(const Error & e)
|
||||
{
|
||||
status = e;
|
||||
}
|
||||
|
||||
ClearResult(r);
|
||||
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Error Db::AddThread(Thread & thread)
|
||||
{
|
||||
PGresult * r = 0;
|
||||
Error status = Error::ok;
|
||||
|
||||
try
|
||||
{
|
||||
AssertConnection();
|
||||
std::ostringstream query;
|
||||
query << "insert into core.thread (dir_id, subject, closed) values (";
|
||||
query << '\'' << thread.dir_id << "', ";
|
||||
query << '\'' << Escape(thread.subject) << "', ";
|
||||
query << '\'' << (thread.closed ? 1 : 0 ) << "'); ";
|
||||
|
||||
r = AssertQuery(query.str());
|
||||
AssertResultStatus(r, PGRES_COMMAND_OK);
|
||||
|
||||
thread.id = AssertCurrval("core.thread_id_seq");
|
||||
}
|
||||
catch(const Error & e)
|
||||
{
|
||||
status = e;
|
||||
}
|
||||
|
||||
ClearResult(r);
|
||||
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
10
core/db.h
10
core/db.h
@@ -28,6 +28,8 @@
|
||||
#include "user.h"
|
||||
#include "group.h"
|
||||
#include "ugcontainer.h"
|
||||
#include "thread.h"
|
||||
|
||||
|
||||
|
||||
class Db
|
||||
@@ -48,7 +50,7 @@ public:
|
||||
Error EditItemById(Item & item, bool with_subject = true);
|
||||
Error EditItemByUrl(Item & item, bool with_subject = true);
|
||||
void CheckAllUrlSubject();
|
||||
void GetItems(std::vector<Item> & item_table, Item & item_ref);
|
||||
void GetItems(std::vector<Item> & item_table, Item & item_ref, bool asc = true);
|
||||
void GetItem(std::vector<Item> & item_table, long id);
|
||||
bool GetPriv(Item & item, long id);
|
||||
Error EditPrivById(Item & item, long id);
|
||||
@@ -75,6 +77,10 @@ public:
|
||||
|
||||
virtual void Connect();
|
||||
|
||||
|
||||
Error AddThread(Thread & thread);
|
||||
Error GetThreadByDirId(long dir_id, Thread & thread);
|
||||
|
||||
protected:
|
||||
|
||||
PGconn * pg_conn;
|
||||
@@ -106,7 +112,7 @@ protected:
|
||||
|
||||
void CheckAllUrlSubjectModifyItem(Item & item);
|
||||
|
||||
PGresult * GetItemsQuery(Item & item_ref);
|
||||
PGresult * GetItemsQuery(Item & item_ref, bool asc = true);
|
||||
|
||||
bool DelItemDelItem(const Item & item);
|
||||
void DelItemDelContent(const Item & item);
|
||||
|
||||
@@ -47,6 +47,10 @@ public:
|
||||
|
||||
mount_unknown,
|
||||
no_mountpoint,
|
||||
mount_no_param,
|
||||
|
||||
no_thread,
|
||||
|
||||
unknown = 1000
|
||||
|
||||
|
||||
|
||||
75
core/mount.cpp
Executable file
75
core/mount.cpp
Executable file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2009, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mount.h"
|
||||
|
||||
|
||||
|
||||
|
||||
Mount::Mount()
|
||||
{
|
||||
type = cms;
|
||||
dir_id = -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
const char * Mount::TypeToStr()
|
||||
{
|
||||
static char buffer[30];
|
||||
|
||||
switch( type )
|
||||
{
|
||||
case cms:
|
||||
sprintf(buffer, "cms");
|
||||
break;
|
||||
|
||||
case thread:
|
||||
sprintf(buffer, "thread");
|
||||
break;
|
||||
|
||||
default:
|
||||
sprintf(buffer, "the name is not set");
|
||||
break;
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
||||
bool Mount::ParseStrParam(const std::string & param)
|
||||
{
|
||||
Param p = none;
|
||||
|
||||
if( param == "asc" )
|
||||
p = asc;
|
||||
else
|
||||
if( param == "desc" )
|
||||
p = desc;
|
||||
else
|
||||
if( param == "none" )
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
||||
param_table.insert(p);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Mount::IsParam(Param p)
|
||||
{
|
||||
std::set<Param>::iterator i = param_table.find(p);
|
||||
|
||||
if( i == param_table.end() )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
45
core/mount.h
45
core/mount.h
@@ -11,8 +11,8 @@
|
||||
#ifndef headerfilecoremount
|
||||
#define headerfilecoremount
|
||||
|
||||
|
||||
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
||||
|
||||
class Mount
|
||||
@@ -27,36 +27,25 @@ public:
|
||||
};
|
||||
|
||||
|
||||
enum Param
|
||||
{
|
||||
none = 0,
|
||||
asc,
|
||||
desc
|
||||
};
|
||||
|
||||
|
||||
long dir_id;
|
||||
Type type;
|
||||
|
||||
Mount();
|
||||
const char * TypeToStr();
|
||||
bool ParseStrParam(const std::string & param);
|
||||
bool IsParam(Param p);
|
||||
|
||||
// in the future can be more parameters to a mount point
|
||||
|
||||
|
||||
const char * TypeToStr()
|
||||
{
|
||||
static char buffer[30];
|
||||
|
||||
switch( type )
|
||||
{
|
||||
case cms:
|
||||
sprintf(buffer, "cms");
|
||||
break;
|
||||
|
||||
case thread:
|
||||
sprintf(buffer, "thread");
|
||||
break;
|
||||
|
||||
default:
|
||||
sprintf(buffer, "the name is not set");
|
||||
break;
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
private:
|
||||
std::set<Param> param_table;
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -51,6 +51,21 @@ void MountParser::ReadWord(std::string & res)
|
||||
}
|
||||
|
||||
|
||||
void MountParser::ReadParam(std::string & res)
|
||||
{
|
||||
res.clear();
|
||||
|
||||
while( *pinput && *pinput!=10 && *pinput!=',' && !IsWhite(*pinput) )
|
||||
{
|
||||
res += *pinput;
|
||||
++pinput;
|
||||
}
|
||||
|
||||
if( *pinput==',' )
|
||||
++pinput;
|
||||
|
||||
}
|
||||
|
||||
|
||||
void MountParser::ReadMountType()
|
||||
{
|
||||
@@ -59,13 +74,13 @@ void MountParser::ReadMountType()
|
||||
|
||||
if( temp == "cms" )
|
||||
{
|
||||
mount_type = Mount::cms;
|
||||
mount.type = Mount::cms;
|
||||
log << log3 << "MP: mount type: cms" << logend;
|
||||
}
|
||||
else
|
||||
if( temp == "thread" )
|
||||
{
|
||||
mount_type = Mount::thread;
|
||||
mount.type = Mount::thread;
|
||||
log << log3 << "MP: mount type: thread" << logend;
|
||||
}
|
||||
else
|
||||
@@ -88,6 +103,7 @@ void MountParser::ReadMountPoint()
|
||||
|
||||
if( pdir )
|
||||
{
|
||||
mount.dir_id = pdir->id;
|
||||
log << log3 << "MP: mount point: " << temp << logend;
|
||||
}
|
||||
else
|
||||
@@ -99,6 +115,27 @@ void MountParser::ReadMountPoint()
|
||||
|
||||
|
||||
|
||||
void MountParser::ReadMountParams()
|
||||
{
|
||||
SkipWhite();
|
||||
|
||||
for( ReadParam(temp) ; !temp.empty() ; ReadParam(temp) )
|
||||
{
|
||||
if( !mount.ParseStrParam(temp) )
|
||||
{
|
||||
log << log1 << "MP: unknown mount param: " << temp << logend;
|
||||
err = Error::mount_no_param;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
log << log3 << "MP: mount param: " << temp << logend;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MountParser::ReadRow(std::map<long, Mount> & output)
|
||||
{
|
||||
ReadMountType();
|
||||
@@ -106,15 +143,14 @@ void MountParser::ReadRow(std::map<long, Mount> & output)
|
||||
if( err == Error::ok )
|
||||
ReadMountPoint();
|
||||
|
||||
if( err == Error::ok )
|
||||
ReadMountParams();
|
||||
|
||||
if( err == Error::ok )
|
||||
{
|
||||
Mount m;
|
||||
m.dir_id = pdir->id;
|
||||
m.type = mount_type;
|
||||
|
||||
output.insert( std::make_pair(pdir->id, m) );
|
||||
output.insert( std::make_pair(mount.dir_id, mount) );
|
||||
}
|
||||
|
||||
|
||||
SkipLine();
|
||||
}
|
||||
|
||||
@@ -34,13 +34,17 @@ private:
|
||||
void SkipWhite();
|
||||
void SkipLine();
|
||||
void ReadWord(std::string & res);
|
||||
void ReadParam(std::string & res);
|
||||
void ReadMountType();
|
||||
void ReadMountPoint();
|
||||
void ReadMountParams();
|
||||
void ReadRow(std::map<long, Mount> & output);
|
||||
|
||||
const char * pinput;
|
||||
std::string temp;
|
||||
Mount::Type mount_type;
|
||||
|
||||
Mount mount;
|
||||
|
||||
Item * pdir;
|
||||
Error err;
|
||||
};
|
||||
|
||||
@@ -16,7 +16,7 @@ void Mounts::ReadMounts()
|
||||
MountParser mp;
|
||||
|
||||
// !! tymczasowo - bedzie odczyt z bazy z /etc/fstab
|
||||
std::string temp = "thread /news";
|
||||
std::string temp = "thread /news desc";
|
||||
|
||||
Error err = mp.Parse(temp, mount_table);
|
||||
|
||||
|
||||
@@ -61,6 +61,8 @@ void Request::Clear()
|
||||
param_table.clear();
|
||||
|
||||
status = Error::ok;
|
||||
|
||||
thread.Clear();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "item.h"
|
||||
#include "error.h"
|
||||
#include "function.h"
|
||||
#include "thread.h"
|
||||
|
||||
|
||||
struct Request
|
||||
@@ -112,6 +113,8 @@ struct Request
|
||||
// directories in the current directory
|
||||
//std::vector<Item> dir_table2;
|
||||
|
||||
// current thread (if exists)
|
||||
Thread thread;
|
||||
|
||||
// this string is used for many purposes such as redirecting
|
||||
std::string str;
|
||||
|
||||
@@ -153,6 +153,7 @@ void RequestController::Loop()
|
||||
function_parser.Parse();
|
||||
data.mounts.CalculateCurrentMountType();
|
||||
|
||||
content.ReadAdditionalInfo();
|
||||
content.Make();
|
||||
}
|
||||
|
||||
|
||||
41
core/thread.h
Executable file
41
core/thread.h
Executable file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2009, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecorethread
|
||||
#define headerfilecorethread
|
||||
|
||||
#include <string>
|
||||
|
||||
|
||||
class Thread
|
||||
{
|
||||
public:
|
||||
|
||||
long id;
|
||||
long dir_id;
|
||||
std::string subject;
|
||||
bool closed;
|
||||
|
||||
|
||||
|
||||
void Clear()
|
||||
{
|
||||
id = dir_id = -1;
|
||||
closed = false;
|
||||
subject.clear();
|
||||
}
|
||||
|
||||
Thread()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user