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

  1. // OCL - OS/2 Class Library
  2. // (c) Cubus 1996
  3. // All Rights Reserved
  4. // OIP.cpp
  5.  
  6. // this is the OIP Version Logo
  7.  
  8. /*
  9.  * Redistribution and use in source and binary forms, with or without
  10.  * modification, are permitted provided that the following conditions
  11.  * are met:
  12.  * 1. Redistributions of source code must retain the above copyright
  13.  *    notice, this list of conditions and the following disclaimer.
  14.  * 2. Neither the name Cubus nor the name Team OCL may be used to
  15.  *    endorse or promote products derived from this software
  16.  *    without specific prior written permission.
  17.  * 3. See OCL.INF for a detailed copyright notice.
  18.  *
  19.  *              THIS SOFTWARE IS PROVIDED ``AS IS'' AND
  20.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  21.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  22.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  23.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  24.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  25.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  26.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  27.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  28.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  29.  * SUCH DAMAGE.
  30.  */
  31.  
  32. // $Header: W:/Projects/OCL/Source/rcs/OIP.cpp 1.50 1996/08/11 23:49:17 B.STEIN Release $
  33.  
  34.  
  35. #define __OCL_SOURCE__
  36.  
  37. #define OINCL_OSTRING
  38. #define OINCL_BASE
  39.  
  40. #include <ocl.hpp>
  41. #include <oip.hpp>
  42. #include <OMessage.hpp>
  43.  
  44.  
  45. OString OIP::transport;
  46. OString OIP::MSGFILE("OIP0001.MSG");
  47.  
  48.  
  49. OString& OIP::Version()
  50. {
  51.  return(OIP::Version(OIP::transport));
  52. }
  53.  
  54.  
  55. OString& OIP::Version(OString& str)
  56. {
  57.  OMessage copyright(OIP_COPYRIGHT, "OIP0001.MSG");
  58.  
  59. #ifdef __BCPLUSPLUS__
  60.    OMessage compiler(OIP_BORLAND, "OIP0001.MSG");
  61. #elif __WATCOM_CPLUSPLUS__
  62.    OMessage compiler(OIP_WATCOM, "OIP0001.MSG");
  63. #elif ((__IBMCPP__) && (__IBMCPP__ == 300))
  64.    OMessage compiler(OIP_VA, "OIP0001.MSG");
  65. #elif __IBMCPP__
  66.    OMessage compiler(OIP_CSET, "OIP0001.MSG");
  67. #elif __HIGHC__
  68.    OMessage compiler(OIP_METAWARE, "OIP0001.MSG");
  69. #elif __EMX__
  70.    OMessage compiler(OIP_EMX, "OIP0001.MSG");
  71. #endif  
  72.  
  73.  str << OMessage(OIP_VER_MSG, "OIP0001.MSG", compiler, copyright).getText();
  74.  return(str);
  75. }
  76.  
  77.  
  78. OString& OIP::error(ULONG x)
  79. {
  80.  return(OIP::transport << OMessage(x, "OIP0001.MSG").getText());
  81. }
  82.  
  83.  
  84. OString& OIP::apierror(ULONG x, APIRET rc)
  85. {
  86.  OString apimessage(OMessage((ULONG)rc).getText());
  87.  
  88.  return(OIP::transport << OMessage(x, "OIP0001.MSG", apimessage.getText()).getText());
  89. }
  90.  
  91.  
  92. // end of source
  93.