home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1997
- #
- # File: @(#)checkutil.tcl /main/titanic/2
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)checkutil.tcl /main/titanic/2 14 May 1997 Copyright 1997 Cayenne Software Inc.
-
- # Start user added include file section
- # End user added include file section
-
-
- Class CheckUtil : {Object} {
- constructor
- method destructor
- }
-
- constructor CheckUtil {class this} {
- set this [Object::constructor $class $this]
- # Start constructor user section
- # End constructor user section
- return $this
- }
-
- method CheckUtil::destructor {this} {
- # Start destructor user section
- # End destructor user section
- }
-
- proc CheckUtil::showErrors {} {
- #
- # Function to show the errors and warnings.
- #
- m4_message $M_NEWLINE
- m4_message $M_ERRORS [M4CheckManager::getErrorCount]
- m4_message $M_WARNINGS [M4CheckManager::getWarningCount]
- }
-
- proc CheckUtil::addAttributes {obj attrs} {
- #
- # Set/Add attributes of an object.
- # Useful to set attributes of oopl objects created using add_class,
- # add_operation, add_super_class.
- #
- foreach attr $attrs {
- $obj addRunTimeProperty [lindex $attr 0] [lindex $attr 1]
- }
- }
-
- proc CheckUtil::getDiagram {obj} {
- #
- # Given an object with the attributes 'diagram_name' and 'diagram_type',
- # return a string that concatenates these two.
- #
- return "[$obj getDiagramName].[$obj getDiagramType]"
- }
-
- proc CheckUtil::isUniqueNameList {names} {
- #
- # Return 0 if all names in the given list are unique, 1 if one or more
- # names occur more than once.
- #
- while {![lempty $names]} {
- set p [lindex $names 0]
- set names [lreplace $names 0 0]
- if {[lsearch $names $p] != -1} {
- return 0
- }
- }
- return 1
- }
-
- proc CheckUtil::findUniqueNames {names} {
- #
- # Return a list of all unique names present in the passed list.
- #
- set unique {}
- foreach n $names {
- if {[lsearch -exact $unique $n] == -1} {
- lappend unique $n
- }
- }
- return $unique
- }
-
- proc CheckUtil::debug {arg} {
- if{$debug}{puts stderr " ** $arg **"}
- }
-
- # Do not delete this line -- regeneration end marker
-
-