You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Set the CPL field to the characters accumulated in the CPL's buffer. This is only used for field converters that need a char* as an input argument. This has to be dynamically allocated and cleaned up appropriately.
1473
-
// static inline char*
1474
-
// AK_CPL_current_to_field(AK_CodePointLine* cpl)
1475
-
// {
1476
-
// // NOTE: we assume this is only called after offset_max is complete, and that this is only called once per CPL; we set it to the maximum size on first usage and then overwrite context on each subsequent usage.
1477
-
// if (cpl->field == NULL) {
1478
-
// // create a NULL-terminated string; need one more for string terminator
// if (cpl->field == NULL) return (char*)PyErr_NoMemory();
1481
-
// }
1482
-
// Py_UCS4 *p = cpl->buffer_current_ptr;
1483
-
// Py_UCS4 *end = p + cpl->offsets[cpl->offsets_current_index];
1484
-
1485
-
// // get pointer to field buffer to write to
1486
-
// char *t = cpl->field;
1487
-
// while (p < end) {
1488
-
// if (AK_is_space(*p)) {
1489
-
// ++p;
1490
-
// continue;
1491
-
// }
1492
-
// *t++ = (char)*p++;
1493
-
// }
1494
-
// *t = '\0'; // must be NULL-terminated string
1495
-
// return cpl->field;
1496
-
// }
1497
-
1498
1471
// This will take any case of "TRUE" as True, while marking everything else as False; this is the same approach taken with genfromtxt when the dtype is given as bool. This will not fail for invalid true or false strings.
// NOTE: record_number should reflect the processed line count, and exlude any skipped lines. The value is initialized to -1 such the first line is number 0
0 commit comments