File sblim-cmpi-devel-1.0.4-fix-string.dif of Package sblim-cmpi-devel
--- cmpi/CmpiString.h
+++ cmpi/CmpiString.h 2009/01/14 09:15:43
@@ -70,6 +70,10 @@
/** Constructor - Empty string
*/
CmpiString();
+
+ /** Constructor - from const char*
+ */
+ CmpiString(const char *s);
/** Constructor - Copy constructor
*/
--- CmpiImpl.cpp
+++ CmpiImpl.cpp 2009/01/14 08:59:23
@@ -891,8 +891,8 @@
CmpiData::CmpiData(const CmpiString& d) {
_data.state=CMPI_goodValue;
- _data.value.chars=(char*)d.charPtr();
- _data.type=CMPI_chars;
+ _data.value.string=d.getEnc();
+ _data.type=CMPI_string;
}
CmpiData::CmpiData(const char* d) {
@@ -1566,6 +1566,9 @@
CmpiString::CmpiString() {
enc=NULL;
}
+CmpiString::CmpiString(const char *s) {
+ enc=CMNewString(CmpiProviderBase::getBroker(),s, NULL);
+}
const char* CmpiString::charPtr() const {
if (getEnc())
return (const char*)getEnc()->hdl;