Orcus
Loading...
Searching...
No Matches
Public Member Functions | List of all members
orcus::spreadsheet::iface::import_shared_strings Class Referenceabstract

#include <import_interface.hpp>

Inheritance diagram for orcus::spreadsheet::iface::import_shared_strings:
orcus::spreadsheet::import_shared_strings

Public Member Functions

virtual size_t append (std::string_view s)=0
 
virtual size_t add (std::string_view s)=0
 
virtual void set_segment_font (size_t font_index)=0
 
virtual void set_segment_bold (bool b)=0
 
virtual void set_segment_italic (bool b)=0
 
virtual void set_segment_font_name (std::string_view s)=0
 
virtual void set_segment_font_size (double point)=0
 
virtual void set_segment_font_color (color_elem_t alpha, color_elem_t red, color_elem_t green, color_elem_t blue)=0
 
virtual void append_segment (std::string_view s)=0
 
virtual size_t commit_segments ()=0
 

Detailed Description

Interface class designed to be derived by the implementor.

Member Function Documentation

◆ add()

virtual size_t orcus::spreadsheet::iface::import_shared_strings::add ( std::string_view  s)
pure virtual

Similar to the append method, it adds new string to the string pool; however, this method checks if the string being added is already in the pool before each insertion, to avoid duplicated strings.

Parameters
sstring to add to the pool.
Returns
ID of the string just inserted.

Implemented in orcus::spreadsheet::import_shared_strings.

◆ append()

virtual size_t orcus::spreadsheet::iface::import_shared_strings::append ( std::string_view  s)
pure virtual

Append new string to the string list. Order of insertion is important since that determines the numerical ID values of inserted strings. Note that this method assumes that the caller knows the string being appended is not yet in the pool.

Parameters
sstring to append to the pool.
Returns
ID of the string just inserted.

Implemented in orcus::spreadsheet::import_shared_strings.

◆ append_segment()

virtual void orcus::spreadsheet::iface::import_shared_strings::append_segment ( std::string_view  s)
pure virtual

Append a string segment with the current format attributes to the formatted string buffer.

Parameters
sstring segment value.

Implemented in orcus::spreadsheet::import_shared_strings.

◆ commit_segments()

virtual size_t orcus::spreadsheet::iface::import_shared_strings::commit_segments ( )
pure virtual

Store the formatted string in the current buffer to the shared strings store. The implementation may choose to unconditionally append the string to the store, or choose to look for an existing indentical formatted string to reuse and discard the new one if one exists.

Returns
ID of the string just inserted, or the ID of an existing string with identical formatting attributes.

Implemented in orcus::spreadsheet::import_shared_strings.

◆ set_segment_bold()

virtual void orcus::spreadsheet::iface::import_shared_strings::set_segment_bold ( bool  b)
pure virtual

Set whether or not to make the font bold to the current format attributes.

Parameters
btrue if it's bold, false otherwise.

Implemented in orcus::spreadsheet::import_shared_strings.

◆ set_segment_font()

virtual void orcus::spreadsheet::iface::import_shared_strings::set_segment_font ( size_t  font_index)
pure virtual

Set the index of a font to apply to the current format attributes.

Parameters
font_indexpositive integer representing the font to use.

Implemented in orcus::spreadsheet::import_shared_strings.

◆ set_segment_font_color()

virtual void orcus::spreadsheet::iface::import_shared_strings::set_segment_font_color ( color_elem_t  alpha,
color_elem_t  red,
color_elem_t  green,
color_elem_t  blue 
)
pure virtual

Set the color of a font in ARGB to the current format attributes.

Parameters
alphaalpha component value (0-255).
redred component value (0-255).
greengreen component value (0-255).
blueblue component value (0-255).

Implemented in orcus::spreadsheet::import_shared_strings.

◆ set_segment_font_name()

virtual void orcus::spreadsheet::iface::import_shared_strings::set_segment_font_name ( std::string_view  s)
pure virtual

Set the name of a font to the current format attributes.

Parameters
sfont name.

Implemented in orcus::spreadsheet::import_shared_strings.

◆ set_segment_font_size()

virtual void orcus::spreadsheet::iface::import_shared_strings::set_segment_font_size ( double  point)
pure virtual

Set a font size to the current format attributes.

Parameters
pointfont size in points.

Implemented in orcus::spreadsheet::import_shared_strings.

◆ set_segment_italic()

virtual void orcus::spreadsheet::iface::import_shared_strings::set_segment_italic ( bool  b)
pure virtual

Set whether or not to set the font italic font to the current format attributes.

Parameters
btrue if it's italic, false otherwise.

Implemented in orcus::spreadsheet::import_shared_strings.