Vince's CSV Parser
Loading...
Searching...
No Matches
csv::DataFrameColumn< KeyType > Class Template Reference

Classes

struct  cell_accessor
 

Public Types

using iterator = internals::indexed_proxy_iterator< const DataFrameColumn< KeyType >, DataFrameCell, cell_accessor >
 
using const_iterator = iterator
 

Public Member Functions

 DataFrameColumn (const DataFrame< KeyType > *frame, size_t col_index)
 
 DataFrameColumn (DataFrame< KeyType > *frame, size_t col_index)
 
const std::string & name () const
 Column name.
 
DataFrameCell try_field (size_t row_index, CSVError &error)
 Checked cell access, preserving mutability of the column proxy.
 
DataFrameCell try_field (size_t row_index, CSVError &error) const
 
csv::string_view try_get_sv (size_t row_index, CSVError &error) const
 
csv::string_view try_name (CSVError &error) const
 
template<typename T = std::string>
std::vector< T > try_to_vector (CSVError &error) const
 
bool try_erase (CSVError &error)
 
bool is_valid () const noexcept
 Whether this column is bound to an existing position in the active schema.
 
size_t index () const noexcept
 Zero-based column position.
 
size_t size () const noexcept
 Number of rows in the parent batch.
 
bool empty () const noexcept
 Whether the parent batch contains no rows.
 
DataFrameCell operator[] (size_t row_index)
 Access a visible cell value by row index, allowing edits on mutable frames.
 
DataFrameCell operator[] (size_t row_index) const
 Access a visible cell value by row index without allowing edits.
 
csv::string_view get_sv (size_t row_index) const
 Access a visible cell value as a string_view without materializing a DataFrameCell.
 
template<typename T = std::string>
std::vector< T > to_vector () const
 Materialize this column as a vector of converted values.
 
 operator std::vector< std::string > () const
 Convert to a vector of strings.
 
bool erase ()
 Delete this column from the parent DataFrame.
 
auto to_sv_range () const
 Convert this DataFrameColumn into a std::ranges::input_range of strings.
 
iterator begin () const
 Iterate over visible cells in this column.
 
iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 

Detailed Description

template<typename KeyType>
class csv::DataFrameColumn< KeyType >

Definition at line 14 of file data_frame_column.hpp.

Member Typedef Documentation

◆ const_iterator

template<typename KeyType >
using csv::DataFrameColumn< KeyType >::const_iterator = iterator

Definition at line 23 of file data_frame_column.hpp.

◆ iterator

template<typename KeyType >
using csv::DataFrameColumn< KeyType >::iterator = internals::indexed_proxy_iterator<const DataFrameColumn<KeyType>, DataFrameCell, cell_accessor>

Definition at line 22 of file data_frame_column.hpp.

Constructor & Destructor Documentation

◆ DataFrameColumn() [1/3]

template<typename KeyType >
csv::DataFrameColumn< KeyType >::DataFrameColumn ( )
inline

Definition at line 25 of file data_frame_column.hpp.

◆ DataFrameColumn() [2/3]

template<typename KeyType >
csv::DataFrameColumn< KeyType >::DataFrameColumn ( const DataFrame< KeyType > *  frame,
size_t  col_index 
)
inline

Definition at line 27 of file data_frame_column.hpp.

◆ DataFrameColumn() [3/3]

template<typename KeyType >
csv::DataFrameColumn< KeyType >::DataFrameColumn ( DataFrame< KeyType > *  frame,
size_t  col_index 
)
inline

Definition at line 34 of file data_frame_column.hpp.

Member Function Documentation

◆ begin()

template<typename KeyType >
iterator csv::DataFrameColumn< KeyType >::begin ( ) const
inline

Iterate over visible cells in this column.

Definition at line 207 of file data_frame_column.hpp.

◆ cbegin()

template<typename KeyType >
const_iterator csv::DataFrameColumn< KeyType >::cbegin ( ) const
inline

Definition at line 209 of file data_frame_column.hpp.

◆ cend()

template<typename KeyType >
const_iterator csv::DataFrameColumn< KeyType >::cend ( ) const
inline

Definition at line 210 of file data_frame_column.hpp.

◆ empty()

template<typename KeyType >
bool csv::DataFrameColumn< KeyType >::empty ( ) const
inlinenoexcept

Whether the parent batch contains no rows.

Definition at line 118 of file data_frame_column.hpp.

◆ end()

template<typename KeyType >
iterator csv::DataFrameColumn< KeyType >::end ( ) const
inline

Definition at line 208 of file data_frame_column.hpp.

◆ erase()

template<typename KeyType >
bool csv::DataFrameColumn< KeyType >::erase ( )
inline

Delete this column from the parent DataFrame.

Structural mutation invalidates outstanding row, column, and cell proxies.

Definition at line 184 of file data_frame_column.hpp.

◆ get_sv()

template<typename KeyType >
csv::string_view csv::DataFrameColumn< KeyType >::get_sv ( size_t  row_index) const
inline

Access a visible cell value as a string_view without materializing a DataFrameCell.

Intended for immediate read-only scans. If the value comes from the sparse edit overlay, the returned view points into overlay-owned storage and must not be retained across DataFrame mutation.

Definition at line 149 of file data_frame_column.hpp.

◆ index()

template<typename KeyType >
size_t csv::DataFrameColumn< KeyType >::index ( ) const
inlinenoexcept

Zero-based column position.

Definition at line 104 of file data_frame_column.hpp.

◆ is_valid()

template<typename KeyType >
bool csv::DataFrameColumn< KeyType >::is_valid ( ) const
inlinenoexcept

Whether this column is bound to an existing position in the active schema.

Definition at line 98 of file data_frame_column.hpp.

◆ name()

template<typename KeyType >
const std::string & csv::DataFrameColumn< KeyType >::name ( ) const
inline

Column name.

Definition at line 43 of file data_frame_column.hpp.

◆ operator std::vector< std::string >()

template<typename KeyType >
csv::DataFrameColumn< KeyType >::operator std::vector< std::string > ( ) const
inline

Convert to a vector of strings.

Definition at line 170 of file data_frame_column.hpp.

◆ operator[]() [1/2]

template<typename KeyType >
DataFrameCell csv::DataFrameColumn< KeyType >::operator[] ( size_t  row_index)
inline

Access a visible cell value by row index, allowing edits on mutable frames.

Definition at line 124 of file data_frame_column.hpp.

◆ operator[]() [2/2]

template<typename KeyType >
DataFrameCell csv::DataFrameColumn< KeyType >::operator[] ( size_t  row_index) const
inline

Access a visible cell value by row index without allowing edits.

Definition at line 134 of file data_frame_column.hpp.

◆ size()

template<typename KeyType >
size_t csv::DataFrameColumn< KeyType >::size ( ) const
inlinenoexcept

Number of rows in the parent batch.

Definition at line 109 of file data_frame_column.hpp.

◆ to_sv_range()

template<typename KeyType >
auto csv::DataFrameColumn< KeyType >::to_sv_range ( ) const
inline

Convert this DataFrameColumn into a std::ranges::input_range of strings.

Note
Requires C++20 or later.

Definition at line 197 of file data_frame_column.hpp.

◆ to_vector()

template<typename KeyType >
template<typename T = std::string>
std::vector< T > csv::DataFrameColumn< KeyType >::to_vector ( ) const
inline

Materialize this column as a vector of converted values.

Definition at line 160 of file data_frame_column.hpp.

◆ try_erase()

template<typename KeyType >
bool csv::DataFrameColumn< KeyType >::try_erase ( CSVError &  error)
inline

Definition at line 90 of file data_frame_column.hpp.

◆ try_field() [1/2]

template<typename KeyType >
DataFrameCell csv::DataFrameColumn< KeyType >::try_field ( size_t  row_index,
CSVError &  error 
)
inline

Checked cell access, preserving mutability of the column proxy.

Definition at line 52 of file data_frame_column.hpp.

◆ try_field() [2/2]

template<typename KeyType >
DataFrameCell csv::DataFrameColumn< KeyType >::try_field ( size_t  row_index,
CSVError &  error 
) const
inline

Definition at line 56 of file data_frame_column.hpp.

◆ try_get_sv()

template<typename KeyType >
csv::string_view csv::DataFrameColumn< KeyType >::try_get_sv ( size_t  row_index,
CSVError &  error 
) const
inline

Definition at line 60 of file data_frame_column.hpp.

◆ try_name()

template<typename KeyType >
csv::string_view csv::DataFrameColumn< KeyType >::try_name ( CSVError &  error) const
inline

Definition at line 68 of file data_frame_column.hpp.

◆ try_to_vector()

template<typename KeyType >
template<typename T = std::string>
std::vector< T > csv::DataFrameColumn< KeyType >::try_to_vector ( CSVError &  error) const
inline

Definition at line 73 of file data_frame_column.hpp.


The documentation for this class was generated from the following file: