|
Vince's CSV Parser
|
Proxy class that wraps a CSVRow and intercepts field access to check for edits. More...
#include <data_frame.hpp>
Public Member Functions | |
| DataFrameRow () | |
| Default constructor (creates an unbound proxy). | |
| DataFrameRow (const CSVRow *_row, const std::unordered_map< std::string, std::string > *_edits, const KeyType *_key) | |
| Construct a DataFrameRow wrapper. | |
| CSVField | operator[] (const std::string &col) const |
| Access a field by column name, checking edits first. | |
| CSVField | operator[] (size_t n) const |
| Access a field by position (positional access never checks edits). | |
| size_t | size () const |
| Get the number of fields in the row. | |
| bool | empty () const |
| Check if the row is empty. | |
| std::vector< std::string > | get_col_names () const |
| Get column names. | |
| const CSVRow & | get_underlying_row () const |
| Get the underlying CSVRow for compatibility. | |
| const KeyType & | get_key () const |
| Get the key for this row (only valid for keyed DataFrames). | |
| operator std::vector< std::string > () const | |
| Convert to vector of strings for CSVWriter compatibility. | |
| std::string | to_json (const std::vector< std::string > &subset={}) const |
| Convert to JSON. | |
| std::string | to_json_array (const std::vector< std::string > &subset={}) const |
| Convert to JSON array. | |
Proxy class that wraps a CSVRow and intercepts field access to check for edits.
Provides transparent access to both original and edited cell values.
Definition at line 104 of file data_frame.hpp.
|
inline |
Default constructor (creates an unbound proxy).
Definition at line 107 of file data_frame.hpp.
|
inline |
Construct a DataFrameRow wrapper.
Definition at line 110 of file data_frame.hpp.
|
inline |
Check if the row is empty.
Definition at line 141 of file data_frame.hpp.
|
inline |
Get column names.
Definition at line 144 of file data_frame.hpp.
|
inline |
Get the key for this row (only valid for keyed DataFrames).
Definition at line 150 of file data_frame.hpp.
|
inline |
Get the underlying CSVRow for compatibility.
Definition at line 147 of file data_frame.hpp.
|
inline |
Convert to vector of strings for CSVWriter compatibility.
Definition at line 153 of file data_frame.hpp.
|
inline |
Access a field by column name, checking edits first.
| col | Column name |
Definition at line 122 of file data_frame.hpp.
|
inline |
Access a field by position (positional access never checks edits).
Definition at line 133 of file data_frame.hpp.
|
inline |
Get the number of fields in the row.
Definition at line 138 of file data_frame.hpp.
|
inline |
Convert to JSON.
Definition at line 174 of file data_frame.hpp.
|
inline |
Convert to JSON array.
Definition at line 179 of file data_frame.hpp.