home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
moduledbpa.tcl
< prev
next >
Wrap
Text File
|
1997-10-03
|
3KB
|
107 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)moduledbpa.tcl /main/titanic/2
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)moduledbpa.tcl /main/titanic/2 3 Oct 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
# End user added include file section
Class ModuleDBPathInfo : {GCObject} {
constructor
method destructor
method initialize
method addPropName
method removePropName
method getPropValue
method setPropValue
method removePropValue
attribute modulePath
attribute isValidModule
attribute propNameSet
attribute propValue
}
constructor ModuleDBPathInfo {class this i_modulePath} {
set this [GCObject::constructor $class $this]
$this isValidModule 0
$this modulePath $i_modulePath
$this propNameSet [List new]
$this propValue [Dictionary new]
# Start constructor user section
$this initialize
# End constructor user section
return $this
}
method ModuleDBPathInfo::destructor {this} {
# Start destructor user section
# End destructor user section
}
method ModuleDBPathInfo::initialize {this} {
# Read properties.properties file
#
set propFile [path_name concat [$this modulePath] properties properties]
if {!([file isfile $propFile] && [file readable $propFile])} {
return
}
set propLines [readConfigurationFile $propFile]
foreach propLine $propLines {
set propName [lindex $propLine 0]
$this setPropValue $propName [lindex $propLine 1]
$this addPropName $propName
}
# A module must have the following properties set in order to be a
# valid module: 'name', 'type' and 'longName'. Also, the 'moduleName'
# and the 'name'-property must compare equal (case insensitive on
# windows).
#
set moduleName [file tail [$this modulePath]]
set nameProp [$this getPropValue "name"]
if $win95 {
set moduleName [string tolower $moduleName]
set nameProp [string tolower $nameProp]
}
if {$moduleName != $nameProp} {
return
}
if {[$this getPropValue "type"] == ""} {
return
}
if {[$this getPropValue "longName"] == ""} {
return
}
$this isValidModule 1
}
# Do not delete this line -- regeneration end marker
method ModuleDBPathInfo::addPropName {this newPropName} {
[$this propNameSet] append $newPropName
}
method ModuleDBPathInfo::removePropName {this oldPropName} {
[$this propNameSet] removeValue $oldPropName
}
method ModuleDBPathInfo::getPropValue {this propName} {
return [[$this propValue] set $propName]
}
method ModuleDBPathInfo::setPropValue {this propName newPropValue} {
[$this propValue] set $propName $newPropValue
}
method ModuleDBPathInfo::removePropValue {this propName} {
[$this propValue] unset $propName
}