the first part of reimplementing has been done

now we have app object and singletons are only: log logn plugin and app



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@628 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2010-08-10 16:12:50 +00:00
parent 6897192364
commit 217cf1420b
191 changed files with 9529 additions and 7250 deletions

View File

@@ -8,7 +8,6 @@
*/
#include "mounts.h"
#include "data.h"
#include "request.h"
#include "log.h"
#include "mountparser.h"
@@ -23,12 +22,29 @@ Mounts::Mounts()
}
void Mounts::SetDirs(Dirs * pdirs)
{
dirs = pdirs;
}
void Mounts::SetDb(Db * pdb)
{
db = pdb;
}
void Mounts::SetRequest(Request * prequest)
{
request = prequest;
}
// reading from 'mounts'
Error Mounts::ReadMounts(const std::string & mounts)
{
MountParser mp;
mp.SetDirs(dirs);
Error err = mp.Parse(mounts, mount_tab);
if( err != WINIX_ERR_OK )
@@ -49,7 +65,7 @@ Error Mounts::ReadMounts()
{
static std::string file = "fstab";
Item * etc = data.dirs.GetEtcDir();
Item * etc = dirs->GetEtcDir();
if( !etc )
{
@@ -58,7 +74,7 @@ Error Mounts::ReadMounts()
}
Item fstab;
Error err = db.GetItem(etc->id, file, fstab);
Error err = db->GetItem(etc->id, file, fstab);
if( err == WINIX_ERR_NO_ITEM )
{
@@ -82,7 +98,7 @@ void Mounts::MountCmsForRoot()
mount.type = Mount::cms;
mount.fs = Mount::simplefs;
Item * proot = data.dirs.GetRootDir();
Item * proot = dirs->GetRootDir();
if( proot )
mount.dir_id = proot->id;
@@ -105,10 +121,10 @@ std::vector<Item*>::reverse_iterator i;
// when the program starts (when the dir_table is empty()
// we don't want to call MountCmsForRoot()
if( request.dir_table.empty() )
if( request->dir_table.empty() )
return;
for(i = request.dir_table.rbegin() ; i!=request.dir_table.rend() ; ++i)
for(i = request->dir_table.rbegin() ; i!=request->dir_table.rend() ; ++i)
{
std::map<long, Mount>::iterator m = mount_tab.find( (*i)->id );
@@ -135,7 +151,7 @@ Mount * Mounts::CalcMount(long dir_id)
{
while( true )
{
Item * pdir = data.dirs.GetDir(dir_id);
Item * pdir = dirs->GetDir(dir_id);
if( !pdir )
return 0;