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

Lightweight non-owning view over one DataFrame column. More...

#include <data_frame.hpp>

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)
 
const std::string & name () const
 Column name.
 
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) const
 Access a visible cell value by row index.
 
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.
 
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 >

Lightweight non-owning view over one DataFrame column.

Definition at line 750 of file data_frame.hpp.

Member Typedef Documentation

◆ const_iterator

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

Definition at line 759 of file data_frame.hpp.

◆ iterator

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

Definition at line 758 of file data_frame.hpp.

Constructor & Destructor Documentation

◆ DataFrameColumn() [1/2]

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

Definition at line 761 of file data_frame.hpp.

◆ DataFrameColumn() [2/2]

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

Definition at line 763 of file data_frame.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 842 of file data_frame.hpp.

◆ cbegin()

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

Definition at line 844 of file data_frame.hpp.

◆ cend()

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

Definition at line 845 of file data_frame.hpp.

◆ empty()

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

Whether the parent batch contains no rows.

Definition at line 782 of file data_frame.hpp.

◆ end()

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

Definition at line 843 of file data_frame.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 799 of file data_frame.hpp.

◆ index()

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

Zero-based column position.

Definition at line 772 of file data_frame.hpp.

◆ name()

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

Column name.

Definition at line 767 of file data_frame.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 824 of file data_frame.hpp.

◆ operator[]()

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

Access a visible cell value by row index.

Definition at line 787 of file data_frame.hpp.

◆ size()

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

Number of rows in the parent batch.

Definition at line 777 of file data_frame.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 833 of file data_frame.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 812 of file data_frame.hpp.


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