11#ifndef OPENXLSX_XLSTYLE_HPP
12#define OPENXLSX_XLSTYLE_HPP
14#include "OpenXLSX-Exports.hpp"
32 std::optional<std::string>
name;
33 std::optional<uint32_t>
size;
50 std::optional<XLLineStyle>
style;
81 return lhs.name == rhs.name && lhs.size == rhs.size && lhs.color == rhs.color &&
82 lhs.bold == rhs.bold && lhs.italic == rhs.italic && lhs.underline == rhs.underline &&
83 lhs.strikethrough == rhs.strikethrough;
90 return lhs.pattern == rhs.pattern && lhs.fgColor == rhs.fgColor && lhs.bgColor == rhs.bgColor;
97 return lhs.style == rhs.style && lhs.color == rhs.color;
104 return lhs.left == rhs.left && lhs.right == rhs.right && lhs.top == rhs.top &&
105 lhs.bottom == rhs.bottom && lhs.diagonal == rhs.diagonal &&
106 lhs.diagonalUp == rhs.diagonalUp && lhs.diagonalDown == rhs.diagonalDown;
113 return lhs.horizontal == rhs.horizontal && lhs.vertical == rhs.vertical &&
114 lhs.wrapText == rhs.wrapText && lhs.textRotation == rhs.textRotation &&
115 lhs.indent == rhs.indent;
122 return lhs.font == rhs.font && lhs.fill == rhs.fill && lhs.border == rhs.border &&
123 lhs.alignment == rhs.alignment && lhs.numberFormat == rhs.numberFormat;
134 seed ^= val + 0x9e3779b97f4a7c15ULL + (seed << 6) + (seed >> 2);
139 uint32_t val = (
static_cast<uint32_t
>(c.alpha()) << 24) |
140 (
static_cast<uint32_t
>(c.red()) << 16) |
141 (
static_cast<uint32_t
>(c.green()) << 8) |
142 static_cast<uint32_t
>(c.blue());
143 return std::hash<uint32_t>{}(val);
154 if (s.font.bold) {
hashCombine(seed, *s.font.bold ? 4 : 5); }
155 if (s.font.italic) {
hashCombine(seed, *s.font.italic ? 6 : 7); }
156 if (s.font.underline) {
hashCombine(seed, *s.font.underline ? 8 : 9); }
157 if (s.font.strikethrough) {
hashCombine(seed, *s.font.strikethrough ? 10 : 11); }
169 hashBorderElem(20, s.border.left);
170 hashBorderElem(30, s.border.right);
171 hashBorderElem(40, s.border.top);
172 hashBorderElem(50, s.border.bottom);
173 hashBorderElem(60, s.border.diagonal);
174 if (s.border.diagonalUp)
hashCombine(seed, *s.border.diagonalUp ? 70 : 71);
175 if (s.border.diagonalDown)
hashCombine(seed, *s.border.diagonalDown ? 72 : 73);
178 if (s.alignment.horizontal) {
hashCombine(seed, 80);
hashCombine(seed,
static_cast<size_t>(*s.alignment.horizontal)); }
179 if (s.alignment.vertical) {
hashCombine(seed, 81);
hashCombine(seed,
static_cast<size_t>(*s.alignment.vertical)); }
180 if (s.alignment.wrapText)
hashCombine(seed, *s.alignment.wrapText ? 82 : 83);
181 if (s.alignment.textRotation) {
hashCombine(seed, 84);
hashCombine(seed, std::hash<uint16_t>{}(*s.alignment.textRotation)); }
182 if (s.alignment.indent) {
hashCombine(seed, 85);
hashCombine(seed, std::hash<uint32_t>{}(*s.alignment.indent)); }
185 if (s.numberFormat) {
hashCombine(seed, 90);
hashCombine(seed, std::hash<std::string>{}(*s.numberFormat)); }
Definition XLColor.hpp:32
Definition IXLCellProvider.hpp:24
bool operator==(const XLCell &lhs, const XLCell &rhs)
Definition XLCell.hpp:314
bool operator!=(const XLCell &lhs, const XLCell &rhs)
Definition XLCell.hpp:321
Definition XLCellIterator.hpp:131
Definition XLStyle.hpp:131
size_t operator()(const XLStyle &s) const noexcept
Definition XLStyle.hpp:146
static void hashCombine(size_t &seed, size_t val) noexcept
Definition XLStyle.hpp:132
static size_t hashColor(const XLColor &c) noexcept
Definition XLStyle.hpp:137
Definition XLStyle.hpp:66
std::optional< bool > wrapText
Definition XLStyle.hpp:69
std::optional< uint32_t > indent
Definition XLStyle.hpp:71
std::optional< uint16_t > textRotation
Definition XLStyle.hpp:70
std::optional< XLAlignmentStyle > vertical
Definition XLStyle.hpp:68
std::optional< XLAlignmentStyle > horizontal
Definition XLStyle.hpp:67
Definition XLStyle.hpp:49
std::optional< XLColor > color
Definition XLStyle.hpp:51
std::optional< XLLineStyle > style
Definition XLStyle.hpp:50
Definition XLStyle.hpp:55
BorderElement left
Definition XLStyle.hpp:56
BorderElement top
Definition XLStyle.hpp:58
BorderElement right
Definition XLStyle.hpp:57
BorderElement bottom
Definition XLStyle.hpp:59
std::optional< bool > diagonalDown
Definition XLStyle.hpp:62
BorderElement diagonal
Definition XLStyle.hpp:60
std::optional< bool > diagonalUp
Definition XLStyle.hpp:61
Definition XLStyle.hpp:42
std::optional< XLColor > bgColor
Definition XLStyle.hpp:45
std::optional< XLColor > fgColor
Definition XLStyle.hpp:44
std::optional< XLPatternType > pattern
Definition XLStyle.hpp:43
Definition XLStyle.hpp:31
std::optional< XLColor > color
Definition XLStyle.hpp:34
std::optional< bool > bold
Definition XLStyle.hpp:35
std::optional< bool > italic
Definition XLStyle.hpp:36
std::optional< std::string > name
Definition XLStyle.hpp:32
std::optional< uint32_t > size
Definition XLStyle.hpp:33
std::optional< bool > underline
Definition XLStyle.hpp:37
std::optional< bool > strikethrough
Definition XLStyle.hpp:38
A high-level, human-ergonomic structure representing the styling of a cell or range....
Definition XLStyle.hpp:29
struct OpenXLSX::XLStyle::Font font
struct OpenXLSX::XLStyle::Fill fill
std::optional< std::string > numberFormat
Definition XLStyle.hpp:74
struct OpenXLSX::XLStyle::Border border
struct OpenXLSX::XLStyle::Alignment alignment
size_t operator()(const OpenXLSX::XLStyle &s) const noexcept
Definition XLStyle.hpp:198