home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / oclsrc15.zip / OCL / Include / OSysLevel.hpp < prev    next >
C/C++ Source or Header  |  1996-08-12  |  4KB  |  154 lines

  1. // OCL - OS/2 Class Library
  2. // (c) Cubus 1995
  3. // All Rights Reserved
  4. // OSysLevel.hpp
  5.  
  6. /*
  7.  * Redistribution and use in source and binary forms, with or without
  8.  * modification, are permitted provided that the following conditions
  9.  * are met:
  10.  * 1. Redistributions of source code must retain the above copyright
  11.  *    notice, this list of conditions and the following disclaimer.
  12.  * 2. Neither the name Cubus nor the name Team OCL may be used to
  13.  *    endorse or promote products derived from this software
  14.  *    without specific prior written permission.
  15.  * 3. See OCL.INF for a detailed copyright notice.
  16.  *
  17.  *              THIS SOFTWARE IS PROVIDED ``AS IS'' AND
  18.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  20.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  21.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  23.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  24.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  25.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  26.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  27.  * SUCH DAMAGE.
  28.  */
  29.  
  30.  
  31. // $Header: W:/Projects/OCL/Include/rcs/OSysLevel.hpp 1.50 1996/08/11 23:47:32 B.STEIN Release $
  32.  
  33.  
  34. #ifndef OSYSLEVEL_HPP_INCLUDED
  35.   #define OSYSLEVEL_HPP_INCLUDED
  36.  
  37.  
  38. #ifndef OCLOBJECT_INCLUDED
  39.   #include <OCLObject.hpp>
  40. #endif
  41.  
  42.  
  43. #ifndef OVIOEXCEPTION_INCLUDED
  44.   #include <OVioException.hpp>
  45. #endif
  46.  
  47.  
  48. #ifndef OSYSLEVEL_H_INCLUDED
  49.   #include <OSysLevel.h>
  50. #endif
  51.  
  52.  
  53. typedef class OSysLevel *pOSysLevel;
  54.  
  55.  
  56.  
  57. class __CPP_EXPORT__ OSysLevel
  58.   : public OCLObject
  59. {
  60.  private:
  61.     void
  62.       JulianToDT      (LONG, DATETIME&) const;
  63.  
  64.     LONG
  65.       DTToJulian      (DATETIME&) const;
  66.  
  67.  protected:
  68.    OString             slfile;
  69.    SLFHEADER           slfheader;
  70.    SYSTABLE            systable;
  71.  
  72.    OSysLevel
  73.       &readFromFile    (PCSZ fileName),
  74.       &writeToFile     (PCSZ fileName);
  75.  
  76.  public:
  77.  
  78.    OSysLevel           ();
  79.  
  80.    OSysLevel           (const OSysLevel& sl);
  81.  
  82.    OSysLevel           (SLFHEADER& header, SYSTABLE&  table);  
  83.  
  84.    OSysLevel           (PCSZ fileName);
  85.  
  86.    virtual
  87.      ~OSysLevel        ();
  88.  
  89.    virtual
  90.       PSZ isOfType     () const; 
  91.  
  92.    OSysLevel
  93.       &read            (),
  94.       &write           (),
  95.       &setSysTable     (const SYSTABLE&), 
  96.       &setHeader       (const SLFHEADER&),
  97.       &setFileName     (PCSZ fileName),
  98.       &setDate         (),          // uses current DATETIME
  99.       &setDate         (DATETIME&),
  100.       &setDate         (PSZ),
  101.       &setTableOffset  (ULONG), 
  102.       &setSysId        (USHORT),    // identifies system/subsytem
  103.       &setSysEdition   (BYTE),      // edition of system, eg SE=00, EE=01
  104.       &setSysVersion   (BYTE),      // version, eg 1.00=10, 1.10=11
  105.       &setSysModify    (BYTE),      // modify, eg 1.00=00, 1.01=01
  106.       &setSysDate      (USHORT),    // date of system
  107.       &setCsdLevel     (PSZ),       // subsytem CSD level, eg, XR?0000_
  108.       &setCsdPrev      (PSZ),       // as above, except for prev system
  109.       &setSysName      (PSZ),       // Title of system / subsytem (ASCIIZ)
  110.       &setCompId       (PSZ),       // component ID of subsytem
  111.       &setRefreshLevel (BYTE),      // eg, for version 1.30.1, use 1
  112.       &setType         (PSZ);       // Null terminated type (8 chars +'\0')
  113.  
  114.    const OSysLevel
  115.       &getDate         (DATETIME&) const;
  116.  
  117.    ULONG
  118.       getTableOffset   () const; 
  119.  
  120.    USHORT
  121.       getSysId         () const,
  122.       getSysDate       () const;
  123.  
  124.    PCSZ
  125.       getFileName      () const,
  126.       getDateAsStr     (OString&) const,
  127.       getCsdLevel      () const,
  128.       getCsdPrev       () const,
  129.       getSysName       () const,
  130.       getCompId        () const,
  131.       getType          () const;
  132.  
  133.    BYTE
  134.       getSysEdition    () const,
  135.       getSysVersion    () const,
  136.       getSysModify     () const,
  137.       getRefreshLevel  () const;
  138.  
  139.    const SLFHEADER&
  140.       getHeader        () const;
  141.  
  142.    const SYSTABLE&
  143.       getSysTable      () const;
  144.  
  145. };
  146.  
  147.  
  148.  
  149.  
  150. #endif // OSYSLEVEL_HPP_INCLUDED
  151.  
  152.  
  153. // end of source
  154.