added: forum

added: mount params can have arguments (in parentheses)
added: mount params: withheader, withinfo, restrictcreatethread, only_root_can_remove,
       can_use_emacs_on(level), can_use_mkdir_on(level), 
added: table Item has 'subject' column now
removed: column 'subject' from table Content




git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@505 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2009-06-05 20:29:06 +00:00
parent 3d001e7458
commit 1eb42446f8
38 changed files with 1357 additions and 369 deletions

View File

@@ -32,7 +32,7 @@ const char * Mount::TypeToStr()
case thread:
sprintf(buffer, "thread");
break;
break;
default:
sprintf(buffer, "the name is not set");
@@ -43,7 +43,7 @@ return buffer;
}
bool Mount::ParseStrParam(const std::string & param)
bool Mount::ParseStrParam(const std::string & param, const std::vector<int> & args)
{
Param p = none;
@@ -53,12 +53,30 @@ bool Mount::ParseStrParam(const std::string & param)
if( param == "desc" )
p = desc;
else
if( param == "withheader" )
p = withheader;
else
if( param == "withinfo" )
p = withinfo;
else
if( param == "restrictcreatethread" )
p = restrictcreatethread;
else
if( param == "only_root_can_remove" )
p = only_root_can_remove;
else
if( param == "can_use_emacs_on" )
p = can_use_emacs_on;
else
if( param == "can_use_mkdir_on" )
p = can_use_mkdir_on;
else
if( param == "none" )
return true;
else
return false;
param_table.insert(p);
param_table.insert( std::make_pair(p, args) );
return true;
}
@@ -66,10 +84,35 @@ return true;
bool Mount::IsParam(Param p)
{
std::set<Param>::iterator i = param_table.find(p);
ParamTable::iterator i = param_table.find(p);
if( i == param_table.end() )
return false;
return true;
}
bool Mount::IsParam(Param p, int * first_arg)
{
ParamTable::iterator i = param_table.find(p);
if( i == param_table.end() )
{
*first_arg = -1;
return false;
}
if( !i->second.empty() )
*first_arg = i->second[0];
else
*first_arg = -1;
return true;
}
void Mount::ClearParams()
{
param_table.clear();
}