Index Of Classes

  • AutoObject
  • BuffedFile
  • CharArray
  • FStreamCheck
  • FStreamError
  • NamedObject
  • OurString
  • TemplateArray
  • TemplatePointer


  • Index Of "C" Utility Methods

  • char * makeFullFileName ( char * szFullName , const char * cszPath , const char * cszFileName )
  • const char * replaceExtension ( char * szFilePath , const char * cszNewExt )
  • unsigned memCount ( const char * pccSrch , char c , size_t stLen )
  • short memIsBlank ( const char * pcTest , size_t stLen )
  • const void * memrchr ( const void * pcvSrch , char c , size_t stLen )
  • char * strCopyFill ( char * szDest , const char * cszSrc , char c , size_t stLen )
  • unsigned strCount ( const char * pccSrch , char c )
  • short strIsBlank ( const char * cszTest)
  • short strIsValid ( const char * cszTest )
  • size_t strLen ( const char * csz )
  • char * strLTrim ( char * szLine )
  • char * strReset ( char ** ppcDest , const char * cszSrc )
  • char * strRTrim ( char * szLine )
  • char * strStripNewLine ( char * szLine )
  • char * strTermCpy ( char * szDest , const char * cszSrc , size_t stLen )
  • char * strTermFill ( char * szDest , const char * cszSrc , char c , size_t stLen )
  • char * strToLower ( char * sz )
  • char * strToUpper ( char * sz )


  • Class AutoObject

  • Description
  • Derivation
  • Constructors
  • Public Methods
  • Protected Methods


  • AutoObject Description

    autoobj.hpp - The class AutoObject is used as a superclass or a mixin class that provides a flag that determines whether the contents of the subclass should be deleted when the object goes out of scope.



    AutoObject Derivation

        NamedObject
             |
        AutoObject
    



    AutoObject Constructors

  • AutoObject ( Boolean bAutoDestroy = true )
  • AutoObject ( const AutoObject & rcautobj )


  • AutoObject Public Methods

  • virtual const char * className () const
  • virtual void deleteMem () = 0
  • virtual void destroy ()
  • Boolean setDestroy ( Boolean bAutoDestroy = true )
  • Boolean willDestroy () const


  • AutoObject :: AutoObject ( Boolean bAutoDestroy = true )

    ARGUMENTS :

    Boolean bAutoDestroy = true
    This flag should be true if we want the object being constructed to delete its' contents' when it goes out of scope and false otherwise.

    DESCRIPTION :

    This method constructs an AutoObject and sets its' internal destroy flag to the value of the argument 'bAutoDestroy'.



    AutoObject :: AutoObject ( const AutoObject & rcautobj )

    ARGUMENTS :

    const AutoObject & rcautobj
    A reference to a constant AutoObject that will be the source for this DEEP copy constructor.

    DESCRIPTION :

    This method is the AutoObject copy constructor. It constructs an AutoObject that is a DEEP copy of its' argument 'rcautobj'.



    virtual const char * AutoObject :: className () const

    RETURNS :

    A constant pointer to the ASCIIZ string "AutoObject"

    DESCRIPTION :

    This VIRTUAL constant method always returns the class name of the receiver. This may be used to implement a primitive Run Time Type Identification, (RTTI), or anything else you like. Note that this IS a virtual function, and will early bind in the constructors and destructor. Thus you can also use this method to determine in which constructor level you are, although I don't know why you would want to know that!



    virtual void AutoObject :: deleteMem () = 0

    DESCRIPTION :

    This method must be defined in the child class. It deletes the receivers' internal memory pointer and sets that pointer to point to 0, (Preventing a Run Time Error if a second delete attempt is made.) This method is not intended to be called directly, but rather is called by virtual void AutoObject :: destroy (). Nonetheless, this method is made public since it provides an ABSOLUTELY SURE way to destroy the contents of the receiver irregardless of the return value of "Boolean AutoObject :: willDestroy () const"



    virtual void AutoObject :: destroy ()

    DESCRIPTION :

    This VIRTUAL method deletes the receivers' internal memory by calling the receivers' 'deleteMem ()' method. The latter method is a pure virtual method in the class AutoObject and must be defined in the child class. The method virtual void AutoObject :: destroy () checks the return value of the 'AutoObject :: willDestroy ()' to determine if the memory SHOULD be deleted. If that method returns true, the memory is deleted by 'deleteMem ()'.



    Boolean AutoObject :: setDestroy ( Boolean bAutoDestroy = true )

    ARGUMENTS :

    Boolean bAutoDestroy
    This flag should be true if we want the receiver to delete its' contents' when it goes out of scope and false otherwise.

    RETURNS :

    The value of the argument 'bAutoDestroy'.

    DESCRIPTION :

    This method is the accessor that sets the value of the receivers' internal destroy flag to the value of the argument 'bAutoDestroy'.



    Boolean AutoObject :: willDestroy () const

    RETURNS :

    The value of the receivers' internal destroy flag.

    DESCRIPTION :

    This method is the accessor that gets the value of the receivers' internal destroy flag. The value of this flag determines whether the contents of the receiver should be deleted when it goes out of scope.



    Class BuffedFile

  • Description
  • Derivation
  • Constructors
  • Public Methods
  • Protected Methods


  • BuffedFile Description

    buffile.hpp - The class BuffedFile reads an entire file into memory and then closes the file. Its' purpose is to provide the ability to treat a file as a memory buffer. Thus this class is a little bit like a UNIX memory mapped file. However, unlike a UNIX memory mapped file, once the physical disk file has been read into memory, it is closed, unlocked and is available to other processes.



    BuffedFile Derivation

      fstream   NamedObject
          |       |
         FStreamCheck
              |
         BuffedFile
    



    BuffedFile Constructors

  • BuffedFile ( const char * cszFileName = 0 , int nIO_Mode = cnDEF_IN_MODE )
  • BuffedFile ( const char * ccaBuffer , size_t stBuffLength )


  • BuffedFile Public Methods

  • virtual char * buffer ()
  • virtual const char * buffer () const
  • virtual const char * className () const
  • virtual void flush ( const char * cszFileName , int nIO_Mode = cnDEF_OUT_MODE )
  • size_t length () const
  • virtual char * read ( const char * cszFileName , int nIO_Mode = cnDEF_IN_MODE )


  • BuffedFile Protected Methods

  • CharArray & charArray ()
  • const CharArray & charArray () const
  • size_t setLength ( size_t stBuffLength )


  • BuffedFile :: BuffedFile ( const char * cszFileName = 0 , int nIO_Mode = cnDEF_IN_MODE )

    ARGUMENTS :

    const char * cszFileName = 0
    The name of the file we wish to read into memory
    int nIO_Mode = cnDEF_IN_MODE
    The set of ios flags to be used in opening the file for reading. This argument defaults to cnDEF_IN_MODE.

    DESCRIPTION :

    This attempts to construct a BuffedFile object by reading the file named in the argument 'cszFileName' into memory.

    EXCEPTIONS :

    If any IO error occurs, an FStreamError exception is thrown. If there is not enough memory left on the system to allocate a buffer large enough to hold the contents of the entire file, an IOutOfMemory exception is thrown.



    BuffedFile :: BuffedFile ( const char * ccaBuffer , size_t stBuffLength )

    ARGUMENTS :

    const char * ccaBuffer
    A pointer to a constant area of memory. The first 'stBuffLength' bytes of this buffer will be copied into the the internal buffer of the object being constructed.
    size_t stBuffLength
    The initial buffer size that the object being constructed should allocate. I.e. the object being constructed will allocate an internal buffer of this size.

    DESCRIPTION :

    This method attempts to construct a BuffedFile object as a DEEP copy of a pre-existing buffer. Alternatively, by providing just the length, and a buffer argument of 0, a BuffedFile Object will be constructed with a buffer of length 'stBuffLength', whose contents are all 0. This constructor is useful when one wishes to manipulate an area of memory and then write the contents of that area to a disk file.

    EXCEPTIONS :

    If any IO error occurs, an FStreamError exception is thrown. If there is not enough memory left on the system to allocate the buffer, an IOutOfMemory exception is thrown.



    virtual char * BuffedFile :: buffer ()

    virtual const char * BuffedFile :: buffer () const

    RETURNS :

    The address of the receivers' internal memory buffer as pointer to constant char.

    DESCRIPTION :

    This is the accessor for internal memory area encapsulated by this class (the buffer where the contents of the file are stored). This is the preferred means of gaining access that that buffer.



    virtual const char * BuffedFile :: className () const

    RETURNS :

    A constant pointer to the ASCIIZ string "BuffedFile"

    DESCRIPTION :

    This VIRTUAL constant method always returns the class name of the receiver. This may be used to implement a primitive Run Time Type Identification, (RTTI), or anything else you like. Note that this IS a virtual function, and will early bind in the constructors and destructor. Thus you can also use this method to determine in which constructor level you are, although I don't know why you would want to know that!



    CharArray & BuffedFile :: charArray ()

    const CharArray & BuffedFile :: charArray () const

    RETURNS :

    A reference to the TemplateArray < char > (typedefined as CharArray) encapsulated by the receiver

    DESCRIPTION :

    This is the PROTECTED accessor for the CharArray object this class uses to manage its' internal memory buffer.



    virtual void BuffedFile :: flush ( const char * cszFileName , int nIO_Mode = cnDEF_OUT_MODE )

    ARGUMENTS :

    const char * cszFileName
    The name of the file to which to write the contents of the receivers' internal memory buffer. I.e. the contents of the receivers' buffer will be saved (flushed) to this file name.
    int nIO_Mode
    The set of ios flags to be used in opening the file for writing. This argument defaults to cnDEF_OUT_MODE.

    DESCRIPTION :

    This method writes the contents of the receivers' internal memory buffer to the physical disk file named in the input argument 'cszFileName'.

    EXCEPTIONS :

    If any IO error occurs, an FStreamError exception is thrown.



    size_t BuffedFile :: length () const

    RETURNS :

    The length in bytes of the receivers' internal memory buffer.

    DESCRIPTION :

    This is the accessor for size in bytes of the internal memory area encapsulated by this class.



    virtual char * BuffedFile :: read ( const char * cszFileName , int nIO_Mode = cnDEF_IN_MODE )

    ARGUMENTS :

    const char * cszFileName
    The file name we wish to read into the receivers' internal memory buffer.
    int nIO_Mode
    The set of ios flags to be used in opening the file for reading. This argument defaults to cnDEF_IN_MODE.

    RETURNS :

    The address of the receivers' internal memory buffer as pointer to char.

    DESCRIPTION :

    This method attempts to read the contents of the file named in the input argument 'cszFileName' into the receivers' internal memory buffer. This method will resize the receivers' internal buffer to the length of that file and read the entire contents of that file into the buffer.

    EXCEPTIONS :

    If any IO error occurs, an FStreamError exception is thrown.



    size_t BuffedFile :: setLength ( size_t stBuffLength )

    ARGUMENTS :

    size_t stBuffLength
    The new buffer size that the receiver should allocate.

    RETURNS :

    The new buffer size, i.e. the value of the input argument 'szBuffLength'

    DESCRIPTION :

    This method reallocates the receivers' internal buffer to the size specified in the input argument 'stBuffLength'. This is done via a call to CharArray :: resize ( size_t stBuffLength ).

    EXCEPTIONS :

    If there is not enough memory left on the system to allocate the buffer, an IOutOfMemory exception is thrown



    Class CharArray

  • Description
  • Derivation


  • CharArray Description

    templary.hpp - The class CharArray is an instantiated template class used to represent an array of characters. I.e this class is a synonym for TemplateArray < char >, and is defined in "templary.hpp" as typedef TemplateArray < char > CharArray. Please see the reference for the class TemplateArray < T > for more information.



    CharArray Derivation

                  NamedObject
                        |
      template < class T > class TemplateArray
    



    Class FStreamCheck

  • Description
  • Derivation
  • Constructors
  • Public Methods
  • Protected Methods
  • Nested Data


  • FStreamCheck Description

    fstrmchk.hpp - This class is an fstream descendant. The difference between FStreamCheck and fstream is that FStreamCheck checks for errors after its' IO and throws an FStreamError (a descendant of IAccessError) if any IO errors occur.



    FStreamCheck Derivation

      fstream   NamedObject
          |       |
         FStreamCheck
    



    FStreamCheck Constructors

  • FStreamCheck ()
  • FStreamCheck ( const char * cszName , int nIO_Mode , int nProt = filebuf :: openprot )
  • FStreamCheck ( int nFileDesc )
  • FStreamCheck ( int nFileDesc , char * pcBuffer , int nLength )


  • FStreamCheck Public Methods

  • void checkState ()
  • virtual const char * className () const
  • const char * fileName () const
  • virtual streampos fSize ()
  • void open ( const char * cszFileName , int nIO_Mode = DEF_IO_MODE , int nProt = filebuf :: openprot )
  • istream & read ( char * pcData , int nLength )
  • istream & read ( signed char * pscData , int nLength )
  • istream & read ( unsigned char * pucData , int nLength )
  • virtual streampos seekoff ( streamoff so , ios :: seek_dir sd , int nIOMode =ios :: in | ios :: out )
  • virtual streampos seekpos ( streampos sp , int nIOMode = ios ::in | ios :: out )
  • ostream & write ( const char * pccData , int nLength )
  • ostream & write ( const signed char * pcscData , int nLength )
  • ostream & write ( const unsigned char * pcucData , int nLength )


  • FStreamCheck Protected Methods

  • const char * setFileName ( const char * cszFileName )


  • FStreamCheck :: FStreamCheck ()

    DESCRIPTION :

    This attempts to construct an FStreamCheck object using no arguments and a buffer length of 0.

    EXCEPTIONS :

    If any IO error occurs, an FStreamError exception is thrown.



    FStreamCheck :: FStreamCheck ( const char * cszName , int nIO_Mode , int nProt = filebuf :: openprot )

    ARGUMENTS :

    const char * cszName
    The name of the file to open and associate with the object being constructed.
    int nIO_Mode
    The ios :: flags to use in opening the file, e.g. ios :: in or ios :: ate, etc.
    int nProt
    The filebuf protections flag. This defaults to filebuf :: openprot.

    DESCRIPTION :

    This attempts to construct an FStreamCheck object by opening the named file with the given flags and protection mode.

    EXCEPTIONS :

    If any IO error occurs, an FStreamError exception is thrown.



    FStreamCheck :: FStreamCheck ( int nFileDesc )

    ARGUMENTS :

    int nFileDesc
    The file descriptor of an open file. If this handle is not open, an FStreamError exception will be thrown.

    DESCRIPTION :

    This attempts to construct an FStreamCheck object by associating it with the given file descriptor

    EXCEPTIONS :

    If any IO error occurs, an FStreamError exception is thrown.



    FStreamCheck :: FStreamCheck ( int nFileDesc , char * pcBuffer , int nLength )

    ARGUMENTS :

    int nFileDesc
    The file descriptor of an open file. If this handle is not open, an FStreamError exception will be thrown.
    char * pcBuffer
    A pointer to a buffer area to be used in buffering the file.
    int nLength
    The length of the buffer area to be used in buffering the file.

    DESCRIPTION :

    This version constructs an FStreamCheck object that is attached to the file descriptor nFileDesc. If nFileDesc is not open, an FStreamError will be thrown. This constructor also sets up an associated filebuf object with a stream buffer that has nLength bytes and begins at the position pointed to by pcBuffer. If pcBuffer or nLength is 0, the associated filebuf object is unbuffered.

    EXCEPTIONS :

    If any IO error occurs, an FStreamError exception is thrown.



    void FStreamCheck :: checkState ()

    DESCRIPTION :

    This method checks the state of the receiver via a call to ios :: good (). If the stream is not in a good state an FStreamError is thrown. This is the method used to check the IO operations for this class.

    EXCEPTIONS :

    If the call to ios :: good returns false, an FStreamError exception is thrown.



    virtual const char * FStreamCheck :: className () const

    RETURNS :

    A constant pointer to the ASCIIZ string "FStreamCheck"

    DESCRIPTION :

    This VIRTUAL constant method always returns the class name of the receiver. This may be used to implement a primitive Run Time Type Identification, (RTTI), or anything else you like. Note that this IS a virtual function, and will early bind in the constructors and destructor. Thus you can also use this method to determine in which constructor level you are, although I don't know why you would want to know that!



    virtual const char * FStreamCheck :: fileName () const

    RETURNS :

    This method returns the file name of the file associated with the receiver if the receiver was constructed using a file name argument.

    DESCRIPTION :

    This method returns the file name of the file associated with the receiver if the receiver was constructed using a file name argument.



    virtual streampos FStreamCheck :: fSize ()

    RETURNS :

    The size of the file in bytes.

    DESCRIPTION :

    This method returns the size of the file associated with the receiver in bytes. This may not work properly on a binary file opened in text mode, since the two byte carriage return - line feed sequence is translated into a one byte line feed in text mode.

    EXCEPTIONS :

    If any IO error occurs, an FStreamError exception is thrown.



    void FStreamCheck :: open ( const char * cszName , int nIO_Mode = DEF_IO_MODE , int nProt = filebuf :: openprot )

    ARGUMENTS :

    const char * cszName
    The name of the file to open and associate with the receiver.
    int nIO_Mode
    The ios :: flags to use in opening the file, e.g. ios :: in or ios :: ate, etc.
    int nProt
    The filebuf protections flag. This defaults to filebuf :: openprot.

    DESCRIPTION :

    This method attempts to open the file 'cszFileName' using the specified mode and protection flags. This method operates identically to fstream :: open, but this class will throw an FStreamError exception if there is an IO error.

    EXCEPTIONS :

    If any IO error occurs, an FStreamError exception is thrown.



    istream & FStreamCheck :: read ( char * pcData , int nLength )

    istream & FStreamCheck :: read ( signed char * pscData , int nLength )

    istream & FStreamCheck :: read ( unsigned char * pucData , int nLength )

    ARGUMENTS :

    char * pcData
    A pointer to the buffer area that will receive the data read from the file.
    int nLength
    The number of bytes to read

    RETURNS :

    This method returns a reference to the receiver as an istream.

    DESCRIPTION :

    This method attempts to read 'nLength' bytes from the file associated with the receiver into the buffer 'pcData'. This method operates identically to fstream :: read, but this class will throw an FStreamError if there is an IO error.

    EXCEPTIONS :

    If any IO error occurs, an FStreamError exception is thrown.



    virtual streampos FStreamCheck :: seekoff ( streamoff so , ios :: seek_dir sd , int nIOMode =ios :: in | ios :: out )

    ARGUMENTS :

    streamoff so
    The offset to which to seek
    ios :: seek_dir sd
    The direction in which to seek ( ios :: beg , ios :: curr , ios :: end )
    int nIO_Mode
    The ios :: flags to use for the seek operation

    RETURNS :

    The new file position

    DESCRIPTION :

    This method attempts to seek the receivers' rdbuffer to the position specified by the argument 'streamoff so'. This method operates identically to 'streambuf :: seekoff' but this class will throw an FStreamError exception if there is an IO error.

    EXCEPTIONS :

    If any IO error occurs, an FStreamError exception is thrown.



    virtual streampos FStreamCheck :: seekpos ( streampos sp , int nIOMode = ios ::in | ios :: out )

    ARGUMENTS :

    streampos sp
    The offset to which to seek
    int nIO_Mode
    The ios :: flags to use for the seek operation

    RETURNS :

    The new file position

    DESCRIPTION :

    This method attempts to seek the receivers' rdbuffer to the position specified by the argument 'streampos sp'. This method operates identically to 'streambuf :: seekpos' but this class will throw an FStreamError exception if there is an IO error.

    EXCEPTIONS :

    If any IO error occurs, an FStreamError exception is thrown.



    const char * FStreamCheck :: setFileName ( const char * cszFileName )

    ARGUMENTS :

    const char * cszFileName
    The name of the file associated with the receiver

    RETURNS :

    This method returns new file name as stored by the receiver.

    DESCRIPTION :

    This PROTECTED accessor provides the means of setting the file name associated with the receiver. This method is protected since we do not want to allow the outside world to accidentally mismatch this name and the opened file!



    ostream & FStreamCheck :: write ( char * pcData , int nLength )

    ostream & FStreamCheck :: write ( signed char * pscData , int nLength )

    ostream & FStreamCheck :: write ( unsigned char * pucData , int nLength )

    ARGUMENTS :

    char * pcData
    A pointer to the buffer area that is the source of the data to be written.
    int nLength
    The number of bytes to write

    RETURNS :

    This method returns a reference to the receiver as an ostream.

    DESCRIPTION :

    This method attempts to write 'nLength' bytes from the buffer 'pcscData' to the file associated with the receiver. This method operates identically to fstream :: write, but this class will throw an FStreamError if there is an IO error.

    EXCEPTIONS :

    If any IO error occurs, an FStreamError exception is thrown.



    FStreamCheck Nested Data

  • FStreamCheck :: OpenMode


  • enum FStreamCheck :: OpenMode

    enum OpenMode { DEF_IO_MODE = ios :: in | ios :: out , DEF_RD_MODE = ios :: in | ios :: nocreate }

    DESCRIPTION :

    These enums define some ios flags combinations for opening files.



    Class FStreamError

  • Description
  • Derivation
  • Constructors
  • Public Methods


  • FStreamError Description

    fstrmchk.hpp - This class is a descendant of IAccessError. This Exception Class is used to throw errors related to File IO. It is used extensively by the class FStreamCheck to throw errors related to its' File Operations.



    FStreamError Derivation

       IAccessError   NamedObject
                |       |
              FStreamError
    



    FStreamError Constructors

  • FStreamError (const char * cszErrMsg , long lErrorID)
  • FStreamError ( const FStreamError & rcfstreamerror )


  • FStreamError Public Methods

  • virtual const char * FStreamError :: className () const
  • virtual const char * FStreamError :: name () const


  • FStreamError :: FStreamError ( const char * cszErrorMsg , long lErrorId )

    ARGUMENTS :

    const char * cszErrorMsg
    A pointer to the error message as a constant ASCIIZ string
    long lErrorId
    The numeric error id to be used in constructing the object.

    DESCRIPTION :

    This method constructs an FStreamError object with the given error message and error id.



    FStreamError :: FStreamError ( const FStreamError & rcfstreamerror )

    ARGUMENTS :

    const FStreamError & rcfstreamerror
    A reference to the constant FStreamError object that will be used as the source for this DEEP copy constructor.

    DESCRIPTION :

    This is the copy constructor for an FStreamError. This is the constructor the compiler uses when throwing an FStreamError object.



    virtual const char * FStreamError :: className () const

    RETURNS :

    A constant pointer to the ASCIIZ string "FStreamError"

    DESCRIPTION :

    This VIRTUAL constant method always returns the class name of the receiver. This may be used to implement a primitive Run Time Type Identification, (RTTI), or anything else you like. Note that this IS a virtual function, and will early bind in the constructors and destructor. Thus you can also use this method to determine in which constructor level you are, although I don't know why you would want to know that!



    virtual const char * FStreamError :: name () const

    RETURNS :

    A constant pointer to the ASCIIZ string "FStreamError"

    DESCRIPTION :

    This method overides the IException name method defined by OCL so that it returns our NamedObject :: className method. I.e. this method overloads IException :: name so that it returns a value identical to NamedObject :: className.



    Class NamedObject

  • Description
  • Derivation
  • Constructors
  • Public Methods


  • NamedObject Description

    namedobj.hpp - The class NamedObject is a superclass intended to be used as the parent of all C++ classes in our heirarchy. This class sort of corresponds to the Smalltalk class 'Object'. PERHAPS MOST IMPORTANTLY THIS CLASS DEFINES A DO NOTHING VIRTUAL DESTRUCTOR. THIS ASSURES THAT THE DESTRUCTORS OF ALL DESCENDANT CLASSES WILL BE VIRTUAL AS WELL!



    NamedObject Derivation

       NamedObject
    



    NamedObject Constructors

  • NamedObject ()


  • NamedObject Public Methods

  • virtual const char * className () const
  • virtual size_t nameLength () const
  • int isMyType ( const NamedObject & crnamedobject ) const


  • NamedObject :: NamedObject ()

    DESCRIPTION :

    The only way to construct a NamedObject is using the default constructor. This class contains no data and therefore requires no constructor.



    virtual const char * NamedObject :: className () const

    RETURNS :

    A constant pointer to the ASCIIZ string "NamedObject"

    DESCRIPTION :

    This VIRTUAL constant method always returns the class name of the receiver. This may be used to implement a primitive Run Time Type Identification, (RTTI), or anything else you like. Note that this IS a virtual function, and will early bind in the constructors and destructor. Thus you can also use this method to determine in which constructor level you are, although I don't know why you would want to know that!



    int NamedObject :: isMyType ( const NamedObject & rcnamedobj ) const

    ARGUMENTS :

    const NamedObject & rcnamedobj
    A constant reference to the NamedObject to be tested against the receiver.

    RETURNS :

    TRUE (1) if the receiver and the argument 'rcnamedobj' are of the same type and FALSE (0) otherwise.

    DESCRIPTION :

    This method compares the strings returned by NamedObject :: className () to determine if the receiver and the input argument 'rcnamedobject' are of the same type, and returns TRUE if they are.



    virtual const char * NamedObject :: nameLength () const

    RETURNS :

    This method returns the length of the receivers' class name in bytes.

    DESCRIPTION :

    This method returns the length of the string returned by the receivers 'className ()' method.



    Class OurString

  • Description
  • Derivation
  • Constructors
  • Public Methods
  • Public Operators
  • Utility Operators


  • OurString Description

    ourstrng.hpp - The class OurString is a generic string class is intended to subsitute for the STL or ANSI String classes for compilers that do not support those classes.



    OurString Derivation

                 NamedObject
                      |
      template class TemplateArray < char >
                      |
                  OurString
    



    OurString Constructors

  • OurString ( const char * cszSourceString = 0 )
  • OurString ( size_t stLen , const char * ccaSource = 0 )
  • OurString ( const OurString & rcourstring )


  • OurString Public Methods

  • virtual const char * className () const
  • virtual void clear ()
  • size_t length () const


  • OurString Public Operators

  • OurString & operator = ( const char * cszSource )
  • OurString & operator = ( const OurString & rcourstrg )
  • OurString & operator += ( const char * cszSource )
  • OurString & operator += ( const OurString & rcourstrg )
  • Boolean operator == ( const char * cszSource )
  • Boolean operator == ( const OurString & rcourstrg )
  • Boolean operator != ( const char * cszSource )
  • Boolean operator != ( const OurString & rcourstrg )
  • Boolean operator <= ( const char * cszSource )
  • Boolean operator <= ( const OurString & rcourstrg )
  • Boolean operator >= ( const char * cszSource )
  • Boolean operator >= ( const OurString & rcourstrg )
  • Boolean operator < ( const char * cszSource )
  • Boolean operator < ( const OurString & rcourstrg )
  • Boolean operator > ( const char * cszSource )
  • Boolean operator > ( const OurString & rcourstrg )


  • OurString Utility Operators

  • OurString operator + ( const char * cszSource1 , const OurString & rcourstrg2 )
  • OurString operator + ( const OurString & rcourstrg1 , const char * cszSource2 )
  • OurString operator + ( const OurString & rcourstrg1 , const OurString & rcourstrg2 )


  • OurString :: OurString ( const char * cszSourceString = 0 )

    ARGUMENTS :

    const char * cszSourceString = 0
    A pointer to the constant ASCIIZ string that will be the source for this DEEP copy constructor.

    DESCRIPTION :

    This constructor creates an OurString object that is a DEEP copy of 'cszSource'.

    EXCEPTIONS :

    If the attempt to allocate memory fails, an IOutOfMemory exception will be thrown.



    OurString :: OurString ( size_t stLen , const char * ccaSource = 0 )

    ARGUMENTS :

    size_t stLen
    The number of bytes to allocate and copy.
    const char * ccaSource = 0
    A pointer to the memory buffer that will be the source for this DEEP copy constructor. This buffer need not be NULL terminated. If this buffer points to 0, 'stLen' bytes will be allocated and initialized to 0, but no copying will be done.

    DESCRIPTION :

    This constructor creates an OurString object that is large enough to hold 'stLen' bytes and copys the first 'stLen' bytes from 'ccaSource'.

    EXCEPTIONS :

    If the attempt to allocate memory fails, an IOutOfMemory exception will be thrown.



    OurString :: OurString ( const OurString & rcourstrg )

    ARGUMENTS :

    const OurString & rcourstrg
    A reference to the constant OurString object that will be the source for this DEEP copy constructor.

    DESCRIPTION :

    This constructor creates an OurString object that is a DEEP copy of 'cszSource'.

    EXCEPTIONS :

    If the attempt to allocate memory fails, an IOutOfMemory exception will be thrown.



    virtual const char * OurString :: className () const

    RETURNS :

    A constant pointer to the ASCIIZ string "OurString"

    DESCRIPTION :

    This VIRTUAL constant method always returns the class name of the receiver. This may be used to implement a primitive Run Time Type Identification, (RTTI), or anything else you like. Note that this IS a virtual function, and will early bind in the constructors and destructor. Thus you can also use this method to determine in which constructor level you are, although I don't know why you would want to know that!



    virtual void OurString :: clear ()

    DESCRIPTION :

    This method sets the receivers' ENTIRE memory buffer to 0. NO DESTRUCTORS are called! This method actually just calls void TemplateArray < char > :: clear (). That method is defined as protected in the parent class. This method is defined just to expose it as public in this class, since this it is safe to call void TemplateArray < char > :: clear () when the template is instantiated for char. Please refer to the documentation for void TemplateArray < char > :: clear () for more information.



    size_t OurString :: length () const

    RETURNS :

    This returns the length of the string NOT INCLUDING the NULL terminator.

    DESCRIPTION :

    This constant accessor method returns the length of the string encapsulated by the receiver NOT INCLUDING the NULL terminator. This is the number of elements (bytes) occupied - 1.



    OurString & OurString :: operator = ( const char * cszSource)

    OurString & OurString :: operator = ( const OurString & rcourstrg )

    ARGUMENTS :

    const char * cszSource OR const OurString & rcourstrg
    A constant ASCIIZ string OR a reference to a constant OurString object that will be the source for this DEEP copy initializer.

    RETURNS :

    A reference to the receiver

    DESCRIPTION :

    This initializer initializes an OurString object to be a DEEP copy of the source argument.

    EXCEPTIONS :

    If the attempt to allocate memory fails, an IOutOfMemory exception will be thrown.



    OurString & OurString :: operator += ( const char * cszSource)

    OurString & OurString :: operator += ( const OurString & rcourstrg )

    ARGUMENTS :

    const char * cszSource OR const OurString & rcourstrg
    A constant ASCIIZ string OR a reference to a constant OurString object that will be the source for this concatenation operator.

    RETURNS :

    A reference to the receiver

    DESCRIPTION :

    This operator appends the source string to the receiver.

    EXCEPTIONS :

    If the attempt to allocate memory fails, an IOutOfMemory exception will be thrown.



    OurString & OurString :: operator == ( const char * cszSource)

    OurString & OurString :: operator == ( const OurString & rcourstrg )

    ARGUMENTS :

    const char * cszSource OR const OurString & rcourstrg
    A constant ASCIIZ string OR a reference to a constant OurString object that that we are comparing for equality with the receiver.

    RETURNS :

    This operator returns true if the contents of the receiver and the argument are identical, false otherwise.

    DESCRIPTION :

    This equality operator compares the source argument to the receiver.



    OurString & OurString :: operator != ( const char * cszSource)

    OurString & OurString :: operator != ( const OurString & rcourstrg )

    ARGUMENTS :

    const char * cszSource OR const OurString & rcourstrg
    A constant ASCIIZ string OR a reference to a constant OurString object that that we are comparing for equality with the receiver.

    RETURNS :

    This operator returns true if the contents of the receiver and the argument are not identical, false otherwise.

    DESCRIPTION :

    This inequality operator compares the source argument to the receiver. Note that if both arguments are NULL strings, they are considered identical.



    OurString & OurString :: operator <= ( const char * cszSource)

    OurString & OurString :: operator <= ( const OurString & rcourstrg )

    ARGUMENTS :

    const char * cszSource OR const OurString & rcourstrg
    A constant ASCIIZ string OR a reference to a constant OurString object that that we are comparing for equality with the receiver.

    RETURNS :

    This operator returns true if the contents of the receiver is LESS THAN OR EQUAL TO those of the source argument, false otherwise.

    DESCRIPTION :

    This comparison operator compares the source argument to the receiver using the host machines character sort order. Note that this operator considers a NULL string [(char *) 0] to be the lowest in the sort order on ALL machines.



    OurString & OurString :: operator >= ( const char * cszSource)

    OurString & OurString :: operator >= ( const OurString & rcourstrg )

    ARGUMENTS :

    const char * cszSource OR const OurString & rcourstrg
    A constant ASCIIZ string OR a reference to a constant OurString object that that we are comparing for equality with the receiver.

    RETURNS :

    This operator returns true if the contents of the receiver is GREATER THAN OR EQUAL TO those of the source argument, false otherwise.

    DESCRIPTION :

    This comparison operator compares the source argument to the receiver using the host machines character sort order. Note that this operator considers a NULL string [(char *) 0] to be the lowest in the sort order on ALL machines.



    OurString & OurString :: operator < ( const char * cszSource)

    OurString & OurString :: operator < ( const OurString & rcourstrg )

    ARGUMENTS :

    const char * cszSource OR const OurString & rcourstrg
    A constant ASCIIZ string OR a reference to a constant OurString object that that we are comparing for equality with the receiver.

    RETURNS :

    This operator returns true if the contents of the receiver is LESS THAN that of the source argument, false otherwise.

    DESCRIPTION :

    This comparison operator compares the source argument to the receiver using the host machines character sort order. Note that this operator considers a NULL string [(char *) 0] to be the lowest in the sort order on ALL machines.



    OurString & OurString :: operator > ( const char * cszSource)

    OurString & OurString :: operator > ( const OurString & rcourstrg )

    ARGUMENTS :

    const char * cszSource OR const OurString & rcourstrg
    A constant ASCIIZ string OR a reference to a constant OurString object that that we are comparing for equality with the receiver.

    RETURNS :

    This operator returns true if the contents of the receiver is GREATER THAN that of the source argument, false otherwise.

    DESCRIPTION :

    This comparison operator compares the source argument to the receiver using the host machines character sort order. Note that this operator considers a NULL string [(char *) 0] to be the lowest in the sort order on ALL machines.



    OurString operator + ( const char * cszSource1 , const OurString & rcourstrg2 )

    OurString operator + ( const OurString & rcourstrg1 , const char * cszSource2 )

    OurString operator + ( const OurString & rcourstrg1 , const OurString & rcourstrg2 )

    ARGUMENTS :

    const char * cszSource1 OR const OurString & rcourstrg1
    A constant ASCIIZ string OR a reference to a constant OurString object that will PRIMARY argument for this concatenation operator.
    const char * cszSource2 OR const OurString & rcourstrg2
    A constant ASCIIZ string OR a reference to a constant OurString object that will SECONDARY argument for this concatenation operator.

    RETURNS :

    An OurString object that contains the primary and secondary argument strings concatenated together.

    DESCRIPTION :

    This utility operator creates a new OurString object that contains the primary and secondary argument strings concatenated together. I.e. "Hello " + World" will return "Hello World". Note that this is a UTILITY operator. It is not a STATIC operator. I.e. This operator does not need to be associated with any class.

    EXCEPTIONS :

    If the attempt to allocate memory fails, an IOutOfMemory exception will be thrown.



    Class TemplateArray

  • Description
  • Derivation
  • Constructors
  • Public Methods
  • Public Operators
  • Protected Methods


  • TemplateArray Description

    templary.hpp - The class TemplateArray is a template class used to represent an array. This array will automatically be deleted when it goes out of scope unless it has been told otherwise via a call to " Boolean setDestroy ( Boolean bAutoDestroy = true )".



    TemplateArray Derivation

                  NamedObject
                        |
      template < class T > class TemplateArray
    



    TemplateArray Constructors

  • TemplateArray ( size_t stNumElements = 0 )
  • TemplateArray ( size_t stNumElements , const T * pctSrcArray )
  • TemplateArray ( const TemplateArray < T > & rctemplarray )


  • TemplateArray Public Methods

  • virtual const char * className () const
  • virtual void deleteMem ()
  • T * getBase ()
  • const T * getBase () const
  • void * getMem ()
  • const void * getMem () const
  • size_t numElems () const
  • void init ( size_t stNumELem , const T * pctSrcArray = 0 )
  • void init ( const TemplateArray < T > & rctemplarray )
  • void resize ( size_t stNumElements )
  • size_t size () const


  • TemplateArray Public Operators

  • operator const T * () const
  • operator T * ()
  • const T & operator [] ( size_t stN ) const
  • T & operator [] ( size_t stN )


  • TemplateArray Protected Methods

  • virtual void clear ()
  • T * setBase ( T * ptSrcArray )
  • T setNumElems ( size_t stNumElements )


  • TemplateArray :: TemplateArray ( size_t stNumElements = 0 )

    ARGUMENTS :

    size_t stNumElements = 0
    The number of elements the array should hold.

    DESCRIPTION :

    This constructor creates a TemplateArray < T > object large enough to hold 'stNumElements'.

    EXCEPTIONS :

    If the attempt to allocate memory fails, an IOutOfMemory exception will be thrown.



    TemplateArray :: TemplateArray ( size_t stNumElements , const T * pctSrcArray )

    ARGUMENTS :

    size_t stLen
    The number of bytes to allocate and copy.
    const T * pctSrcArray
    The address of an array of T objects. The first 'stNumElements' from this array will be DEEP copied into the object being constructed.

    DESCRIPTION :

    This constructor creates a TemplateArray < T > object large enough to hold 'stNumElements', of type < T > and copies the first 'stNumElements' into that array. In otherwords this constructor creates an array of 'stNumElements' as a DEEP copy of the argument 'pctSrcArray'.

    EXCEPTIONS :

    If the attempt to allocate memory fails, an IOutOfMemory exception will be thrown.



    TemplateArray :: TemplateArray ( const TemplateArray < T > & rctemplarray )

    ARGUMENTS :

    const TemplateArray < T > & rctemplarray
    A reference to the constant TemplateArray object that will be the source for this DEEP copy constructor.

    DESCRIPTION :

    This constructor creates an TemplateArray object that is a DEEP copy of 'cszSource'.

    EXCEPTIONS :

    If the attempt to allocate memory fails, an IOutOfMemory exception will be thrown.



    TemplateArray :: TemplateArray ( const TemplateArray < T > & rctemplarray )

    ARGUMENTS :

    const TemplateArray < T > & rctemplarray
    A reference to the constant TemplateArray object that will be the source for this DEEP copy constructor.

    DESCRIPTION :

    This constructor creates an TemplateArray object that is a DEEP copy of 'cszSource'.

    EXCEPTIONS :

    If the attempt to allocate memory fails, an IOutOfMemory exception will be thrown.



    virtual const char * TemplateArray :: className () const

    RETURNS :

    A constant pointer to the ASCIIZ string "TemplateArray"

    DESCRIPTION :

    This VIRTUAL constant method always returns the class name of the receiver. This may be used to implement a primitive Run Time Type Identification, (RTTI), or anything else you like. Note that this IS a virtual function, and will early bind in the constructors and destructor. Thus you can also use this method to determine in which constructor level you are, although I don't know why you would want to know that!



    virtual void TemplateArray :: deleteMem ()

    DESCRIPTION :

    This method deletes the receivers' ENTIRE memory array and sets the internal buffer to point to 0, (Preventing a Run Time Error if it is called twice.) Note that the memory is deleted irregardless of the status returned by " Boolean AutoObject :: willDestroy () const". To delete the contents of the receiver conditionally on the return value of that method, call "virtual void AutoObject :: destroy ()".



    virtual T * TemplateArray :: getBase ()

    virtual const T * TemplateArray :: getBase () const

    RETURNS :

    The address of the array encapsulated by the receiver as a pointer to T.

    DESCRIPTION :

    This is the accessor method for the address of the array encapsulated by the receiver.



    virtual void * TemplateArray :: getMem ()

    virtual const T * TemplateArray :: getMem () const

    RETURNS :

    The address of the array encapsulated by the receiver as a pointer to void.

    DESCRIPTION :

    This is the accessor method for the address of the array encapsulated by the receiver as a generic void pointer.



    void TemplateArray :: init ( size_t stNumElements , const T * pctSrcArray )

    ARGUMENTS :

    size_t stNumElements
    The number of Elements to allocate and copy.
    const T * pctSrcArray
    The address of an array of T objects. The first 'stNumElements' from this array will be DEEP copied into the receiver.

    DESCRIPTION :

    This initializer initializes a TemplateArray object large enough to hold 'stNumElements', and copies the first 'stNumElements' into that array. In otherwords this initializer creates an array of 'stNumElements' as a DEEP copy of the argument 'pctSrcArray'.

    EXCEPTIONS :

    If the attempt to allocate memory fails, an IOutOfMemory exception will be thrown.



    void TemplateArray :: init ( const TemplateArray < T > & rctemplarray )

    ARGUMENTS :

    const TemplateArray < T > & rctemplarray
    A reference to a constant TemplateArray object that will be the source for this DEEP copy initializer

    DESCRIPTION :

    This is the const TemplateArray copy initializer. It initializes the receiver to be a DEEP copy of the argument 'rctemplarray'.

    EXCEPTIONS :

    If the attempt to allocate memory fails, an IOutOfMemory exception will be thrown.



    size_t TemplateArray :: numElems() const

    RETURNS :

    This method returns the number of elements that the receiver holds.

    DESCRIPTION :

    This method is the CONSTANT accessor for the number of elements in the array encapsulated by the receiver.



    void TemplateArray :: resize ( size_t stNumElements )

    ARGUMENTS :

    size_t stNumElements
    The number of elements the array should hold.

    DESCRIPTION :

    This method reallocates a TemplateArray object so that it holds 'stNumElements', and copies the first 'stNumElements' into that array. If the original array is smaller than the argument 'stNumElements', then only the smaller number of elements will be copied. Finally the old array is deleted IRREGARDLESS of the status returned by " Boolean AutoObject :: willDestroy () const". Please note that the element type must have an '=' operator defined in order to use this method.

    EXCEPTIONS :

    If the attempt to allocate memory fails, an IOutOfMemory exception will be thrown.

    This method is the CONSTANT accessor for the number of elements in the array encapsulated by the receiver.



    TemplateArray :: operator T * ()

    TemplateArray :: operator const T * () const

    RETURNS :

    This operator returns the address of the array encapsulated by the receiver as a pointer to T.

    DESCRIPTION :

    This operator is the conversion operator for the address of the array encapsulated by the receiver. This operator converts the receiver to a pointer to < T >.



    T & TemplateArray :: operator [] ( size_t stN )

    const T & TemplateArray :: operator [] ( size_t stN ) const

    ARGUMENTS :

    size_t stN
    The index of the element we wish to retrieve.

    RETURNS :

    This operator returns the address of the array encapsulated by the receiver as a pointer to T.

    DESCRIPTION :

    This operator is the accessor operator for a TemplateArray as an indexed array. I.e. if one declares an object as TemplateArray < char > chararray ( 10 ), then charrarray [0] returns the first element in that array.



    virtual void TemplateArray :: clear ()

    DESCRIPTION :

    This PROTECTED method sets the receivers' ENTIRE memory buffer to 0. NO DESTRUCTORS are called. This is a very dangerous method and can really screw things up! This method is really intended to be used when the template is instantiated for a "C" type, (char, int, struct, etc.). Since the destructor is not called for type T, only use this method for types that have no destructor. This method is defined as virtual so that you may override it to do nothing when this template is instantiated for a type that DOES have a destructor defined.



    T * TemplateArray :: setBase ( T * ptSrcArray )

    ARGUMENTS :

    T * ptSrcArray
    The address of an array of T objects. The receivers' internal pointer will be set to this address.

    RETURNS :

    This method returns the value of the argument 'pctSrcArray'.

    DESCRIPTION :

    This PROTECTED accessor initializes a TemplateArray object to point to 'ptSrcArray'. This is a shallow copy, since the receivers' internal pointer is simply set to 'ptSrcArray'. This method should be used with care and is really only intended for use by the constructors or initializers.



    size_t TemplateArray :: setNumElems ( size_t stNumElems )

    ARGUMENTS :

    size_t stNumElems
    The number of Elements that the receiver has allocated

    RETURNS :

    This method returns the value of the argument 'stNumElems'.

    DESCRIPTION :

    This PROTECTED accessor initializes the number of elements returned by the receivers' "size_t TemplateArray :: numElems() const" method. This method should be used with care and is really only intended for use by the constructors or initializers.



    Class TemplatePointer

  • Description
  • Derivation
  • Constructors
  • Public Methods
  • Public Operators


  • TemplatePointer Description

    templptr.hpp - The class TemplatePointer is a template class used to represent a pointer. This pointer will automatically be deleted when it goes out of scope unless it has been told otherwise via a call to " Boolean setDestroy ( Boolean bAutoDestroy = true )".



    TemplatePointer Derivation

                  NamedObject
                        |
     template < class T > class TemplatePointer
    



    TemplatePointer Constructors

  • TemplatePointer ( T * ptInit = 0 )


  • TemplatePointer Public Methods

  • virtual const char * className () const
  • virtual void deleteMem ()
  • T * getPointer ()
  • const T * getPointer () const
  • const T * init ( T * ptInit )


  • TemplatePointer Public Operators

  • operator T * ()
  • operator const T * () const
  • operator T & ()
  • operator const T & () const


  • TemplatePointer :: TemplatePointer ( T * ptInit = 0 )

    ARGUMENTS :

    T * ptInit = 0
    The pointer that the object being constructed will encapsulate

    DESCRIPTION :

    This constructor creates a TemplatePointer < T > object that encapsulates the input argument pointer 'ptInit'. Once this constructor has been called, 'ptInit' will automatically be deleted when the object being constructed goes out of scope.



    virtual const char * TemplatePointer :: className () const

    RETURNS :

    A constant pointer to the ASCIIZ string "TemplatePointer"

    DESCRIPTION :

    This VIRTUAL constant method always returns the class name of the receiver. This may be used to implement a primitive Run Time Type Identification, (RTTI), or anything else you like. Note that this IS a virtual function, and will early bind in the constructors and destructor. Thus you can also use this method to determine in which constructor level you are, although I don't know why you would want to know that!



    virtual void TemplatePointer :: deleteMem ()

    DESCRIPTION :

    This method deletes the receivers' pointer and sets the internal buffer to point to 0, (Preventing a Run Time Error if it is called twice.) Note that the memory is deleted irregardless of the status returned by " Boolean AutoObject :: willDestroy () const". To delete the contents of the receiver conditionally on the return value of that method, call "virtual void AutoObject :: destroy ()".



    virtual T * TemplatePointer :: getPointer ()

    virtual const T * TemplatePointer :: getPointer () const

    RETURNS :

    The pointer encapsulated by the receiver.

    DESCRIPTION :

    This is the accessor method for the pointer encapsulated by the receiver.



    T *TemplatePointer :: init ( T * ptInit = 0 )

    ARGUMENTS :

    T * ptInit = 0
    The pointer that the receiver will encapsulate when this method completes.

    DESCRIPTION :

    This is the mutator that sets the receivers internal pointer. The old pointer is deleted and set to the new address.



    TemplatePointer :: operator T * ()

    TemplatePointer :: operator const T * () const

    RETURNS :

    This operator returns the address encapsulated by the receiver as a pointer to T.

    DESCRIPTION :

    This operator is the conversion operator for the pointer encapsulated by the receiver. This operator converts the receiver to a pointer to < T >.



    TemplatePointer :: operator T & ()

    TemplatePointer :: operator const T & () const

    RETURNS :

    This operator returns a reference to the object encapsulated by the receiver as a reference to T.

    DESCRIPTION :

    This operator is the conversion operator for the pointer encapsulated by the receiver. This operator converts the receiver to a reference to < T >.





    char * makeFullFileName ( char * szFullName , const char * cszPath , const char * cszFileName )

    ARGUMENTS :

    char * szFullName
    The address of the buffer that will contain the assembled file name as an ASCIIZ string.
    const char * cszPath
    The address of the buffer containing the directory information as a CONSTANT ASCIIZ string
    const char * cszFileName
    The address of the buffer containing the file name as a CONSTANT ASCIIZ string

    RETURNS :

    The address of the string argument 'szFullName'. If the argument 'szFullName' is 0, or the argument cszFileName is blank or 0, 0 will be returned.

    DESCRIPTION :

    This function concatenates its' arguments 'cszPath' and 'cszFileName' and copies the result to the address pointed to by the argument 'szFullPath'. If there is no path separator (defined as DIR_SEPARATOR in "ospath.h") either at the end of 'cszPath' OR at the beginning of 'cszFileName' one will be inserted between them during the concatenation.



    const char * replaceExtension ( char * szFilePath , const char * cszNewExt )

    ARGUMENTS :

    char * szFilePath
    The address of the buffer containing the file name as an ASCIIZ string
    const char * cszNewExt
    The address of the buffer containing the new file extension as a CONSTANT ASCIIZ string

    DESCRIPTION :

    The address of the string argument 'szFilePath'. If the argument 'szFilePath' is blank or 0, or the argument 'cszNewExt' is blank or 0, 0 will be returned.

    RETURNS :

    This either appends the argument 'cszNewExt' to the argument 'szFileName' or replaces the file extension on 'szFileName' with 'cszNewExt'. The string 'szFileName' is reverse searched for a '.' character. If none is found, then cszFileName is simply appended to 'szFileName'. If one IS found, it is assumed to be the extension separator and 'cszNewExt' is copied into 'szFileName' at that point. In any case, one and only one '.' character will be placed between 'szFileName' and 'cszNewExtension'. This means that one can supply a string for the argument 'cszNewExt' with OR without a '.' character, and the result will be identical, e.g. any combination of the following

    will still result in the string 'filename.ext'



    unsigned memCount ( const char * pccSrch , char c , size_t stLen )

    ARGUMENTS :

    const char * pccSrch
    The address of the area of memory to search for the number occurences of 'c'.
    int c
    The character for which to search.
    size_t stLen
    The size of the area or string to search. NOTE this is the ACTUAL size starting at 1, not 0! E.g. if this parameter is 2, then first 2 bytes of 'pccSrch' will be checked for equivalency to 'c'.

    RETURNS :

    An unsigned integer that is the number of occurences of 'c' in the first 'stLen' bytes of 'pccSrch'. If c cannot be found, 0 is returned.

    DESCRIPTION :

    This searches an area of memory (pccSrch) for the ALL occurences of the character c. This function returns the number of occurences of 'c' in 'pccSrch'.



    short memIsBlank ( const char * pcTest , size_t stLen )

    ARGUMENTS :

    char * pcTest
    This argument points to the area of memory that we wish to test.
    size_t stLen
    This argument is the length of the area that we wish to test.

    RETURNS :

    TRUE (1) if all of the bytes in the memory area are whitespace, or if the stLen argument is 0. FALSE (0) otherwise.

    DESCRIPTION :

    This function checks an area of memory beginning at 'pcTest' and extending for 'stLen' bytes to see if that area is all white space.

    NOTES :

    If the stLen argument is 0, TRUE is returned.



    const void * memrchr ( const void * pcvSrch , char c , size_t stLen )

    ARGUMENTS :

    void * pcvSrch
    The address of the area of memory to search for the last occurence of 'c'.
    int c
    The character for which to search.
    size_t stLen
    The size of the area or string to search. NOTE this is the ACTUAL size starting at 1, not 0! E.g. if this parameter is 2, pvSrch[1], then pvSrch[0] will be checked for equivalency to 'c'.

    RETURNS :

    A pointer to the LAST occurence of c in pvSrch, if c cannot be found, NULL (0) is returned.

    DESCRIPTION :

    This searches an area of memory (pvSrch) for the LAST occurence of the character c. This function is analogous to memchr in the same manner in which strrchr is analogous to strchr.



    char * strCopyFill ( char * szDest , const char * cszSrc , char c , size_t stLen )

    ARGUMENTS :

    char * szDest
    The address of the DESTINATION memory
    const char * cszSrc
    The address of the CONSTANT SOURCE string
    char c
    The fill (pad) character. If strlen ( 'cszSrce' ) is smaller than 'stLen', the memory up to stLen bytes will be padded with this character
    size_t stLen
    The maximum number of bytes to copy or pad.

    RETURNS :

    'szDest', the address of the DESTINATION memory in all cases.

    DESCRIPTION :

    This function copies the string 'cszSrc' into the location 'szDest', up to a total of 'stLen' bytes, and padding any extra bytes up to 'stLen' bytes, much like the standard C library strncpy. However, this function lets one specify the fill character by the argument 'c'.

    NOTES :

    Unlike strncpy, this function will NOT NULL terminate the destination string, unless the fill character is specified to be '\0'.



    unsigned strCount ( const char * pccSrch , char c )

    ARGUMENTS :

    const char * pccSrch
    The starting address of the constant ASCIIZ string in which to count the number occurences of 'c'.
    int c
    The character for which to search.

    RETURNS :

    An unsigned integer that is the number of occurences of 'c' in 'pccSrch'.

    DESCRIPTION :

    This searches an ASCIIZ string (pccSrch) for the ALL occurences of the character c. This function returns the number of occurences of 'c' in 'pccSrch'.



    short strIsBlank ( const char * cszTest )

    ARGUMENTS :

    const char * cszTest
    The starting address of the constant ASCIIZ string that we wish to test

    RETURNS :

    TRUE (1) if all of the bytes in the string are whitespace.

    FALSE (0) otherwise.

    DESCRIPTION :

    This function checks the constant ASCIIZ string pointed to by 'cszTest' to see if that string is all white space.

    NOTES :

    If the strings' length is 0, TRUE is returned.



    short strIsValid ( const char * cszTest )

    ARGUMENTS :

    const char * cszTest
    The starting address of the constant ASCIIZ string that we wish to test

    RETURNS :

    TRUE (1) if the string doesn't point to NULL and AT LEAST the first character is not '\0'. I.e. the string length is at least 1 FALSE (0) Otherwise

    DESCRIPTION :

    This function checks a constant ASCIIZ string to make sure that it is non-NULL AND that it has a length > 0.



    size_t strLen ( const char * csz )

    ARGUMENTS :

    char * csz
    The starting address of the constant ASCIIZ string whose length we wish to know.

    RETURNS :

    The length of the string 'csz' if this string is not null not NULL and of length > 0, 0 Otherwise

    DESCRIPTION :

    This function returns the length of the ASCIIZ string supplied in the argument 'csz'. The purpose of this function is to return the length of a string portably and robustly handling NULL pointers and const strings. Most compiler implementations of the 'C' library function 'strlen' have problems when they are passed NULL pointer, this method does not!



    char * strLTrim ( char * szLine )

    ARGUMENTS :

    char * szLine
    A pointer to the ASCIIZ string we wish to trim.

    RETURNS :

    The address the argument string IF this string is not NULL and of length > 0, 0 Otherwise

    DESCRIPTION :

    This function finds the first non whitespace character in a string and then copies from that point to the beginning of the string. In other words this function trims all whitespace from the beginning (left side) of a string.



    char * strReset ( char ** ppcDest , const char * cszSrc )

    ARGUMENTS :

    char ** ppcDest
    A pointer to the ADDRESS of the memory area we wish to realloc. This MUST point to a buffer that can be manipulated with 'free'.
    const char * cszSrc The starting address of the constant ASCIIZ string that we wish to copy into 'ppcDest' after the latter has been reallocated.

    RETURNS :

    The NEW address the argument string '* ppcDest' in ALL cases. This may be 0 if 'cszrc' is 0 or if the system cannot allocate enough memory.

    DESCRIPTION :

    This function frees the memory pointed to by 'ppcDest', allocates enough memory to hold a string of length 'cszSrc', sets 'ppcDest' to point to that memory, then strcpys 'szSrc' to 'ppcDest'. I.e. this function operates just like the 'C' library function 'realloc', but additionally does a string copy.

    NOTES :

    This function calls "free ( ppcDest ) ;", It will go totally haywire if 'ppcDest' is not 0 or pointing to a malloced area of memory!



    char * strRTrim ( char * szLine )

    ARGUMENTS :

    char * szLine
    A pointer to the ASCIIZ string we wish to trim.

    RETURNS :

    The address the argument string IF this string is not NULL and of length > 0, 0 Otherwise

    DESCRIPTION :

    This function finds the LAST non whitespace character in a string and then truncates the string at point. In other words this function trims all whitespace from the end (right side) of a string.



    char * strStripNewLine ( char * szLine )

    ARGUMENTS :

    char * szLine
    A pointer to the ASCIIZ string we wish to trim.

    RETURNS :

    A pointer to the input argument 'szLine'.

    DESCRIPTION :

    This function strips any trailing '\n' or '\r' characters from the argument string 'szLine'.



    char * strTermCpy ( char * szDest , const char * cszSrc , size_t stLen )

    ARGUMENTS :

    char * szDest
    The address of the ASCIIZ DESTINATION string
    const char * cszSrc
    The address of the ASCIIZ SOURCE string
    size_t stLen
    The maximum number of bytes to copy or pad.

    RETURNS :

    'szDest', the address of the DESTINATION string in all cases.

    DESCRIPTION :

    This function copies the string 'cszSrc' into the location 'szDest', up to a total of 'stLen' bytes, and padding any extra bytes up to 'stLen' bytes, JUST like the standard C library strncpy. However, this function will ALWAYS NULL terminate 'szDest' IN ALL CASES at either the length of the SOURCE string or at 'stLen', whichever comes first. I.e. this method guarentees that szDest will be a NULL terminated (ASCIIZ) string upon completion, provided 'szDest' is not NULL.



    char * strTermFill ( char * szDest , const char * cszSrc , char , size_t c )

    ARGUMENTS :

    char * szDest
    The address of the ASCIIZ DESTINATION string
    const char * cszSrc
    The address of the ASCIIZ SOURCE string
    char c
    The fill (pad) character. If strlen ( 'cszSrc' ) is smaller than 'stLen', the destination string up to 'stLen' bytes will be padded with the character in this argument.
    size_t stLen
    The maximum number of bytes to copy or pad.

    RETURNS :

    'szDest', the address of the DESTINATION string in all cases.

    DESCRIPTION :

    This function copies the string 'cszSrc' into the location 'szDest', up to a total of 'stLen' bytes, and padding any extra bytes up to 'stLen' bytes, JUST like the standard C library strncpy. However, this function will ALWAYS NULL terminate 'szDest' IN ALL CASES at either the length of the SOURCE string or at 'stLen', whichever comes first. I.e. this method guarentees that szDest will be a NULL terminated (ASCIIZ) string upon completion, provided 'szDest' is not NULL. In addition this function allows you to specify the fill character.



    char * strToLower ( char * sz )

    ARGUMENTS :

    char * sz
    The address of the ASCIIZ string we wish to convert to lowercase.

    RETURNS :

    'sz', the address of the argument string in all cases.

    DESCRIPTION :

    This function converts all of the characters in 'sz' to lowercase, and will not cause an error if 'sz' is NULL.



    char * strToUpper ( char * sz )

    ARGUMENTS :

    char * sz
    The address of the ASCIIZ string we wish to convert to uppercase.

    RETURNS :

    'sz', the address of the argument string in all cases.

    DESCRIPTION :

    This function converts all of the characters in 'sz' to uppercase, and will not cause an error if 'sz' is NULL.