Orcus
Public Member Functions | List of all members
orcus::spreadsheet::shared_strings Class Reference

#include <shared_strings.hpp>

Public Member Functions

 shared_strings (const shared_strings &)=delete
 
shared_stringsoperator= (const shared_strings &)=delete
 
 shared_strings (ixion::model_context &cxt)
 
void set_format_runs (std::size_t sindex, std::unique_ptr< format_runs_t > runs)
 
const format_runs_t * get_format_runs (std::size_t index) const
 
const std::string * get_string (std::size_t index) const
 
void dump (std::ostream &os) const
 

Detailed Description

This class manages access to a pool of shared string instances for both unformatted strings and rich-text strings. The underlying string values themselves are stored externally in the ixion::model_context instance which this class references; this class itself only stores the format properties of the rich-text strings.

Member Function Documentation

◆ get_format_runs()

const format_runs_t* orcus::spreadsheet::shared_strings::get_format_runs ( std::size_t  index) const

Get the entire format runs of a string.

Parameters
indexindex of the string to get the format runs of.
Returns
pointer to the format runs, or nullptr if no format runs exist for the specified string index.

◆ get_string()

const std::string* orcus::spreadsheet::shared_strings::get_string ( std::size_t  index) const

Get an underlying string value associated with an index.

Parameters
indexindex of a string value.
Returns
pointer to a string value associated with the index, or nullptr in case of an invalid string index.

◆ set_format_runs()

void orcus::spreadsheet::shared_strings::set_format_runs ( std::size_t  sindex,
std::unique_ptr< format_runs_t >  runs 
)

Set the entire format runs of a string.

Parameters
sindexindex of the string to associate the format runs with.
runsformat runs.