cmpiString.cpp

Go to the documentation of this file.
00001 
00002 /*
00003  *
00004  * cmpiString.cpp
00005  *
00006  * Copyright (c) 2002, International Business Machines
00007  * 
00008  * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE
00009  * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
00010  * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
00011  *
00012  * You can obtain a current copy of the Common Public License from
00013  * http://oss.software.ibm.com/developerworks/opensource/license-cpl.html
00014  *
00015  * Author:        Adrian Schuur <schuur@de.ibm.com>
00016  *
00017  * Contributor:   Markus Mueller <sedgewick_de@yahoo.de>
00018  *
00019  * Description: CMPIString function support
00020  *
00021  */
00022 
00023 
00024 #include "cmpisrv.h"
00025 #include "OW_String.hpp"
00026 
00027 CMPIString* string2CMPIString(const OpenWBEM::String &s)
00028 {
00029    return (CMPIString*) new CMPI_Object(s);
00030 }
00031 
00032 static CMPIStatus stringRelease(CMPIString *eStr)
00033 {
00034    //std::cout << "****** stringRelease()" << std::endl;
00035 
00036    if (eStr->hdl)
00037    {
00038       ::free(eStr->hdl);
00039       ((CMPI_Object*)eStr)->unlinkAndDelete();
00040    }
00041 
00042    CMReturn(CMPI_RC_OK);
00043 }
00044 
00045 static CMPIString* stringClone(const CMPIString *eStr, CMPIStatus* rc)
00046 {
00047    CMSetStatus(rc,CMPI_RC_OK);
00048    return (CMPIString*) new CMPI_Object((char*) eStr->hdl);
00049 }
00050 
00051 static char* stringGetCharPtr(const CMPIString *eStr, CMPIStatus* rc)
00052 {
00053    char* ptr = (char*) eStr->hdl;
00054    CMSetStatus(rc,CMPI_RC_OK);
00055    return ptr;
00056 }
00057 
00058 static CMPIStringFT string_FT =
00059 {
00060    CMPICurrentVersion,
00061    stringRelease,
00062    stringClone,
00063    stringGetCharPtr,
00064 };
00065 
00066 CMPIStringFT *CMPI_String_Ftab=&string_FT;

Generated on Thu Feb 9 08:47:49 2006 for openwbem by  doxygen 1.4.6