Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

unifiletreegen.cc

Go to the documentation of this file.
00001 /* 00002 * Worldvisions Weaver Software: 00003 * Copyright (C) 1997-2002 Net Integration Technologies, Inc. 00004 * 00005 * A generator for .ini files. 00006 */ 00007 #include "wvtclstring.h" 00008 #include "strutils.h" 00009 #include "wvfile.h" 00010 #include "wvmoniker.h" 00011 #include "wvdiriter.h" 00012 #include "unifiletreegen.h" 00013 00014 UniConfFileTreeGen::UniConfFileTreeGen(WvStringParm _basedir, WvStringParm _moniker) : 00015 basedir(_basedir), moniker(_moniker), log(_basedir, WvLog::Info) 00016 { 00017 log(WvLog::Notice, 00018 "Creating a new FileTree based on '%s'.\n", basedir); 00019 } 00020 00021 bool UniConfFileTreeGen::refresh() 00022 { 00023 // Create an iterator to go through the basedirectory and 00024 // it's sub directories, to add all non-included files into the 00025 // UniConf repository. 00026 WvDirIter i(basedir, true); 00027 00028 00029 for (i.rewind(); i.next();) 00030 { 00031 WvString filename = i->fullname; 00032 WvString unikey = i->relname; 00033 00034 log(WvLog::Debug1, WvString("Checking if %s exists already.\n", unikey)); 00035 00036 if (!exists(unikey)) 00037 { 00038 log(WvLog::Notice, WvString("%s doesn't exists!\n", unikey)); 00039 WvString mountstring("%s:%s",moniker,filename); 00040 log(WvLog::Notice, WvString("Mounting with: %s", mountstring)); 00041 mount(unikey, mountstring, true); 00042 } 00043 } 00044 00045 UniMountTreeGen::refresh(); 00046 return true; 00047 } 00048 00049

Generated on Tue Oct 5 01:09:19 2004 for WvStreams by doxygen 1.3.7