This is a C++ library providing support for Luna Datasets framework. It provides function both for dataset file I/O operations and basic array splicing.
- xlnt library (C++/CMake) — needed for .xlsx file format support. NOTE: On MacOS mwu-tow's fork is needed to fix the compilation issue. On other platforms, official library repo can be used.
- have installed
xlnt
library either:- system-wide install (
cmake /PATH/TO/XLNT && make install
) - local install and set
CMAKE_PREFIX_PATH
to the location - separately provide library's include and library directories with
CMAKE_LIBRARY_PATH
- system-wide install (
- clone the repo
cmake repo/DataframeHelper
make
- Binary will be placed in the
repo/native_libs/os/
directory whereos
is eitherwindows
,macos
orlinux
.
Core/
Common
— defines anEXPORT
macroError
— helpers for translating between C++ error reporting (exceptions) and Luna-consumable error messagesMatrix2d
— class that manages a Luna-consumable 2D array with strings
IO/
xlsx
— read/write dataframe from/to files in Microsoft Excel Open XML Format;csv
— read/write dataframe from/to file in CSV format.
MatrixDataPtr
is a an array of string pointers. It represents a two-dimensional array of C-style strings stored in a single row-major linear storage. The storage (both for the array itself and the strings) is managed by the Matrix2d
class.
Pointer of that type is meant for Luna — to allow easy access to array elements.
Luna is not allowed to directly modify neither array elements nor the strings itself, the storage should be treated as read-only.
Deletes a Matrix2d object associated with given matrix data pointer.
Reads file from the given path. File is required to be in CSV format. Upon successfull read a pointer to array with Dataframe contents is returned, and array sizes are written to rows
and cols
arguments. Upon failure, NULL
pointer is returned and error
is set to a non-zero value.
Writes data from given array to CSV file. Result code will be stored under error
pointer: 0 if success, non-zero in case of error.