home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
outputfile.tcl
< prev
next >
Wrap
Text File
|
1997-06-12
|
2KB
|
77 lines
# Copyright (c) 1996 by Cayenne Software Inc.
#
# This software is furnished under a license and may be used only in
# accordance with the terms of such license and with the inclusion of
# the above copyright notice. This software or any other copies thereof
# may not be provided or otherwise made available to any other person.
# No title to and ownership of the software is hereby transferred.
#
# The information in this software is subject to change without notice
# and should not be construed as a commitment by Cayenne Software Inc
#
#---------------------------------------------------------------------------
#
# File : @(#)outputfile.tcl /main/titanic/1
# Author : H. Broeze
# Original date : 6 Sep 1996
# Description : Installation of RTM integration
#
#---------------------------------------------------------------------------
#
# @(#)outputfile.tcl /main/titanic/1 12 Jun 1997 Copyright 1996 Cayenne Software
# Start user added include file section
# End user added include file section
Class OutputFile : {GCObject} {
method destructor
constructor
attribute outputFileId
attribute fileAsList
attribute fileAsDict
attribute fileContents
}
method OutputFile::destructor {this} {
# Start destructor user section
close [$this outputFileId]
# End destructor user section
}
constructor OutputFile {class this outFileName {seperator " "}} {
set this [GCObject::constructor $class $this ]
set outputFileId [open $outFileName r]
set tempFileAsList ""
set tempFileAsDict [Dictionary new]
set contents ""
set line [string trim [gets $outputFileId] ""]
while {[eof $outputFileId] != 1} {
set contents [concat $contents $line]
set splittedLine ""
# skip blanks
foreach word [split $line $seperator] {
if {$word != ""} {
lappend splittedLine [string trim $word " "]
}
}
if {[llength $splittedLine] == 2} {
$tempFileAsDict set [lindex $splittedLine 0] [lindex $splittedLine 1]
}
lappend tempFileAsList "$splittedLine"
set line [string trim [gets $outputFileId] ""]
}
$this fileAsDict $tempFileAsDict
$this fileAsList $tempFileAsList
$this outputFileId $outputFileId
$this fileContents $contents
return $this
}
# Do not delete this line -- regeneration end marker