Columns are now enlarged if needed when setting a value
This commit is contained in:
@ -3,5 +3,5 @@ from obitools3.obidms.obidmscolumn.capidmscolumn cimport *
|
||||
|
||||
cdef extern from "obidmscolumn_bool.h" nogil:
|
||||
|
||||
int obi_column_set_bool_with_elt_name(OBIDMS_column_p column, size_t line_nb, char* element_name, obibool_t value);
|
||||
obibool_t obi_column_get_bool_with_elt_name(OBIDMS_column_p column, size_t line_nb, char* element_name);
|
||||
int obi_column_set_obibool_with_elt_name(OBIDMS_column_p column, size_t line_nb, char* element_name, obibool_t value);
|
||||
obibool_t obi_column_get_obibool_with_elt_name(OBIDMS_column_p column, size_t line_nb, char* element_name);
|
||||
|
@ -6,7 +6,7 @@ from .capidmscolumn_bool cimport *
|
||||
cdef class OBIDMS_column_bool(OBIDMS_column) :
|
||||
|
||||
def get_item(self, line_nb, element_name):
|
||||
return obi_column_get_bool_with_elt_name(self.pointer, line_nb, element_name.encode('utf-8'))
|
||||
return obi_column_get_obibool_with_elt_name(self.pointer, line_nb, element_name.encode('utf-8'))
|
||||
|
||||
|
||||
cdef class OBIDMS_column_bool_read(OBIDMS_column_bool) :
|
||||
@ -22,7 +22,7 @@ cdef class OBIDMS_column_bool_read(OBIDMS_column_bool) :
|
||||
cdef class OBIDMS_column_bool_writable(OBIDMS_column_bool) :
|
||||
|
||||
def set_item(self, line_nb, element_name, value):
|
||||
return obi_column_set_bool_with_elt_name(self.pointer, line_nb, element_name.encode('utf-8'), value)
|
||||
return obi_column_set_obibool_with_elt_name(self.pointer, line_nb, element_name.encode('utf-8'), value)
|
||||
|
||||
def close(self):
|
||||
if obi_truncate_and_close_column(self.pointer) < 0 :
|
||||
|
@ -3,5 +3,5 @@ from obitools3.obidms.obidmscolumn.capidmscolumn cimport *
|
||||
|
||||
cdef extern from "obidmscolumn_char.h" nogil:
|
||||
|
||||
int obi_column_set_char_with_elt_name(OBIDMS_column_p column, size_t line_nb, char* element_name, obichar_t* value)
|
||||
obichar_t* obi_column_get_char_with_elt_name(OBIDMS_column_p column, size_t line_nb, char* element_name)
|
||||
int obi_column_set_obichar_with_elt_name(OBIDMS_column_p column, size_t line_nb, char* element_name, obichar_t* value)
|
||||
obichar_t* obi_column_get_obichar_with_elt_name(OBIDMS_column_p column, size_t line_nb, char* element_name)
|
||||
|
@ -6,7 +6,7 @@ from .capidmscolumn_char cimport *
|
||||
cdef class OBIDMS_column_char(OBIDMS_column) :
|
||||
|
||||
def get_item(self, line_nb, element_name):
|
||||
return (obi_column_get_char_with_elt_name(self.pointer, line_nb, element_name.encode('utf-8'))).decode(encoding='utf-8')[:1]
|
||||
return (obi_column_get_obichar_with_elt_name(self.pointer, line_nb, element_name.encode('utf-8'))).decode(encoding='utf-8')[:1]
|
||||
|
||||
|
||||
cdef class OBIDMS_column_char_read(OBIDMS_column_char) :
|
||||
@ -22,7 +22,7 @@ cdef class OBIDMS_column_char_read(OBIDMS_column_char) :
|
||||
cdef class OBIDMS_column_char_writable(OBIDMS_column_char) :
|
||||
|
||||
def set_item(self, line_nb, element_name, value):
|
||||
return obi_column_set_char_with_elt_name(self.pointer, line_nb, element_name.encode('utf-8'), value.encode('utf-8'))
|
||||
return obi_column_set_obichar_with_elt_name(self.pointer, line_nb, element_name.encode('utf-8'), value.encode('utf-8'))
|
||||
|
||||
def close(self):
|
||||
if obi_truncate_and_close_column(self.pointer) < 0 :
|
||||
|
@ -3,5 +3,5 @@ from obitools3.obidms.obidmscolumn.capidmscolumn cimport *
|
||||
|
||||
cdef extern from "obidmscolumn_float.h" nogil:
|
||||
|
||||
int obi_column_set_float_with_elt_name(OBIDMS_column_p column, size_t line_nb, char* element_name, obifloat_t value);
|
||||
obifloat_t obi_column_get_float_with_elt_name(OBIDMS_column_p column, size_t line_nb, char* element_name);
|
||||
int obi_column_set_obifloat_with_elt_name(OBIDMS_column_p column, size_t line_nb, char* element_name, obifloat_t value);
|
||||
obifloat_t obi_column_get_obifloat_with_elt_name(OBIDMS_column_p column, size_t line_nb, char* element_name);
|
||||
|
@ -6,7 +6,7 @@ from .capidmscolumn_float cimport *
|
||||
cdef class OBIDMS_column_float(OBIDMS_column) :
|
||||
|
||||
def get_item(self, line_nb, element_name):
|
||||
return obi_column_get_float_with_elt_name(self.pointer, line_nb, element_name.encode('utf-8'))
|
||||
return obi_column_get_obifloat_with_elt_name(self.pointer, line_nb, element_name.encode('utf-8'))
|
||||
|
||||
|
||||
cdef class OBIDMS_column_float_read(OBIDMS_column_float) :
|
||||
@ -22,7 +22,7 @@ cdef class OBIDMS_column_float_read(OBIDMS_column_float) :
|
||||
cdef class OBIDMS_column_float_writable(OBIDMS_column_float) :
|
||||
|
||||
def set_item(self, line_nb, element_name, value):
|
||||
return obi_column_set_float_with_elt_name(self.pointer, line_nb, element_name.encode('utf-8'), value)
|
||||
return obi_column_set_obifloat_with_elt_name(self.pointer, line_nb, element_name.encode('utf-8'), value)
|
||||
|
||||
def close(self):
|
||||
if obi_truncate_and_close_column(self.pointer) < 0 :
|
||||
|
@ -3,5 +3,5 @@ from obitools3.obidms.obidmscolumn.capidmscolumn cimport *
|
||||
|
||||
cdef extern from "obidmscolumn_idx.h" nogil:
|
||||
|
||||
int obi_column_set_idx_with_elt_name(OBIDMS_column_p column, size_t line_nb, char* element_name, obiidx_t value);
|
||||
obiidx_t obi_column_get_idx_with_elt_name(OBIDMS_column_p column, size_t line_nb, char* element_name);
|
||||
int obi_column_set_obiidx_with_elt_name(OBIDMS_column_p column, size_t line_nb, char* element_name, obiidx_t value);
|
||||
obiidx_t obi_column_get_obiidx_with_elt_name(OBIDMS_column_p column, size_t line_nb, char* element_name);
|
||||
|
@ -6,7 +6,7 @@ from .capidmscolumn_idx cimport *
|
||||
cdef class OBIDMS_column_idx(OBIDMS_column) :
|
||||
|
||||
def get_item(self, line_nb, element_name):
|
||||
return obi_column_get_idx_with_elt_name(self.pointer, line_nb, element_name.encode('utf-8'))
|
||||
return obi_column_get_obiidx_with_elt_name(self.pointer, line_nb, element_name.encode('utf-8'))
|
||||
|
||||
|
||||
cdef class OBIDMS_column_idx_read(OBIDMS_column_idx) :
|
||||
@ -22,7 +22,7 @@ cdef class OBIDMS_column_idx_read(OBIDMS_column_idx) :
|
||||
cdef class OBIDMS_column_idx_writable(OBIDMS_column_idx) :
|
||||
|
||||
def set_item(self, line_nb, element_name, value):
|
||||
return obi_column_set_idx_with_elt_name(self.pointer, line_nb, element_name.encode('utf-8'), value)
|
||||
return obi_column_set_obiidx_with_elt_name(self.pointer, line_nb, element_name.encode('utf-8'), value)
|
||||
|
||||
def close(self):
|
||||
if obi_truncate_and_close_column(self.pointer) < 0 :
|
||||
|
@ -3,5 +3,5 @@ from obitools3.obidms.obidmscolumn.capidmscolumn cimport *
|
||||
|
||||
cdef extern from "obidmscolumn_int.h" nogil:
|
||||
|
||||
int obi_column_set_int_with_elt_name(OBIDMS_column_p column, size_t line_nb, char* element_name, obiint_t value);
|
||||
obiint_t obi_column_get_int_with_elt_name(OBIDMS_column_p column, size_t line_nb, char* element_name);
|
||||
int obi_column_set_obiint_with_elt_name(OBIDMS_column_p column, size_t line_nb, char* element_name, obiint_t value);
|
||||
obiint_t obi_column_get_obiint_with_elt_name(OBIDMS_column_p column, size_t line_nb, char* element_name);
|
||||
|
@ -6,7 +6,7 @@ from .capidmscolumn_int cimport *
|
||||
cdef class OBIDMS_column_int(OBIDMS_column) :
|
||||
|
||||
def get_item(self, line_nb, element_name):
|
||||
return obi_column_get_int_with_elt_name(self.pointer, line_nb, element_name.encode('utf-8'))
|
||||
return obi_column_get_obiint_with_elt_name(self.pointer, line_nb, element_name.encode('utf-8'))
|
||||
|
||||
|
||||
cdef class OBIDMS_column_int_read(OBIDMS_column_int) :
|
||||
@ -22,7 +22,7 @@ cdef class OBIDMS_column_int_read(OBIDMS_column_int) :
|
||||
cdef class OBIDMS_column_int_writable(OBIDMS_column_int) :
|
||||
|
||||
def set_item(self, line_nb, element_name, value):
|
||||
return obi_column_set_int_with_elt_name(self.pointer, line_nb, element_name.encode('utf-8'), value)
|
||||
return obi_column_set_obiint_with_elt_name(self.pointer, line_nb, element_name.encode('utf-8'), value)
|
||||
|
||||
def close(self):
|
||||
if obi_truncate_and_close_column(self.pointer) < 0 :
|
||||
|
Reference in New Issue
Block a user