OpenXLSX 1.12.1
Modern C++ Excel Library (Fork of OpenXLSX by Kenneth Troldal Balslev)
Loading...
Searching...
No Matches
OpenXLSX::XLSharedStringTable Class Referenceabstract

Abstract read-only view of the workbook shared string table. More...

#include <XLSharedStringTable.hpp>

Inheritance diagram for OpenXLSX::XLSharedStringTable:
OpenXLSX::XLDocument OpenXLSX::XLMapSharedStringTable

Public Member Functions

virtual ~XLSharedStringTable ()=default
virtual int32_t stringCount () const =0
virtual int32_t getStringIndex (std::string_view str) const =0
 Look up an existing string's index.
virtual bool stringExists (std::string_view str) const =0
virtual const char * getString (int32_t index) const =0
 Resolve an SST index to a null-terminated C string.
virtual std::string_view getStringView (int32_t index) const =0
 Resolve an SST index to a string_view into the arena/cache.

Detailed Description

Abstract read-only view of the workbook shared string table.

Note
Implemented by XLDocument (delegates to its XLSharedStrings). Lifetime must outlive consumers.

Constructor & Destructor Documentation

◆ ~XLSharedStringTable()

virtual OpenXLSX::XLSharedStringTable::~XLSharedStringTable ( )
virtualdefault

Member Function Documentation

◆ getString()

virtual const char * OpenXLSX::XLSharedStringTable::getString ( int32_t index) const
nodiscardpure virtual

Resolve an SST index to a null-terminated C string.

Note
Pointer is valid while the document / SST remains alive.

Implemented in OpenXLSX::XLDocument, and OpenXLSX::XLMapSharedStringTable.

◆ getStringIndex()

virtual int32_t OpenXLSX::XLSharedStringTable::getStringIndex ( std::string_view str) const
nodiscardpure virtual

Look up an existing string's index.

Returns
Index, or a negative value when the string is not present.

Implemented in OpenXLSX::XLDocument, and OpenXLSX::XLMapSharedStringTable.

◆ getStringView()

virtual std::string_view OpenXLSX::XLSharedStringTable::getStringView ( int32_t index) const
nodiscardpure virtual

Resolve an SST index to a string_view into the arena/cache.

Note
View is valid while the document / SST remains alive.

Implemented in OpenXLSX::XLDocument, and OpenXLSX::XLMapSharedStringTable.

◆ stringCount()

virtual int32_t OpenXLSX::XLSharedStringTable::stringCount ( ) const
nodiscardpure virtual
Returns
Number of entries currently in the SST cache.

Implemented in OpenXLSX::XLDocument, and OpenXLSX::XLMapSharedStringTable.

◆ stringExists()

virtual bool OpenXLSX::XLSharedStringTable::stringExists ( std::string_view str) const
nodiscardpure virtual
Returns
true if str is already registered in the SST.

Implemented in OpenXLSX::XLDocument, and OpenXLSX::XLMapSharedStringTable.


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