MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ append_record()

bool MayaFlux::IO::DelimitedTextReader::append_record ( Kakshya::CompositeArray &  array,
const std::vector< ParsedField > &  fields 
)
private

Definition at line 493 of file DelimitedTextReader.cpp.

496{
497 const auto& layout_fields = array.layout().fields();
498 if (fields.size() > layout_fields.size()) {
499 m_last_error = "Record has more fields than the CompositeLayout";
500 return false;
501 }
502
503 Kakshya::CompositeInsertion insertion(array);
504 const auto row = insertion.append();
505
506 for (size_t i = 0; i < fields.size(); ++i) {
507 if (!set_field(insertion, row, layout_fields[i],
508 fields[i].value, fields[i].quoted)) {
509 m_last_error = "Invalid value in field '" + layout_fields[i].name
510 + "' at record " + std::to_string(m_row_position);
511 return false;
512 }
513 }
514
515 return true;
516}
glm::vec3 value

References MayaFlux::Kakshya::CompositeInsertion::append(), MayaFlux::Kakshya::CompositeLayout::fields(), MayaFlux::Kakshya::CompositeArray::layout(), MayaFlux::IO::CompositeReader::m_last_error, m_row_position, and value.

Referenced by read_next().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: