home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ocl150a.zip / OCL / Source / OAppBase.cpp < prev    next >
C/C++ Source or Header  |  1996-08-12  |  3KB  |  96 lines

  1. // OCL - OS/2 Class Library
  2. // (c) Cubus 1995
  3. // All Rights Reserved
  4. // OAppBase.cpp
  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. // $Header: W:/Projects/OCL/Source/rcs/OAppBase.cpp 1.50 1996/08/11 23:49:06 B.STEIN Release $
  31.  
  32.  
  33. #define __OCL_SOURCE__
  34.  
  35. #define OINCL_OSTRING
  36. #define OINCL_BASE
  37.  
  38. #include <ocl.hpp>
  39. #include <OAppBase.hpp>
  40.  
  41.  
  42. OAppBase::OAppBase() {}
  43.  
  44. OAppBase::OAppBase(const ULONG num, CHAR *Parms[])
  45. {
  46.  saveArgs(num, Parms);
  47. }
  48.  
  49. OAppBase::~OAppBase() {}
  50.  
  51. PSZ OAppBase::isOfType() const
  52.  return("OAppBase"); 
  53. }
  54.  
  55. void OAppBase::saveArgs(const ULONG num, CHAR *Parms[])
  56. {
  57.  OString   moduleName(CCHMAXPATH);
  58.  pOString  tmp;
  59.  ULONG     i;
  60.  PTIB      pTib = NULL;
  61.  PPIB      pPib = NULL;
  62.  
  63.  DosGetInfoBlocks(&pTib, &pPib);
  64.  DosQueryModuleName(pPib->pib_hmte, CCHMAXPATH, moduleName);
  65.  
  66.  callName << moduleName;
  67.  
  68.  for (i = 1; i < num; i++)
  69.    args << (PSZ) Parms[i];
  70.  tmp = args.getFirst();
  71.  while(tmp) {
  72.     initArgs(tmp->getText());
  73.     tmp = args.getNext(); }
  74. }
  75.  
  76.  
  77. void OAppBase::initArgs(PCSZ argStr)
  78. {
  79. #ifdef __BCPLUSPLUS__
  80.   #pragma warn -par
  81. #endif
  82. }
  83. #ifdef __BCPLUSPLUS__
  84.   #pragma warn .par
  85. #endif
  86.  
  87.  
  88. void OAppBase::SyncDisks()
  89. {
  90.  DosShutdown(1L);
  91. }
  92.  
  93.  
  94. // end of source
  95.