home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1997
- #
- # File: @(#)vsdirobj.tcl /main/titanic/3
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)vsdirobj.tcl /main/titanic/3 29 Aug 1997 Copyright 1997 Cayenne Software Inc.
-
- # Start user added include file section
- # End user added include file section
-
-
- # This class represents a VCM directory in the browser.
-
- Class VSDirObj : {Object} {
- constructor
- method destructor
- method uiClass
- method promoter
- method openFile
- method showFile
- method editFile
- method path
- method addContents
- method showFileVersion
- method fileSet
- method addFile
- method removeFile
- attribute _fileSet
- }
-
- constructor VSDirObj {class this name} {
- set this [Object::constructor $class $this $name]
- $this _fileSet [List new]
- # Start constructor user section
- # End constructor user section
- return $this
- }
-
- method VSDirObj::destructor {this} {
- foreach ref [[$this _fileSet] contents] {
- $ref _directory ""
- }
- # Start destructor user section
- # End destructor user section
- }
-
-
- # Return ExternalDirectoryVersion.
- #
- method VSDirObj::uiClass {this} {
- return "ExternalDirectoryVersion"
- }
-
- method VSDirObj::promoter {this} {
- $this _fileSet [List new]
- }
-
-
- # Do nothing: the directory is always open in the browser.
- #
- method VSDirObj::openFile {this} {
- }
-
-
- # Do nothing: the directory contents are always shown in the browser.
- #
- method VSDirObj::showFile {this} {
- }
-
-
- # Do nothing: a directory cannot be edited directly.
- #
- method VSDirObj::editFile {this} {
- }
-
-
- # Return path of this directory using the system path and the path stored in
- # ExternalLink. The latter is processed for platform conformance.
- #
- method VSDirObj::path {this} {
- set systemPath [[$this systemVersion] path]
-
- # path part starts with ./ ; strip this
- set pathPart [string range [$this ExternalLink::path] 2 end]
- # convert slashes
- set partList [split $pathPart {[\\\/]}]
- set pathPart [eval file join $partList]
-
- return [path_name concat $systemPath $pathPart]
- }
-
-
- # Add contents of this and subdirectories to fileList
- # and add paths to pathList.
- #
- method VSDirObj::addContents {this fileList pathList} {
- upvar $fileList files
- upvar $pathList paths
-
- [$this fileSet] foreach file {
- lappend files $file
- if [$file isDirectory] {
- lappend paths [$file path]
- $file addContents files paths
-
- }
- }
- }
-
-
- # List the contents of the specified version.
- #
- method VSDirObj::showFileVersion {this version} {
- # !! Implement this function !!
- }
-
- # Do not delete this line -- regeneration end marker
-
- method VSDirObj::fileSet {this} {
- return [$this _fileSet]
- }
-
- method VSDirObj::addFile {this newFile} {
- [$this _fileSet] append $newFile
- $newFile _directory $this
- }
-
- method VSDirObj::removeFile {this oldFile} {
- $oldFile _directory ""
- [$this _fileSet] removeValue $oldFile
- }
-
-