home *** CD-ROM | disk | FTP | other *** search
/ PC World 1997 November / PCWorld_1997-11_cd.bin / software / programy / komix / DATA.Z / stfilehand.tcl < prev    next >
Text File  |  1997-04-25  |  2KB  |  100 lines

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Cayenne Software Inc.    1997
  4. #
  5. #      File:           @(#)stfilehand.tcl    /main/hindenburg/2
  6. #      Author:         <generated>
  7. #      Description:
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)stfilehand.tcl    /main/hindenburg/2   25 Apr 1997 Copyright 1997 Cayenne Software Inc.
  10.  
  11. # Start user added include file section
  12. # End user added include file section
  13.  
  14. require "filehandle.tcl"
  15.  
  16. # This class is responsible for Smalltalk 
  17. # specific file handling.
  18.  
  19. Class STFileHandler : {FileHandler} {
  20.     constructor
  21.     method destructor
  22.     method getSpecialFiles
  23.     method getFileTypes
  24.     method getImportFileName
  25.     method getExportFileName
  26.     method sourceTclFiles
  27.  
  28.     # The Smalltalk file type. All methods using
  29.     # the Smalltalk file type query this attribute.
  30.     #
  31.     attribute stType
  32. }
  33.  
  34. constructor STFileHandler {class this} {
  35.     set this [FileHandler::constructor $class $this]
  36.     # Start constructor user section
  37.     $this stType "st"
  38.     # End constructor user section
  39.     return $this
  40. }
  41.  
  42. method STFileHandler::destructor {this} {
  43.     # Start destructor user section
  44.     # End destructor user section
  45.     $this FileHandler::destructor
  46. }
  47.  
  48.  
  49. # Returns a list with special file names for Smalltalk: the import
  50. # and the export file.
  51. #
  52. method STFileHandler::getSpecialFiles {this} {
  53.     set list [List new]
  54.     $list append [$this getImportFileName]
  55.     $list append [$this getExportFileName]
  56.     return $list
  57. }
  58.  
  59.  
  60. # Returns a list with Smalltalk file types: stType.
  61. #
  62. method STFileHandler::getFileTypes {this} {
  63.     set list [List new]
  64.     $list append [$this stType]
  65.     return $list
  66. }
  67.  
  68.  
  69. # Returns the file name for the file with the import script.
  70. #
  71. method STFileHandler::getImportFileName {this} {
  72.     return "vwimport.[$this stType]"
  73.  
  74. }
  75.  
  76.  
  77. # Returns the file name for the file with the export script.
  78. #
  79. method STFileHandler::getExportFileName {this} {
  80.     return "vwexport.[$this stType]"
  81. }
  82.  
  83.  
  84. # Source u_genst.tcl if it exists.
  85. # Call FileHandler::sourceTclFiles.
  86. #
  87. method STFileHandler::sourceTclFiles {this} {
  88.     set cc [ClientContext::global]
  89.  
  90.     if {[$cc customFileExists u_genst tcl "" 0]} {
  91.         require u_genst.tcl
  92.     }
  93.  
  94.     $this FileHandler::sourceTclFiles
  95. }
  96.  
  97. # Do not delete this line -- regeneration end marker
  98.  
  99.