home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
vsfile.tcl
< prev
next >
Wrap
Text File
|
1997-08-29
|
4KB
|
157 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)vsfile.tcl /main/titanic/6
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)vsfile.tcl /main/titanic/6 29 Aug 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
# End user added include file section
# This class represents a VSFile. It provides
# an abstract interface that all subclasses must
# implement, as well as general VSFile functionality.
Class VSFile : {Object} {
method destructor
constructor
method path
method vsPath
method updatePath
method createVSPath
method createUserPath
method setClass
method getClass
method isNil
# Cache for file path name in user environment.
#
attribute _path
# Cache for file path in VS environment.
#
attribute _vsPath
# List of temporary files that have been used as
# reference to a version of this file.
#
attribute references
# Name of this file.
#
attribute name
# ObjectTeam type of this file.
#
attribute type
# project to which this file belongs.
#
attribute project
attribute systemVersion
}
# The name of the attribute that is used to store
# generated class info.
#
global VSFile::classAttribute
set VSFile::classAttribute "CLASSNAME"
method VSFile::destructor {this} {
# Start destructor user section
# End destructor user section
}
# Creates file in given system with given type,
# set project and name.
#
constructor VSFile {class this name type system} {
set this [Object::constructor $class $this $name]
$this systemVersion $system
$this type $type
$this project [$system project]
$this name [$system objectToFileName $name $type]
return $this
}
# Returns the user environment path of this object.
#
method VSFile::path {this} {
if { [$this _path] == "" } {
$this _path [[$this systemVersion] vsFileUserPath \
[$this name] [$this type]]
}
return [$this _path]
}
# Returns the path of the file in the VS environment.
#
method VSFile::vsPath {this} {
if { [$this _vsPath] == "" } {
$this _vsPath [[$this systemVersion] vsFileVSPath \
[$this name] [$this type]]
}
return [$this _vsPath]
}
# Refresh the path information
# in _path and _vsPath.
#
method VSFile::updatePath {this} {
$this _path ""
$this _vsPath ""
}
# This method creates the path of this file in the VS environment.
#
method VSFile::createVSPath {this type} {
set vsPath [path_name directory [$this vsPath]]
VSSystem::createVSPath "${type}System" $vsPath
}
# This method creates the path of this file in
# the user environment.
#
method VSFile::createUserPath {this type} {
set userPath [path_name directory [$this path]]
VSSystem::createUserPath "${type}System" $userPath
}
# Associate this VSFile with the given classname.
#
method VSFile::setClass {this className} {
global VSFile::classAttribute
$this setAttribute ${VSFile::classAttribute} $className
}
# Get the associated classname of this file.
#
method VSFile::getClass {this} {
global VSFile::classAttribute
return [$this getAttributeValue ${VSFile::classAttribute}]
}
# Simulate repository objects by implementing this method.
#
method VSFile::isNil {this} {
return 0
}
# Do not delete this line -- regeneration end marker