2 * \brief Some custom string conversions.
9 /** Parse a given number of doubles from a string.
11 * The doubles can be separated by whitespaces, comma or semicolon.
13 * \return If the string included up to n doubles, number of parsed doubles.
16 size_t qpms_parse_ndoubles(
22 /** Parse doubles from a string.
24 * The doubles can be separated by whitespaces, comma or semicolon.
25 * The parsed numbers are saved into an array specified by *target
26 * that has been preallocated with malloc() to contain at least start_index
27 * members. If start_index is nonzero, the newly parsed numbers are
28 * saved to the positions starting from start_index.
30 * If *target is NULL, the function allocates the necessary space.
32 * \return Number of newly parsed doubles + start_index.
34 size_t qpms_parse_doubles(
40 /** Parse doubles from a file.
42 * The doubles can be separated by whitespaces, comma or semicolon.
43 * The parsed numbers are saved into an array specified by *target
44 * that has been preallocated with malloc() to contain at least start_index
45 * members. If start_index is nonzero, the newly parsed numbers are
46 * saved to the positions starting from start_index.
48 * If *target is NULL, the function allocates the necessary space.
50 * If filepath is NULL, "" or "-", read from stdin.
52 * \return Number of newly parsed doubles + start_index.
54 size_t qpms_parse_doubles_fromfile(
56 size_t start_index
, //< Starting index for writing the parsed values.
57 const char *filepath
//< File to read from, or NULL, "", "-" to read from stdin.
60 #endif // QPMS_PARSING_H