home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
moduledbdi.tcl
< prev
next >
Wrap
Text File
|
1997-10-03
|
3KB
|
94 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)moduledbdi.tcl /main/titanic/2
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)moduledbdi.tcl /main/titanic/2 3 Oct 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
require "moduledbpa.tcl"
# End user added include file section
Class ModuleDBDirInfo : {GCObject} {
constructor
method destructor
method initialize
method getModuleDBPathInfo
method getModPathInfo
method setModPathInfo
method removeModPathInfo
attribute moduleDir
attribute modPathInfo
}
constructor ModuleDBDirInfo {class this i_moduleDir} {
set this [GCObject::constructor $class $this]
$this moduleDir $i_moduleDir
$this modPathInfo [Dictionary new]
# Start constructor user section
$this initialize
# End constructor user section
return $this
}
method ModuleDBDirInfo::destructor {this} {
# Start destructor user section
# End destructor user section
}
method ModuleDBDirInfo::initialize {this} {
set moduleDir [$this moduleDir]
set modules [glob -nocomplain [file join $moduleDir *]]
foreach module $modules {
# Mind the slash/backslash problems with glob ...
set moduleName [file tail $module]
set modulePath [path_name concat $moduleDir $moduleName]
set propFile \
[path_name concat $modulePath properties properties]
if {!([file isfile $propFile] && [file readable $propFile])} {
continue
}
set modPathInfo [ModuleDBPathInfo new $modulePath]
if $win95 {
set moduleNameAsKey [string tolower $moduleName]
} else {
set moduleNameAsKey $moduleName
}
$this setModPathInfo $moduleNameAsKey $modPathInfo
}
}
method ModuleDBDirInfo::getModuleDBPathInfo {this moduleName} {
if $win95 {
set moduleNameAsKey [string tolower $moduleName]
} else {
set moduleNameAsKey $moduleName
}
set modPathInfo [$this getModPathInfo $moduleNameAsKey]
if {$modPathInfo == ""} {
set modulePath [path_name concat [$this moduleDir] $moduleName]
set modPathInfo [ModuleDBPathInfo new $modulePath]
$this setModPathInfo $moduleNameAsKey $modPathInfo
}
return $modPathInfo
}
# Do not delete this line -- regeneration end marker
method ModuleDBDirInfo::getModPathInfo {this moduleName} {
return [[$this modPathInfo] set $moduleName]
}
method ModuleDBDirInfo::setModPathInfo {this moduleName newModPathInfo} {
[$this modPathInfo] set $moduleName $newModPathInfo
}
method ModuleDBDirInfo::removeModPathInfo {this moduleName} {
[$this modPathInfo] unset $moduleName
}