The endianness of an OBIDMS is now stored in an informations file that

is read when opening the OBIDMS.
This commit is contained in:
Celine Mercier
2015-11-16 14:37:51 +01:00
parent 6579566c6e
commit e8417b4f6f
5 changed files with 165 additions and 15 deletions

View File

@ -66,12 +66,12 @@ cdef class OBIDMS :
cpdef close(self) :
#TODO close all columns
#TODO close all columns (needs to be discussed)
if (obi_close_dms(self.pointer)) < 0 :
raise Exception("Problem closing an OBIDMS")
cpdef dict list(self):
cpdef dict list(self): # TDODO This is a temporary function that will be rewritten
# Declarations
cdef object p
@ -100,13 +100,12 @@ cdef class OBIDMS :
data_type = bytes2str(name_data_type(header.data_type))
line_count = header.line_count
creation_date = bytes2str(obi_column_format_date(header.creation_date))
obi_unmap_header(header) # TODO check if error? but C will already warn and there's nothing to do
obi_unmap_header(header)
latest_version = obi_column_get_latest_version_from_name(self.pointer, column_name_b)
dms[column_name]['data_type'] = data_type
dms[column_name]['latest_version'] = latest_version
dms[column_name]['line_count'] = line_count
dms[column_name]['creation_date'] = creation_date
# TODO : actually get all the informations in the header
print("{:<30} {:<12} {:<25} {:<30} {:<40}".format(column_name, data_type, latest_version, line_count, creation_date))
return dms

View File

@ -15,7 +15,6 @@ from ..capi.obitypes cimport const_char_p, \
cdef extern from "obidmscolumn.h" nogil:
struct OBIDMS_column_header_t:
bint little_endian
size_t header_size
size_t data_size
index_t line_count