home *** CD-ROM | disk | FTP | other *** search
-
- /*
- * This file was generated by the SOM Compiler.
- * Generated using:
- * SOM incremental update: 10.9
- */
-
-
- #ifndef lint
- static char *sccsid = "%Z% %I% %W% %G% %U% [%H% %T%] (c)IBM Corp. 1992";
- #endif
-
- /*
- * This class is adapted from the book
- * Class Construction in C and C++, Object Oriented Fundamentals
- * by Roger Sessions, Copyright (c) 1992 Prentice Hall.
- * Reprinted with permission.
- */
-
- #define textLine_Class_Source
- #if defined(_WIN32)
- #include "statcls.h"
- #endif
- #include "textline.ih"
- #include "helper.h"
- #include "tpword.h"
-
- /* ************************************************************ */
- /*
- * Initialize a new text line with the number of characters
- * it can contain.
- */
-
- SOM_Scope void SOMLINK tlInit(textLine *somSelf,
- long newSize)
- {
- textLineData *somThis = textLineGetData(somSelf);
- textLineMethodDebug("textLine", "tlInit");
- _totalChars = 0;
- _maxSize = newSize;
- }
-
- /* ************************************************************ */
- /*
- * Returns the number of characters in a textLine.
- */
-
- SOM_Scope long SOMLINK tlCharsInLine(textLine *somSelf)
- {
- textLineData *somThis = textLineGetData(somSelf);
- textLineMethodDebug("textLine", "tlCharsInLine");
- return _totalChars;
-
- }
-
- /* ************************************************************ */
- /*
- * Returns the number of characters that can still be placed
- * in the textLine.
- */
-
- SOM_Scope long SOMLINK tlCharsLeft(textLine *somSelf)
- {
- textLineData *somThis = textLineGetData(somSelf);
- textLineMethodDebug("textLine", "tlCharsLeft");
- return _maxSize - _totalChars;
- }
-
- /* ************************************************************ */
- SOM_Scope baseType *SOMLINK llAddTail(textLine * somSelf,
- baseType * newElement)
- {
- textLineData *somThis = textLineGetData(somSelf);
- TPWord *myWord = (TPWord *) newElement;
- int newTotal;
- textLineMethodDebug("textLine", "llAddTail");
-
- newTotal = _totalChars + __get_length(newElement);
- if (newTotal <= _maxSize) {
- _totalChars = newTotal;
- return (parent_llAddTail(somSelf, newElement));
- }
- else
- return newElement;
- }
-
- /* ************************************************************ */
- SOM_Scope baseType *SOMLINK llAddHead(textLine * somSelf,
- baseType * newElement)
- {
- textLineData *somThis = textLineGetData(somSelf);
- TPWord *myWord = (TPWord *) newElement;
- int newTotal;
- textLineMethodDebug("textLine", "llAddHead");
-
- newTotal = _totalChars + __get_length(newElement);
- if (newTotal <= _maxSize) {
- _totalChars = newTotal;
- return (parent_llAddHead(somSelf, newElement));
- }
- else
- return newElement;
- }
-
- /* ************************************************************ */
- SOM_Scope baseType *SOMLINK llReplace(textLine * somSelf,
- baseType * newElement)
- {
- textLineData *somThis = textLineGetData(somSelf);
- textLineMethodDebug("textLine", "llReplace");
- shouldHaveOverridden(somSelf, "llReplace");
- newElement;
- return (baseType *) NULL;
- }
-
- /* ************************************************************ */
- SOM_Scope void SOMLINK somInit(textLine * somSelf)
- {
- textLineData *somThis = textLineGetData(somSelf);
- textLineMethodDebug("textLine", "somInit");
- parent_somInit(somSelf);
- _maxSize = 0;
- _totalChars = 0;
- }
-
- /* ************************************************************ */
- SOM_Scope void SOMLINK somUninit(textLine * somSelf)
- {
- textLineData *somThis = textLineGetData(somSelf);
- textLineMethodDebug("textLine", "somUninit");
-
- parent_somUninit(somSelf);
- }
-
- /* ************************************************************ */
-
- /*
- * SOM_Scope void SOMLINK somDumpSelfInt(textLine * somSelf,
- * int level)
- */
-
- /*
- * The prototype for somDumpSelfInt was replaced by the following prototype:
- */
- SOM_Scope void SOMLINK somDumpSelfInt(textLine *somSelf,
- long level)
- {
- textLineData *somThis = textLineGetData(somSelf);
- textLineMethodDebug("textLine", "somDumpSelfInt");
-
- parent_somDumpSelfInt(somSelf, level);
- }
-