Class: ODPI::Dpi::EncodingInfo

Inherits:
Object
  • Object
show all
Defined in:
ext/odpi_ext/rbdpi-struct.c

Instance Method Summary collapse

Constructor Details

#initializeObject


41
42
43
44
45
# File 'ext/odpi_ext/rbdpi.c', line 41

VALUE rbdpi_initialize_error(VALUE self)
{
    rb_raise(rb_eRuntimeError, "could not initialize by %s::new", rb_obj_classname(self));
    return Qnil;
}

Instance Method Details

#encodingObject


143
144
145
146
147
148
# File 'ext/odpi_ext/rbdpi-struct.c', line 143

static VALUE enc_info_get_encoding(VALUE self)
{
    enc_info_t *ei = TO_ENC_INFO(self);

    return ei->encoding;
}

#initialize_copy(other) ⇒ Object


125
126
127
128
129
# File 'ext/odpi_ext/rbdpi-struct.c', line 125

static VALUE enc_info_initialize_copy(VALUE self, VALUE other)
{
    *TO_ENC_INFO(self) = *TO_ENC_INFO(other);
    return self;
}

#inspectObject


131
132
133
134
135
136
137
138
139
140
141
# File 'ext/odpi_ext/rbdpi-struct.c', line 131

static VALUE enc_info_inspect(VALUE self)
{
    enc_info_t *ei = TO_ENC_INFO(self);

    return rb_sprintf("<%s: enc=%.*s, max_byts_per_char=%d, nenc=%.*s, nmax_byts_per_char=%d>",
                      rb_obj_classname(self),
                      NSTR_LEN_PTR_PAIR(ei->encoding),
                      ei->maxBytesPerCharacter,
                      NSTR_LEN_PTR_PAIR(ei->nencoding),
                      ei->nmaxBytesPerCharacter);
}

#max_bytes_per_charObject


150
151
152
153
154
155
# File 'ext/odpi_ext/rbdpi-struct.c', line 150

static VALUE enc_info_get_max_bytes_per_char(VALUE self)
{
    enc_info_t *ei = TO_ENC_INFO(self);

    return INT2FIX(ei->maxBytesPerCharacter);
}

#nencodingObject


157
158
159
160
161
162
# File 'ext/odpi_ext/rbdpi-struct.c', line 157

static VALUE enc_info_get_nencoding(VALUE self)
{
    enc_info_t *ei = TO_ENC_INFO(self);

    return ei->nencoding;
}

#nmax_bytes_per_charObject


164
165
166
167
168
169
# File 'ext/odpi_ext/rbdpi-struct.c', line 164

static VALUE enc_info_get_nmax_bytes_per_char(VALUE self)
{
    enc_info_t *ei = TO_ENC_INFO(self);

    return INT2FIX(ei->nmaxBytesPerCharacter);
}