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

The XLFormulaProxy serves as a placeholder for XLFormula objects. This enable getting and setting formulas through the same interface. More...

#include <XLFormula.hpp>

Public Member Functions

 ~XLFormulaProxy ()
 Destructor.
 
XLFormulaProxyoperator= (const XLFormulaProxy &other)
 Copy assignment operator.
 
template<typename T , typename = std::enable_if_t<std::is_same_v<std::decay_t<T>, XLFormula> or std::is_same_v<std::decay_t<T>, std::string> || std::is_same_v<std::decay_t<T>, std::string_view> || std::is_same_v<std::decay_t<T>, const char*> or std::is_same_v<std::decay_t<T>, char*>>>
XLFormulaProxyoperator= (T formula)
 Templated assignment operator, taking a string-type argument.
 
template<typename T , typename = std::enable_if_t<std::is_same_v<std::decay_t<T>, std::string> or std::is_same_v<std::decay_t<T>, std::string_view> || std::is_same_v<std::decay_t<T>, const char*> or std::is_same_v<std::decay_t<T>, char*>>>
void set (T formula)
 Templated setter, taking a string-type argument.
 
std::string get () const
 Get the formula as a std::string.
 
XLFormulaProxyclear ()
 Clear the formula.
 
 operator std::string () const
 Conversion operator, for converting the object to a std::string.
 
 operator XLFormula () const
 Implicit conversion to XLFormula object.
 

Friends

class XLCell
 
class XLFormula
 

Detailed Description

The XLFormulaProxy serves as a placeholder for XLFormula objects. This enable getting and setting formulas through the same interface.

Constructor & Destructor Documentation

◆ ~XLFormulaProxy()

XLFormulaProxy::~XLFormulaProxy ( )
default

Destructor.

Destructor. Default implementation.

Member Function Documentation

◆ clear()

XLFormulaProxy & XLFormulaProxy::clear ( )

Clear the formula.

Returns
Return a reference to the cleared object.

If a formula node exists, it will be erased.

◆ get()

std::string XLFormulaProxy::get ( ) const

Get the formula as a std::string.

Returns
A std::string with the formula.

Call the .get() function in the underlying XLFormula object.

◆ operator std::string()

XLFormulaProxy::operator std::string ( ) const

Conversion operator, for converting the object to a std::string.

Returns
The formula as a std::string.

◆ operator XLFormula()

XLFormulaProxy::operator XLFormula ( ) const

Implicit conversion to XLFormula object.

Returns
Returns the corresponding XLFormula object.

Returns the underlying XLFormula object, by calling getFormula().

◆ operator=() [1/2]

XLFormulaProxy & XLFormulaProxy::operator= ( const XLFormulaProxy other)

Copy assignment operator.

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

Calls the templated string assignment operator.

◆ operator=() [2/2]

template<typename T , typename = std::enable_if_t<std::is_same_v<std::decay_t<T>, XLFormula> or std::is_same_v<std::decay_t<T>, std::string> || std::is_same_v<std::decay_t<T>, std::string_view> || std::is_same_v<std::decay_t<T>, const char*> or std::is_same_v<std::decay_t<T>, char*>>>
XLFormulaProxy & OpenXLSX::XLFormulaProxy::operator= ( formula)
inline

Templated assignment operator, taking a string-type argument.

Template Parameters
TType of argument.
Parameters
formulaThe formula string to be assigned.
Returns
A reference to the copied-to object.

◆ set()

template<typename T , typename = std::enable_if_t<std::is_same_v<std::decay_t<T>, std::string> or std::is_same_v<std::decay_t<T>, std::string_view> || std::is_same_v<std::decay_t<T>, const char*> or std::is_same_v<std::decay_t<T>, char*>>>
void OpenXLSX::XLFormulaProxy::set ( formula)
inline

Templated setter, taking a string-type argument.

Template Parameters
TType of argument.
Parameters
formulaThe formula string to be assigned.

Friends And Related Symbol Documentation

◆ XLCell

friend class XLCell
friend

◆ XLFormula

friend class XLFormula
friend

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