added: created directory 'content' which has Content:: files
added: created directory 'templates' which has Templates:: and TemplatesFunctions:: files
changed: content.cpp split into many files (directory 'content')
changed: templates.cpp split into many files (directory 'templates')
added: full permissions
changed: building of the program (GNU make is used now)
Makefile and Makefile.dep added into directories
added: a parser 'FunctionParser'
is used to parse the GET string
it recognizes directories, items, functions, functions parameters
added: other classes: Function, Functions
added: function: ls, privileges
changed: function 'id' to 'node'
changed: version: to 0.2.0
added/changed: a lot of work have been done
git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@469 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -179,6 +179,18 @@ return true;
|
||||
}
|
||||
|
||||
|
||||
bool Dirs::GetDirChilds(long parent, std::vector<Item*> & childs_table)
|
||||
{
|
||||
if( parent != -1 && !IsDir(parent) )
|
||||
return false;
|
||||
|
||||
DirContainer::ParentIterator i = dir_table.FindFirstParent(parent);
|
||||
|
||||
for( ; i != dir_table.ParentEnd() ; i = dir_table.NextParent(i) )
|
||||
childs_table.push_back( &(*i->second) );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -213,7 +225,7 @@ DirContainer::Iterator i;
|
||||
|
||||
// with exceptions
|
||||
|
||||
Item * Dirs::GetDir(const std::string & path)
|
||||
Item * Dirs::GetDirT(const std::string & path)
|
||||
{
|
||||
Item * pitem;
|
||||
|
||||
@@ -224,7 +236,7 @@ return pitem;
|
||||
}
|
||||
|
||||
|
||||
Item * Dirs::GetDir(const std::string & name, long parent)
|
||||
Item * Dirs::GetDirT(const std::string & name, long parent)
|
||||
{
|
||||
Item * pitem;
|
||||
|
||||
@@ -236,7 +248,7 @@ return pitem;
|
||||
}
|
||||
|
||||
|
||||
long Dirs::GetDirId(const std::string & path)
|
||||
long Dirs::GetDirIdT(const std::string & path)
|
||||
{
|
||||
long id;
|
||||
|
||||
@@ -247,7 +259,7 @@ return id;
|
||||
}
|
||||
|
||||
|
||||
long Dirs::GetDirId(const std::string & name, long parent)
|
||||
long Dirs::GetDirIdT(const std::string & name, long parent)
|
||||
{
|
||||
long id;
|
||||
|
||||
@@ -259,3 +271,67 @@ return id;
|
||||
|
||||
|
||||
|
||||
// !! nowy interfejs
|
||||
|
||||
|
||||
|
||||
Item * Dirs::GetRootDir()
|
||||
{
|
||||
DirContainer::Iterator root = dir_table.GetRoot();
|
||||
|
||||
if( root == dir_table.End() )
|
||||
return 0;
|
||||
|
||||
return &(*root);
|
||||
}
|
||||
|
||||
|
||||
Item * Dirs::GetDir(const std::string & name, long parent)
|
||||
{
|
||||
DirContainer::ParentIterator i = dir_table.FindFirstParent(parent);
|
||||
|
||||
for( ; i!=dir_table.ParentEnd() ; i = dir_table.NextParent(i) )
|
||||
if( i->second->url == name )
|
||||
return &(*i->second);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Item * Dirs::GetDir(const std::string & path)
|
||||
{
|
||||
DirContainer::Iterator root = dir_table.GetRoot();
|
||||
|
||||
if( root == dir_table.End() )
|
||||
// ops, we do not have a root dir
|
||||
return 0;
|
||||
|
||||
Item * pitem = &(*root);
|
||||
|
||||
std::string name;
|
||||
const char * s = path.c_str();
|
||||
|
||||
while( ExtractName(s, name) )
|
||||
{
|
||||
pitem = GetDir(name, pitem->id);
|
||||
|
||||
if( !pitem )
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
return pitem;
|
||||
}
|
||||
|
||||
|
||||
Item * Dirs::GetDir(long id)
|
||||
{
|
||||
DirContainer::Iterator i = dir_table.FindId(id);
|
||||
|
||||
if( i == dir_table.End() )
|
||||
return 0;
|
||||
|
||||
return &(*i);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user