|
| | XLCellValue () |
| | Default constructor.
|
| |
| 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>>> |
| | XLCellValue (const T &value) |
| | A templated constructor. Any value convertible to a valid cell value can be used as argument.
|
| |
| | XLCellValue (const XLCellValue &other) |
| | Copy constructor.
|
| |
| | XLCellValue (XLCellValue &&other) noexcept |
| | Move constructor.
|
| |
| | ~XLCellValue () |
| | Destructor.
|
| |
| XLCellValue & | operator= (const XLCellValue &other) |
| | Copy assignment operator.
|
| |
| XLCellValue & | operator= (XLCellValue &&other) noexcept |
| | Move 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, OpenXLSX::XLRichText> or std::is_same_v<T, XLDateTime>>> |
| XLCellValue & | operator= (T value) |
| | Templated assignment operator.
|
| |
| template<typename T , typename = std::enable_if_t<std::is_same_v<T, XLCellValue> or std::is_integral_v<T> or std::is_floating_point_v<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*> || std::is_same_v<T, OpenXLSX::XLRichText> or std::is_same_v<T, XLDateTime>>> |
| void | set (T numberValue) |
| | Templated setter for integral and bool types.
|
| |
| 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, XLDateTime> or std::is_same_v<T, OpenXLSX::XLRichText>>> |
| T | get () const |
| | Templated getter.
|
| |
| double | getDouble () const |
| | get the cell value as a double, regardless of value type
|
| |
| std::string | getString () |
| | get the cell value as a std::string, regardless of value type
|
| |
| const XLCellValueType & | getVariant () const |
| | get the cell value as a std::variant of XLCellValueType
|
| |
| 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 |
| | Explicit conversion operator for easy conversion to supported types.
|
| |
| XLCellValue & | clear () |
| | Clears the contents of the XLCellValue object.
|
| |
| XLCellValue & | setError (const std::string &error) |
| | Sets the value type to XLValueType::Error.
|
| |
| XLValueType | type () const |
| | Get the value type of the current object.
|
| |
| const char * | typeAsString () const |
| | Get the value type of the current object, as a string representation.
|
| |
Class encapsulating a cell value.
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::XLCellValue::XLCellValue |
( |
const T & |
value | ) |
|
|
inline |
A templated constructor. Any value convertible to a valid cell value can be used as argument.
- Template Parameters
-
| T | The type of the argument (will be automatically deduced). |
- Parameters
-
- Todo:
- Consider changing the enable_if statement to check for objects with a .c_str() member function.
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, XLDateTime> or std::is_same_v<T, OpenXLSX::XLRichText>>>
| T OpenXLSX::XLCellValue::get |
( |
| ) |
const |
|
inline |
Templated getter.
- Template Parameters
-
| T | The type of the value to be returned. |
- Returns
- The value as a type T object.
- Exceptions
-
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::XLCellValue::operator T |
( |
| ) |
const |
|
inline |
Explicit conversion operator for easy conversion to supported types.
- Template Parameters
-
- Returns
- The XLCellValue object cast to requested type.
- Exceptions
-
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>>>
| XLCellValue & OpenXLSX::XLCellValue::operator= |
( |
T |
value | ) |
|
|
inline |
Templated assignment operator.
- Template Parameters
-
| T | The type of the value argument. |
- Parameters
-
- Returns
- A reference to the assigned-to object.
template<typename T , typename = std::enable_if_t<std::is_same_v<T, XLCellValue> or std::is_integral_v<T> or std::is_floating_point_v<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*> || std::is_same_v<T, OpenXLSX::XLRichText> or std::is_same_v<T, XLDateTime>>>
| void OpenXLSX::XLCellValue::set |
( |
T |
numberValue | ) |
|
|
inline |
Templated setter for integral and bool types.
- Template Parameters
-
| T | The type of the value argument. |
- Parameters
-