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:
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;
|
||||
}
|
Reference in New Issue
Block a user