home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
IBASE.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-22
|
12KB
|
253 lines
#ifndef _IBASE_
#define _IBASE_
/*******************************************************************************
* FILE NAME: ibase.hpp *
* *
* DESCRIPTION: *
* Declaration of the class(es): *
* IBase - Empty "base" class to reduce global name space pollution *
* *
* COPYRIGHT: *
* Licensed Materials - Property of IBM *
* (C) Copyright IBM Corporation 1992, 1993 *
* All Rights Reserved *
* US Government Users Restricted Rights - Use, duplication, or disclosure *
* restricted by GSA ADP Schedule Contract with IBM Corp. *
* *
*******************************************************************************/
#ifndef _IEXCBASE_
#include <iexcbase.hpp>
#endif
/*----------------------------------------------------------------------------*/
/* Align classes on four byte boundary. */
/*----------------------------------------------------------------------------*/
#pragma pack(4)
class ostream;
class IString;
class IBase {
/*******************************************************************************
* The IBase class encapsulates the set of names that otherwise would be *
* in global scope. All other classes in the library inherit from this class. *
* Thus the types and enumeration values defined here can be used in those *
* classes without the qualifying IBase:: prefix. *
* *
* Other code, not within the scope of IBase, must use either the qualified *
* names or the simplified synonyms declared in ISYNONYM.HPP. *
*******************************************************************************/
public:
/*------------------------------ Related Types ---------------------------------
| This class declares a global Boolean type and enumeration, both of which |
| are used throughout the library: |
| |
| Boolean - General true or false type used as an argument or |
| return value for many member functions. |
| BooleanConstants - Enumeration that defines constant values for false |
| and true. Never test for equality to be true, |
| because any non-zero value should be considered true. |
| This constant provides a useful mnemonic for setting |
| a Boolean. |
------------------------------------------------------------------------------*/
typedef int
Boolean;
enum BooleanConstants {
false = 0,
true = 1
};
/*------------------------------- Message File ---------------------------------
| The following functions provide access to the message file used to hold |
| exception text used by the class library for throwing exceptions: |
| messageFile - Returns the name of the message file used to load |
| library exception text. If setMessageFile has been |
| called with the name of a message file, its name will be |
| returned. Otherwise, the environment variable |
| "ICLUI MSGFILE" is checked for the name of a message |
| file which is returned. Set the environment variable |
| using "SET ICLUI MSGFILE=mymsgfile.msg". (The file |
| extension, typically msg, must be specified.) Finally, |
| if the environment variable has not been set, the default |
| message file DDE4UILE.MSG will be used. |
| setMessageFile - Sets the message file from which the class library |
| exception text is loaded. The name must include the |
| file extension. |
| messageText - Returns the message text associated with the message ID |
| specified. Up to nine optional text strings can be |
| passed in to be inserted in the message. The message |
| will be loaded from program if it is found in a message |
| segment that has been bound to the .EXE. Otherwise it is |
| searched for in the current message file described above. |
| The search for this file is as follows: |
| - The system root directory. |
| - The current working directory. |
| - Using the DPATH environment setting. |
| - Using the APPEND environment setting. |
------------------------------------------------------------------------------*/
static char
*messageFile ( );
static void
setMessageFile ( const char *msgFileName );
static IMessageText
messageText ( unsigned long messageId,
const char* textInsert1 = 0,
const char* textInsert2 = 0,
const char* textInsert3 = 0,
const char* textInsert4 = 0,
const char* textInsert5 = 0,
const char* textInsert6 = 0,
const char* textInsert7 = 0,
const char* textInsert8 = 0,
const char* textInsert9 = 0 );
/*------------------------------- Diagnostics ----------------------------------
| Use the following functions to provide diagnostic information: |
| |
| operator << - Permits any library object to be dumped to an ostream, |
| such as cout << anObject;. |
| Note: IBase cannot provide any useful information about |
| the object, so this function should be overridden in |
| all subclasses. |
| asString - Obtains the standard version of an object's contents. |
| asDebugInfo - Obtains the diagnostic version of an object's contents. |
| Version - Structure (data type) that defines the version specifier |
| (comprised of major and minor version numbers). |
| version - Static function that returns the library version. |
------------------------------------------------------------------------------*/
friend ostream
&operator << ( ostream &aStream,
const IBase &anObject );
IString
asString ( ) const,
asDebugInfo ( ) const;
struct Version {
unsigned short
major,
minor;
};
static Version
version ( );
protected:
/*------------------------------ Implementation --------------------------------
| These data members are provided as synonyms for the IException::Severity |
| enumeration which is used when constructing an instance of IException or |
| one of its subclasses: |
| unrecoverable - Synonym for IException::unrecoverable. |
| recoverable - Synonym for IException::recoverable. |
------------------------------------------------------------------------------*/
static IException::Severity
unrecoverable,
recoverable;
private: /*------------------------ PRIVATE ----------------------------------*/
static char
*msgFile;
}; // IBase
/*------------------------------ Version Levels --------------------------------
| IC_MAJOR_VERSION - Defines the major version level of the library which is |
| used by IBase::version(). It is incremented by 1 for |
| each new release, and by 100 for each new version. It |
| can also be used by client applications to conditionally |
| compile their code. |
| IC_MINOR_VERSION - Defines the minor version level of the library which is |
| used by IBase::version(). It starts at 0 for each major |
| version level and is incremented by 1 for each CSD. It |
| can also be used by client applications to conditionally |
| compile their code. |
------------------------------------------------------------------------------*/
#define IC_MAJOR_VERSION 201
#define IC_MINOR_VERSION 0
/*-------------------------- Static Object Priority ----------------------------
| IBASE_PRIORITY - Defines the base "static object construction priority" |
| for the library. |
| Classes that have static objects that |
| require construction must define a comparable value, |
| such as IWINDOW_PRIORITY. |
| The value must be greater than the priority value |
| of all classes whose static objects |
| must be constructed first. |
------------------------------------------------------------------------------*/
#define IBASE_PRIORITY -2147483647 - 1 + 1024
#ifdef __BORLANDC__
#define _System _syscall
#define _Optlink _fastcall
#endif
#ifdef __ZTC__
#define _System pascal far
#define _Optlink
#endif
#ifdef __xlC__
#define _System
#define _Optlink
#endif
extern "C" {
typedef void * _System
IWinProc ( unsigned long, unsigned long, void *, void * );
}
#ifndef IC_RUNTIME
#define IC_RUNTIME
#endif
#define IC_TRACE_RUNTIME
#ifdef IC_DEVELOP
#define IC_TRACE_DEVELOP
#endif
#ifdef IC_TRACE_ALL
#define IC_TRACE_DEVELOP
#endif
#define IC_UM_BASE ( 0xFFE0 )
#define IC_UM_DRAGDROP_RENDER ( IC_UM_BASE + 1 )
#define IC_UM_CANVAS_SETFOCUS ( IC_UM_BASE + 2 )
#define IC_UM_CANVAS_PAINT ( IC_UM_BASE + 3 )
#define IContainerObject ICnrObj
#define IContainerControl ICnrCtl
#define IDDEClientAcknowledgeEvent IDDECAckEvt
#define IDDEServerAcknowledgeEvent IDDESAckEvt
#define IDDEServerConversation IDDESConv
#define IDDEServerHotLink IDDESHotLnk
#define IDDEServerHotLinkItem IDDESHLItem
#define IDDEActiveServer IDDEActServ
#define IDDEClientHotLinkEvent IDDECHLEvt
#define IDDEClosedConversation IDDEClsConv
#define IRowColumnCanvas IRCCv
#define AlignmentTag Tag
#define RowColumn RCol
/*----------------------------------------------------------------------------*/
/* Resume compiler default packing. */
/*----------------------------------------------------------------------------*/
#pragma pack()
#ifndef _ISYNONYM_
#include <isynonym.hpp>
#endif
#endif /* _IBASE_ */