Class: Sfcc::Cim::String
- Inherits:
-
Object
- Object
- Sfcc::Cim::String
- Defined in:
- ext/sfcc/cim_string.c
Class Method Summary collapse
-
.new(value) ⇒ Object
call-seq new Creates a CIM string from a string value.
Instance Method Summary collapse
-
#to_s ⇒ Object
Generates a well formed string representation of this String.
Class Method Details
.new(value) ⇒ Object
call-seq
new
Creates a CIM string from a string value
30 31 32 33 34 35 36 37 38 |
# File 'ext/sfcc/cim_string.c', line 30
static VALUE new(VALUE klass, VALUE value)
{
CIMCStatus status;
CIMCString *ptr = cimcEnv->ft->newString(cimcEnv, to_charptr(value), &status);
if (!status.rc)
return Sfcc_wrap_cim_string(ptr);
sfcc_rb_raise_if_error(status, "Can't create CIM string");
return Qnil;
}
|
Instance Method Details
#to_s ⇒ Object
Generates a well formed string representation of this String
15 16 17 18 19 20 21 22 |
# File 'ext/sfcc/cim_string.c', line 15
static VALUE to_s(VALUE self)
{
CIMCString *ptr = NULL;
char *str = NULL;
Data_Get_Struct(self, CIMCString, ptr);
str = ptr->ft->getCharPtr(ptr, NULL);
return str ? rb_str_new2(str) : Qnil;
}
|