Function parse_arrays (o2scl_acol)¶
-
std::vector<std::string>
o2scl_acol
::
parse_arrays
(int n_entries, int *sizes, char *str)¶ Construct a string vector from the data in
n_entries
,sizes
, andstr
.This function operates on an integer
n_entries
, an arraysizes
(which has lengthn_entries
) and an array of charactersstr
which has a length equal to the sum of the entries in the arraysizes
. Thesizes
array contains the length of each string, and thestr
array contains the characters in multiple strings, concatenated together to form a single combined string. This function takes the data in these three objects and creates an object of typevector<string>
from it, similar to the way that o2scl_hdf::hdf_file::gets_vec() reads a string array from an HDF5 file.This function is used in o2scl_acol_parse(), o2scl_acol_alias_counts() and o2scl_acol_apply_aliases() .