|
Blender V5.0
|
Functions | |
| int64_t | find_end_of_simple_field (Span< char > buffer, int64_t start, char delimiter) |
| std::optional< int64_t > | find_end_of_quoted_field (Span< char > buffer, int64_t start, char quote, Span< char > escape_chars) |
| std::optional< int64_t > | parse_record_fields (const Span< char > buffer, const int64_t start, const char delimiter, const char quote, const Span< char > quote_escape_chars, Vector< Span< char > > &r_fields) |
| std::optional< int64_t > blender::csv_parse::detail::find_end_of_quoted_field | ( | Span< char > | buffer, |
| int64_t | start, | ||
| char | quote, | ||
| Span< char > | escape_chars ) |
Find the index of the quote that ends the current field.
| start | The index after the opening quote. |
| quote | The quote character that ends the field. |
| escape_chars | The characters that may be used to escape the quote character. |
Definition at line 299 of file csv_parse.cc.
References blender::Span< T >::contains(), find_end_of_quoted_field(), i, and blender::Span< T >::size().
Referenced by find_end_of_quoted_field(), blender::csv_parse::tests::find_end_of_quoted_field(), and parse_record_fields().
| int64_t blender::csv_parse::detail::find_end_of_simple_field | ( | Span< char > | buffer, |
| int64_t | start, | ||
| char | delimiter ) |
Find the index that ends the current field, i.e. the index of the next delimiter of newline. The start index has to be the index of the first character in the field. It may also be the end of the field already if it is empty.
| start | The index of the first character in the field. This may also be the end of the field already if it is empty. |
| delimiter | The character that ends the field. |
Definition at line 284 of file csv_parse.cc.
References ELEM, find_end_of_simple_field(), i, and blender::Span< T >::size().
Referenced by find_end_of_simple_field(), blender::csv_parse::tests::find_end_of_simple_field(), and parse_record_fields().
| std::optional< int64_t > blender::csv_parse::detail::parse_record_fields | ( | const Span< char > | buffer, |
| const int64_t | start, | ||
| const char | delimiter, | ||
| const char | quote, | ||
| const Span< char > | quote_escape_chars, | ||
| Vector< Span< char > > & | r_fields ) |
Finds all fields for the record starting at the given index. Typically, the record ends with a newline, but quoted multi-line records are supported as well.
Definition at line 199 of file csv_parse.cc.
References BLI_assert_unreachable, ELEM, find_end_of_quoted_field(), find_end_of_simple_field(), blender::IndexRange::from_begin_end(), i, parse_record_fields(), blender::Span< T >::size(), and blender::Span< T >::slice().
Referenced by parse_record_fields().