|
| | ~XLCellValueProxy () |
| | Destructor.
|
| |
| XLCellValueProxy & | operator= (const XLCellValueProxy &other) |
| | Copy assignment operator.
|
| |
| template<typename T , typename = std::enable_if_t< std::is_integral_v<T> or std::is_floating_point_v<T> or std::is_same_v<std::decay_t<T>, std::string> || std::is_same_v<std::decay_t<T>, std::string_view> or std::is_same_v<std::decay_t<T>, const char*> || std::is_same_v<std::decay_t<T>, char*> or std::is_same_v<T, XLCellValue> or std::is_same_v<T, XLDateTime> or std::is_same_v<T, OpenXLSX::XLRichText>>> |
| XLCellValueProxy & | operator= (const T &value) |
| | Templated assignment operator.
|
| |
| template<typename T , typename = std::enable_if_t< std::is_integral_v<T> or std::is_floating_point_v<T> or std::is_same_v<std::decay_t<T>, std::string> || std::is_same_v<std::decay_t<T>, std::string_view> or std::is_same_v<std::decay_t<T>, const char*> || std::is_same_v<std::decay_t<T>, char*> or std::is_same_v<T, XLCellValue> or std::is_same_v<T, XLDateTime> or std::is_same_v<T, OpenXLSX::XLRichText>>> |
| void | set (const T &value) |
| | Sets the cell value using an automatically deduced type proxy.
|
| |
| template<typename T , typename = std::enable_if_t< std::is_integral_v<T> or std::is_floating_point_v<T> or std::is_same_v<std::decay_t<T>, std::string> || std::is_same_v<std::decay_t<T>, std::string_view> or std::is_same_v<std::decay_t<T>, const char*> || std::is_same_v<std::decay_t<T>, char*> or std::is_same_v<T, OpenXLSX::XLRichText> or std::is_same_v<T, XLDateTime>>> |
| T | get () const |
| |
| XLCellValueProxy & | clear () |
| | Clear the contents of the cell.
|
| |
| XLCellValueProxy & | setError (const std::string &error) |
| | Set the cell value to a error state.
|
| |
| XLValueType | type () const |
| | Get the value type for the cell.
|
| |
| const char * | typeAsString () const |
| | Get the value type of the current object, as a string representation.
|
| |
| | operator XLCellValue () const |
| | Implicitly convert the XLCellValueProxy object to a XLCellValue object.
|
| |
| template<typename T , typename = std::enable_if_t< std::is_integral_v<T> or std::is_floating_point_v<T> or std::is_same_v<std::decay_t<T>, std::string> || std::is_same_v<std::decay_t<T>, std::string_view> or std::is_same_v<std::decay_t<T>, const char*> || std::is_same_v<std::decay_t<T>, char*> or std::is_same_v<T, OpenXLSX::XLRichText> or std::is_same_v<T, XLDateTime>>> |
| | operator T () const |
| | Converts the underlying cell value proxy into the specified type T.
|
| |
| std::string_view | getStringView () const |
| | get the cell value as a std::string, regardless of value type
|
| |
| std::string | getString () const |
| |
The XLCellValueProxy class is used for proxy (or placeholder) objects for XLCellValue objects.
The purpose is to enable implicit conversion during assignment operations. XLCellValueProxy objects can not be constructed manually by the user, only through XLCell objects.
template<typename T , typename = std::enable_if_t< std::is_integral_v<T> or std::is_floating_point_v<T> or std::is_same_v<std::decay_t<T>, std::string> || std::is_same_v<std::decay_t<T>, std::string_view> or std::is_same_v<std::decay_t<T>, const char*> || std::is_same_v<std::decay_t<T>, char*> or std::is_same_v<T, OpenXLSX::XLRichText> or std::is_same_v<T, XLDateTime>>>
| T OpenXLSX::XLCellValueProxy::get |
( |
| ) |
const |
|
inline |
- Template Parameters
-
- Todo:
- Is an explicit conversion operator needed as well?
template<typename T , typename = std::enable_if_t< std::is_integral_v<T> or std::is_floating_point_v<T> or std::is_same_v<std::decay_t<T>, std::string> || std::is_same_v<std::decay_t<T>, std::string_view> or std::is_same_v<std::decay_t<T>, const char*> || std::is_same_v<std::decay_t<T>, char*> or std::is_same_v<T, OpenXLSX::XLRichText> or std::is_same_v<T, XLDateTime>>>
| OpenXLSX::XLCellValueProxy::operator T |
( |
| ) |
const |
|
inline |
Converts the underlying cell value proxy into the specified type T.
- Template Parameters
-
| T | The target type to convert the cell value into (e.g., int, double, std::string). |
- Returns
- The cell value casted to the requested type.
template<typename T , typename = std::enable_if_t< std::is_integral_v<T> or std::is_floating_point_v<T> or std::is_same_v<std::decay_t<T>, std::string> || std::is_same_v<std::decay_t<T>, std::string_view> or std::is_same_v<std::decay_t<T>, const char*> || std::is_same_v<std::decay_t<T>, char*> or std::is_same_v<T, XLCellValue> or std::is_same_v<T, XLDateTime> or std::is_same_v<T, OpenXLSX::XLRichText>>>
Templated assignment operator.
- Template Parameters
-
| T | The type of numberValue assigned to the object. |
- Parameters
-
- Returns
- A reference to the current object.
template<typename T , typename = std::enable_if_t< std::is_integral_v<T> or std::is_floating_point_v<T> or std::is_same_v<std::decay_t<T>, std::string> || std::is_same_v<std::decay_t<T>, std::string_view> or std::is_same_v<std::decay_t<T>, const char*> || std::is_same_v<std::decay_t<T>, char*> or std::is_same_v<T, XLCellValue> or std::is_same_v<T, XLDateTime> or std::is_same_v<T, OpenXLSX::XLRichText>>>
| void OpenXLSX::XLCellValueProxy::set |
( |
const T & |
value | ) |
|
|
inline |
Sets the cell value using an automatically deduced type proxy.
- Template Parameters
-
| T | The deduced type of the assigned value. |
- Parameters
-
| value | The value to assign to the cell. |