OpenXLSX 1.12.1
Modern C++ Excel Library (Fork of OpenXLSX by Kenneth Troldal Balslev)
Loading...
Searching...
No Matches
XLUtilities.hpp File Reference
#include <fstream>
#include <string>
#include <string_view>
#include <vector>
#include "XLCellReference.hpp"
#include "XLCellValue.hpp"
#include "XLConstants.hpp"
#include "XLContentTypes.hpp"
#include "XLRelationships.hpp"
#include "XLStyles_Common.hpp"
#include "XLXmlHelpers.hpp"
#include "XLXmlParser.hpp"

Go to the source code of this file.

Namespaces

namespace  OpenXLSX

Functions

bool OpenXLSX::isCleanXmlString (std::string_view sv) noexcept
 Checks if a string contains only valid XML 1.0 characters.
std::string OpenXLSX::sanitizeXmlString (std::string_view sv)
 Removes invalid XML 1.0 control characters from a string to prevent file corruption.
void OpenXLSX::appendEscaped (std::string &out, std::string_view sv)
 Fast XML escape: appends escaped characters to out to avoid intermediate allocations.
uint16_t OpenXLSX::extractColumnFromCellRef (const char *cellRef) noexcept
 Lightweight function to extract column number from a cell reference string. This is a performance-optimized alternative to creating XLCellReference objects.
char * OpenXLSX::columnToLetters (uint16_t colNo, char *buffer) noexcept
 Convert column number to column letter string (A, B, ..., Z, AA, AB, ..., XFD) Performance optimization: avoids creating full XLCellReference object.
char * OpenXLSX::makeCellAddress (uint32_t row, uint16_t col, char *buffer) noexcept
 Generate cell address string directly without creating XLCellReference object. Performance optimization: for use in hot loops where address generation is frequent.
template<class T>
void OpenXLSX::ignore (const T &)
 Get rid of compiler warnings about unused variables (-Wunused-variable) or unused parameters (-Wunusued-parameter).
std::string OpenXLSX::XLValueTypeString (XLValueType t)
 Get a string representation of pugi::xml_node_type.
std::string OpenXLSX::xml_node_type_string (XMLNodeType t)
 Get a string representation of XMLNodeType.
std::string OpenXLSX::XLContentTypeString (OpenXLSX::XLContentType const &t)
 Get a string representation of OpenXLSX::XLContentType.
std::string OpenXLSX::XLRelationshipTypeString (OpenXLSX::XLRelationshipType const &t)
 Get a string representation of OpenXLSX::XLRelationshipType.
XMLNode OpenXLSX::getRowNode (XMLNode sheetDataNode, uint32_t rowNumber, uint32_t *hintRowNumber=nullptr, XMLNode *hintRowNode=nullptr)
std::vector< XLStyleIndex > OpenXLSX::getColumnStyles (XMLNode rowNode, uint16_t count)
 get the style attribute s for the indicated column, if any is set
XLStyleIndex OpenXLSX::getColumnStyle (XMLNode rowNode, uint16_t colNo)
void OpenXLSX::setDefaultCellAttributes (XMLNode cellNode, const std::string &cellRef, XMLNode rowNode, uint16_t colNo, std::vector< XLStyleIndex > const &colStyles={})
 set the cell reference, and a default cell style attribute if and only if row or column style is != XLDefaultCellFormat
void OpenXLSX::setDefaultCellAttributes (XMLNode cellNode, const char *cellRef, XMLNode rowNode, uint16_t colNo, std::vector< XLStyleIndex > const &colStyles={})
 Overload accepting const char* for cell reference - avoids std::string allocation Performance optimization: for use in hot loops where address generation is frequent.
XMLNode OpenXLSX::getCellNode (XMLNode rowNode, uint16_t columnNumber, uint32_t rowNumber=0, std::vector< XLStyleIndex > const &colStyles={}, uint16_t *hintColNumber=nullptr, XMLNode *hintCellNode=nullptr)
 Retrieve the xml node representing the cell at the given row and column. If the node doesn't exist, it will be created.
std::pair< uint32_t, uint32_t > OpenXLSX::getImageDimensions (const std::string &data)
 Extract image dimensions (width and height) from raw image data (PNG/JPEG).