OpenXLSX 1.9.1
Loading...
Searching...
No Matches
OpenXLSX::XLRowDataProxy Class Reference

The XLRowDataProxy is used as a proxy object when getting or setting row data. The class facilitates easy conversion to/from containers. More...

#include <XLRowData.hpp>

Public Member Functions

 ~XLRowDataProxy ()
 Destructor.
 
XLRowDataProxyoperator= (const XLRowDataProxy &other)
 Copy assignment operator.
 
XLRowDataProxyoperator= (const std::vector< XLCellValue > &values)
 Assignment operator taking a std::vector of XLCellValues as an argument.
 
XLRowDataProxyoperator= (const std::vector< bool > &values)
 Assignment operator taking a std::vector of bool values as an argument.
 
template<typename T , typename = std::enable_if_t<!std::is_same_v<T, XLRowDataProxy> && std::is_base_of_v<std::bidirectional_iterator_tag, typename std::iterator_traits<typename T::iterator>::iterator_category>, T>>
XLRowDataProxyoperator= (const T &values)
 Templated assignment operator taking any container supporting bidirectional iterators.
 
 operator std::vector< XLCellValue > () const
 Implicit conversion to std::vector of XLCellValues.
 
 operator std::deque< XLCellValue > () const
 Implicit conversion to std::deque of XLCellValues.
 
 operator std::list< XLCellValue > () const
 Implicit conversion to std::list of XLCellValues.
 
template<typename Container , typename = std::enable_if_t<!std::is_same_v<Container, XLRowDataProxy> && std::is_base_of_v<std::bidirectional_iterator_tag, typename std::iterator_traits<typename Container::iterator>::iterator_category>, Container>>
 operator Container () const
 Explicit conversion operator.
 
void clear ()
 Clears all values for the current row.
 

Friends

class XLRow
 

Detailed Description

The XLRowDataProxy is used as a proxy object when getting or setting row data. The class facilitates easy conversion to/from containers.

Constructor & Destructor Documentation

◆ ~XLRowDataProxy()

OpenXLSX::XLRowDataProxy::~XLRowDataProxy ( )
default

Destructor.

Member Function Documentation

◆ clear()

void OpenXLSX::XLRowDataProxy::clear ( )

Clears all values for the current row.

◆ operator Container()

template<typename Container , typename = std::enable_if_t<!std::is_same_v<Container, XLRowDataProxy> && std::is_base_of_v<std::bidirectional_iterator_tag, typename std::iterator_traits<typename Container::iterator>::iterator_category>, Container>>
OpenXLSX::XLRowDataProxy::operator Container ( ) const
inlineexplicit

Explicit conversion operator.

This function calls the convertContainer template function to convert the row data to the container stipulated by the client. The reason that this function is marked explicit is that the implicit conversion operators above will be ambiguous.

Template Parameters
ContainerThe container (and value) type to convert the row data to.
Returns
The required container with the row data.

◆ operator std::deque< XLCellValue >()

OpenXLSX::XLRowDataProxy::operator std::deque< XLCellValue > ( ) const

Implicit conversion to std::deque of XLCellValues.

Returns
A std::deque of XLCellValues.

◆ operator std::list< XLCellValue >()

OpenXLSX::XLRowDataProxy::operator std::list< XLCellValue > ( ) const

Implicit conversion to std::list of XLCellValues.

Returns
A std::list of XLCellValues.

◆ operator std::vector< XLCellValue >()

OpenXLSX::XLRowDataProxy::operator std::vector< XLCellValue > ( ) const

Implicit conversion to std::vector of XLCellValues.

Returns
A std::vector of XLCellValues.

◆ operator=() [1/4]

XLRowDataProxy & OpenXLSX::XLRowDataProxy::operator= ( const std::vector< bool > &  values)

Assignment operator taking a std::vector of bool values as an argument.

Parameters
valuesA std::vector of bool values representing the values to be assigned.
Returns
A reference to the copied-to object.

◆ operator=() [2/4]

XLRowDataProxy & OpenXLSX::XLRowDataProxy::operator= ( const std::vector< XLCellValue > &  values)

Assignment operator taking a std::vector of XLCellValues as an argument.

Parameters
valuesA std::vector of XLCellValues representing the values to be assigned.
Returns
A reference to the copied-to object.

◆ operator=() [3/4]

template<typename T , typename = std::enable_if_t<!std::is_same_v<T, XLRowDataProxy> && std::is_base_of_v<std::bidirectional_iterator_tag, typename std::iterator_traits<typename T::iterator>::iterator_category>, T>>
XLRowDataProxy & OpenXLSX::XLRowDataProxy::operator= ( const T &  values)
inline

Templated assignment operator taking any container supporting bidirectional iterators.

Template Parameters
TThe container and value type (will be auto deducted by the compiler).
Parameters
valuesThe container of the values to be assigned.
Returns
A reference to the copied-to object.
Exceptions
XLOverflowErrorif size of container exceeds maximum number of columns.

◆ operator=() [4/4]

XLRowDataProxy & OpenXLSX::XLRowDataProxy::operator= ( const XLRowDataProxy other)

Copy assignment operator.

Parameters
otherObject to be copied.
Returns
A reference to the copied-to object.

Friends And Related Symbol Documentation

◆ XLRow

friend class XLRow
friend

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