xlnt
|
workbook is the container for all other parts of the document. More...
#include <workbook.hpp>
Public Types | |
using | iterator = worksheet_iterator |
typedef for the iterator used for iterating through this workbook (non-const) in a range-based for loop. More... | |
using | const_iterator = const_worksheet_iterator |
typedef for the iterator used for iterating through this workbook (const) in a range-based for loop. More... | |
using | reverse_iterator = std::reverse_iterator< iterator > |
typedef for the iterator used for iterating through this workbook (non-const) in a range-based for loop in reverse order using std::make_reverse_iterator. More... | |
using | const_reverse_iterator = std::reverse_iterator< const_iterator > |
typedef for the iterator used for iterating through this workbook (const) in a range-based for loop in reverse order using std::make_reverse_iterator. More... | |
Public Member Functions | |
workbook () | |
Default constructor. Constructs a workbook containing a single empty worksheet using workbook::empty(). More... | |
workbook (const xlnt::path &file) | |
load the xlsx file at path More... | |
workbook (const xlnt::path &file, const std::string &password) | |
load the encrpyted xlsx file at path More... | |
workbook (std::istream &data) | |
construct the workbook from any data stream where the data is the binary form of a workbook More... | |
workbook (std::istream &data, const std::string &password) | |
construct the workbook from any data stream where the data is the binary form of an encrypted workbook More... | |
workbook (workbook &&other) | |
Move constructor. Constructs a workbook from existing workbook, other. More... | |
workbook (const workbook &other) | |
Copy constructor. Constructs this workbook from existing workbook, other. More... | |
~workbook () | |
Destroys this workbook, deallocating all internal storage space. Any pimpl wrapper classes (e.g. cell) pointing into this workbook will be invalid after this is executed. More... | |
worksheet | create_sheet () |
Creates and returns a sheet after the last sheet in this workbook. More... | |
worksheet | create_sheet (std::size_t index) |
Creates and returns a sheet at the specified index. More... | |
worksheet | create_sheet_with_rel (const std::string &title, const relationship &rel) |
TODO: This should be private... More... | |
worksheet | copy_sheet (worksheet worksheet) |
Creates and returns a new sheet after the last sheet initializing it with all of the data from the provided worksheet. More... | |
worksheet | copy_sheet (worksheet worksheet, std::size_t index) |
Creates and returns a new sheet at the specified index initializing it with all of the data from the provided worksheet. More... | |
worksheet | active_sheet () |
Returns the worksheet that is determined to be active. An active sheet is that which is initially shown by the spreadsheet editor. More... | |
void | active_sheet (std::size_t index) |
Sets the worksheet that is determined to be active. An active sheet is that which is initially shown by the spreadsheet editor. More... | |
worksheet | sheet_by_title (const std::string &title) |
Returns the worksheet with the given name. This may throw an exception if the sheet isn't found. Use workbook::contains(const std::string &) to make sure the sheet exists before calling this method. More... | |
const worksheet | sheet_by_title (const std::string &title) const |
Returns the worksheet with the given name. This may throw an exception if the sheet isn't found. Use workbook::contains(const std::string &) to make sure the sheet exists before calling this method. More... | |
worksheet | sheet_by_index (std::size_t index) |
Returns the worksheet at the given index. This will throw an exception if index is greater than or equal to the number of sheets in this workbook. More... | |
const worksheet | sheet_by_index (std::size_t index) const |
Returns the worksheet at the given index. This will throw an exception if index is greater than or equal to the number of sheets in this workbook. More... | |
worksheet | sheet_by_id (std::size_t id) |
Returns the worksheet with a sheetId of id. Sheet IDs are arbitrary numbers that uniquely identify a sheet. Most users won't need this. More... | |
const worksheet | sheet_by_id (std::size_t id) const |
Returns the worksheet with a sheetId of id. Sheet IDs are arbitrary numbers that uniquely identify a sheet. Most users won't need this. More... | |
bool | sheet_hidden_by_index (std::size_t index) const |
Returns the hidden identifier of the worksheet at the given index. This will throw an exception if index is greater than or equal to the number of sheets in this workbook. More... | |
bool | contains (const std::string &title) const |
Returns true if this workbook contains a sheet with the given title. More... | |
std::size_t | index (worksheet worksheet) |
Returns the index of the given worksheet. The worksheet must be owned by this workbook. More... | |
void | remove_sheet (worksheet worksheet) |
Removes the given worksheet from this workbook. More... | |
void | clear () |
Sets the contents of this workbook to be equivalent to that of a workbook returned by workbook::empty(). More... | |
iterator | begin () |
Returns an iterator to the first worksheet in this workbook. More... | |
iterator | end () |
Returns an iterator to the worksheet following the last worksheet of the workbook. This worksheet acts as a placeholder; attempting to access it will cause an exception to be thrown. More... | |
const_iterator | begin () const |
Returns a const iterator to the first worksheet in this workbook. More... | |
const_iterator | end () const |
Returns a const iterator to the worksheet following the last worksheet of the workbook. This worksheet acts as a placeholder; attempting to access it will cause an exception to be thrown. More... | |
const_iterator | cbegin () const |
Returns an iterator to the first worksheet in this workbook. More... | |
const_iterator | cend () const |
Returns a const iterator to the worksheet following the last worksheet of the workbook. This worksheet acts as a placeholder; attempting to access it will cause an exception to be thrown. More... | |
void | apply_to_cells (std::function< void(cell)> f) |
Applies the function "f" to every non-empty cell in every worksheet in this workbook. More... | |
std::vector< std::string > | sheet_titles () const |
Returns a temporary vector containing the titles of each sheet in the order of the sheets in the workbook. More... | |
std::size_t | sheet_count () const |
Returns the number of sheets in this workbook. More... | |
bool | has_core_property (xlnt::core_property type) const |
Returns true if the workbook has the core property with the given name. More... | |
std::vector< xlnt::core_property > | core_properties () const |
Returns a vector of the type of each core property that is set to a particular value in this workbook. More... | |
variant | core_property (xlnt::core_property type) const |
Returns the value of the given core property. More... | |
void | core_property (xlnt::core_property type, const variant &value) |
Sets the given core property to the provided value. More... | |
bool | has_extended_property (xlnt::extended_property type) const |
Returns true if the workbook has the extended property with the given name. More... | |
std::vector< xlnt::extended_property > | extended_properties () const |
Returns a vector of the type of each extended property that is set to a particular value in this workbook. More... | |
variant | extended_property (xlnt::extended_property type) const |
Returns the value of the given extended property. More... | |
void | extended_property (xlnt::extended_property type, const variant &value) |
Sets the given extended property to the provided value. More... | |
bool | has_custom_property (const std::string &property_name) const |
Returns true if the workbook has the custom property with the given name. More... | |
std::vector< std::string > | custom_properties () const |
Returns a vector of the name of each custom property that is set to a particular value in this workbook. More... | |
variant | custom_property (const std::string &property_name) const |
Returns the value of the given custom property. More... | |
void | custom_property (const std::string &property_name, const variant &value) |
Creates a new custom property in this workbook and sets it to the provided value. More... | |
calendar | base_date () const |
Returns the base date used by this workbook. This will generally be windows_1900 except on Apple based systems when it will default to mac_1904 unless otherwise set via void workbook::base_date(calendar base_date) . More... | |
void | base_date (calendar base_date) |
Sets the base date style of this workbook. This is the date and time that a numeric value of 0 represents. More... | |
bool | has_title () const |
Returns true if this workbook has had its title set. More... | |
std::string | title () const |
Returns the title of this workbook. More... | |
void | title (const std::string &title) |
Sets the title of this workbook to title. More... | |
void | abs_path (const std::string &path) |
Sets the absolute path of this workbook to path. More... | |
void | arch_id_flags (const std::size_t flags) |
Sets the ArchID flags of this workbook to flags. More... | |
std::vector< xlnt::named_range > | named_ranges () const |
Returns a vector of the named ranges in this workbook. More... | |
void | create_named_range (const std::string &name, worksheet worksheet, const range_reference &reference) |
Creates a new names range. More... | |
void | create_named_range (const std::string &name, worksheet worksheet, const std::string &reference_string) |
Creates a new names range. More... | |
bool | has_named_range (const std::string &name) const |
Returns true if a named range of the given name exists in the workbook. More... | |
class range | named_range (const std::string &name) |
Returns the named range with the given name. More... | |
void | remove_named_range (const std::string &name) |
Deletes the named range with the given name. More... | |
void | save (std::vector< std::uint8_t > &data) const |
Serializes the workbook into an XLSX file and saves the bytes into byte vector data. More... | |
void | save (std::vector< std::uint8_t > &data, const std::string &password) const |
Serializes the workbook into an XLSX file encrypted with the given password and saves the bytes into byte vector data. More... | |
void | save (const std::string &filename) const |
Serializes the workbook into an XLSX file and saves the data into a file named filename. More... | |
void | save (const std::string &filename, const std::string &password) const |
Serializes the workbook into an XLSX file encrypted with the given password and loads the bytes into a file named filename. More... | |
void | save (const xlnt::path &filename) const |
Serializes the workbook into an XLSX file and saves the data into a file named filename. More... | |
void | save (const xlnt::path &filename, const std::string &password) const |
Serializes the workbook into an XLSX file encrypted with the given password and loads the bytes into a file named filename. More... | |
void | save (std::ostream &stream) const |
Serializes the workbook into an XLSX file and saves the data into stream. More... | |
void | save (std::ostream &stream, const std::string &password) const |
Serializes the workbook into an XLSX file encrypted with the given password and loads the bytes into the given stream. More... | |
void | load (const std::vector< std::uint8_t > &data) |
Interprets byte vector data as an XLSX file and sets the content of this workbook to match that file. More... | |
void | load (const std::vector< std::uint8_t > &data, const std::string &password) |
Interprets byte vector data as an XLSX file encrypted with the given password and sets the content of this workbook to match that file. More... | |
void | load (const std::string &filename) |
Interprets file with the given filename as an XLSX file and sets the content of this workbook to match that file. More... | |
void | load (const std::string &filename, const std::string &password) |
Interprets file with the given filename as an XLSX file encrypted with the given password and sets the content of this workbook to match that file. More... | |
void | load (const xlnt::path &filename) |
Interprets file with the given filename as an XLSX file and sets the content of this workbook to match that file. More... | |
void | load (const xlnt::path &filename, const std::string &password) |
Interprets file with the given filename as an XLSX file encrypted with the given password and sets the content of this workbook to match that file. More... | |
void | load (std::istream &stream) |
Interprets data in stream as an XLSX file and sets the content of this workbook to match that file. More... | |
void | load (std::istream &stream, const std::string &password) |
Interprets data in stream as an XLSX file encrypted with the given password and sets the content of this workbook to match that file. More... | |
bool | has_view () const |
Returns true if this workbook has a view. More... | |
workbook_view | view () const |
Returns the view. More... | |
void | view (const workbook_view &view) |
Sets the view to view. More... | |
bool | has_code_name () const |
Returns true if a code name has been set for this workbook. More... | |
std::string | code_name () const |
Returns the code name that was set for this workbook. More... | |
void | code_name (const std::string &code_name) |
Sets the code name of this workbook to code_name. More... | |
bool | has_file_version () const |
Returns true if this workbook has a file version. More... | |
std::string | app_name () const |
Returns the AppName workbook file property. More... | |
std::size_t | last_edited () const |
Returns the LastEdited workbook file property. More... | |
std::size_t | lowest_edited () const |
Returns the LowestEdited workbook file property. More... | |
std::size_t | rup_build () const |
Returns the RupBuild workbook file property. More... | |
bool | has_theme () const |
Returns true if this workbook has a theme defined. More... | |
const xlnt::theme & | theme () const |
Returns a const reference to this workbook's theme. More... | |
void | theme (const class theme &value) |
Sets the theme to value. More... | |
xlnt::format | format (std::size_t format_index) |
Returns the cell format at the given index. The index is the position of the format in xl/styles.xml. More... | |
const xlnt::format | format (std::size_t format_index) const |
Returns the cell format at the given index. The index is the position of the format in xl/styles.xml. More... | |
xlnt::format | create_format (bool default_format=false) |
Creates a new format and returns it. More... | |
void | clear_formats () |
Clear all cell-level formatting and formats from the styelsheet. This leaves all other styling in place (e.g. named styles). More... | |
bool | has_style (const std::string &name) const |
Returns true if this workbook has a style with a name of name. More... | |
class style | style (const std::string &name) |
Returns the named style with the given name. More... | |
const class style | style (const std::string &name) const |
Returns the named style with the given name. More... | |
class style | create_style (const std::string &name) |
Creates a new style and returns it. More... | |
class style | create_builtin_style (std::size_t builtin_id) |
Creates a new style and returns it. More... | |
void | clear_styles () |
Clear all named styles from cells and remove the styles from from the styelsheet. This leaves all other styling in place (e.g. cell formats). More... | |
void | default_slicer_style (const std::string &value) |
Sets the default slicer style to the given value. More... | |
std::string | default_slicer_style () const |
Returns the default slicer style. More... | |
void | enable_known_fonts () |
Enables knownFonts in stylesheet. More... | |
void | disable_known_fonts () |
Disables knownFonts in stylesheet. More... | |
bool | known_fonts_enabled () const |
Returns true if knownFonts are enabled in the stylesheet. More... | |
class manifest & | manifest () |
Returns a reference to the workbook's internal manifest. More... | |
const class manifest & | manifest () const |
Returns a reference to the workbook's internal manifest. More... | |
std::size_t | add_shared_string (const rich_text &shared, bool allow_duplicates=false) |
Append a shared string to the shared string collection in this workbook. This should not generally be called unless you know what you're doing. If allow_duplicates is false and the string is already in the collection, it will not be added. Returns the index of the added string. More... | |
const rich_text & | shared_strings (std::size_t index) const |
Returns a reference to the shared string related to the specified index More... | |
std::vector< rich_text > & | shared_strings () |
Returns a reference to the shared strings being used by cells in this workbook. More... | |
const std::vector< rich_text > & | shared_strings () const |
Returns a reference to the shared strings being used by cells in this workbook. More... | |
void | thumbnail (const std::vector< std::uint8_t > &thumbnail, const std::string &extension, const std::string &content_type) |
Sets the workbook's thumbnail to the given vector of bytes, thumbnail, with the given extension (e.g. jpg) and content_type (e.g. image/jpeg). More... | |
const std::vector< std::uint8_t > & | thumbnail () const |
Returns a vector of bytes representing the workbook's thumbnail. More... | |
const std::unordered_map< std::string, std::vector< std::uint8_t > > & | binaries () const |
Returns stored binary data. More... | |
bool | has_calculation_properties () const |
Returns true if this workbook has any calculation properties set. More... | |
class calculation_properties | calculation_properties () const |
Returns the calculation properties used in this workbook. More... | |
void | calculation_properties (const class calculation_properties &props) |
Sets the calculation properties of this workbook to props. More... | |
workbook & | operator= (workbook other) |
Set the contents of this workbook to be equal to those of "other". Other is passed as value to allow for copy-swap idiom. More... | |
worksheet | operator[] (const std::string &name) |
Return the worksheet with a title of "name". More... | |
worksheet | operator[] (std::size_t index) |
Return the worksheet at "index". More... | |
bool | operator== (const workbook &rhs) const |
Return true if this workbook internal implementation points to the same memory as rhs's. More... | |
bool | operator!= (const workbook &rhs) const |
Return true if this workbook internal implementation doesn't point to the same memory as rhs's. More... | |
Static Public Member Functions | |
static workbook | empty () |
Constructs and returns an empty workbook similar to a default. Excel workbook More... | |
Friends | |
class | streaming_workbook_reader |
class | worksheet |
class | detail::xlsx_consumer |
class | detail::xlsx_producer |
workbook is the container for all other parts of the document.
typedef for the iterator used for iterating through this workbook (const) in a range-based for loop.
using xlnt::workbook::const_reverse_iterator = std::reverse_iterator<const_iterator> |
typedef for the iterator used for iterating through this workbook (const) in a range-based for loop in reverse order using std::make_reverse_iterator.
typedef for the iterator used for iterating through this workbook (non-const) in a range-based for loop.
using xlnt::workbook::reverse_iterator = std::reverse_iterator<iterator> |
typedef for the iterator used for iterating through this workbook (non-const) in a range-based for loop in reverse order using std::make_reverse_iterator.
xlnt::workbook::workbook | ( | ) |
Default constructor. Constructs a workbook containing a single empty worksheet using workbook::empty().
xlnt::workbook::workbook | ( | const xlnt::path & | file | ) |
load the xlsx file at path
xlnt::workbook::workbook | ( | const xlnt::path & | file, |
const std::string & | password | ||
) |
load the encrpyted xlsx file at path
xlnt::workbook::workbook | ( | std::istream & | data | ) |
construct the workbook from any data stream where the data is the binary form of a workbook
xlnt::workbook::workbook | ( | std::istream & | data, |
const std::string & | password | ||
) |
construct the workbook from any data stream where the data is the binary form of an encrypted workbook
xlnt::workbook::workbook | ( | workbook && | other | ) |
Move constructor. Constructs a workbook from existing workbook, other.
xlnt::workbook::workbook | ( | const workbook & | other | ) |
Copy constructor. Constructs this workbook from existing workbook, other.
xlnt::workbook::~workbook | ( | ) |
Destroys this workbook, deallocating all internal storage space. Any pimpl wrapper classes (e.g. cell) pointing into this workbook will be invalid after this is executed.
void xlnt::workbook::abs_path | ( | const std::string & | path | ) |
Sets the absolute path of this workbook to path.
worksheet xlnt::workbook::active_sheet | ( | ) |
Returns the worksheet that is determined to be active. An active sheet is that which is initially shown by the spreadsheet editor.
void xlnt::workbook::active_sheet | ( | std::size_t | index | ) |
Sets the worksheet that is determined to be active. An active sheet is that which is initially shown by the spreadsheet editor.
std::size_t xlnt::workbook::add_shared_string | ( | const rich_text & | shared, |
bool | allow_duplicates = false |
||
) |
Append a shared string to the shared string collection in this workbook. This should not generally be called unless you know what you're doing. If allow_duplicates is false and the string is already in the collection, it will not be added. Returns the index of the added string.
std::string xlnt::workbook::app_name | ( | ) | const |
Returns the AppName workbook file property.
void xlnt::workbook::apply_to_cells | ( | std::function< void(cell)> | f | ) |
Applies the function "f" to every non-empty cell in every worksheet in this workbook.
void xlnt::workbook::arch_id_flags | ( | const std::size_t | flags | ) |
Sets the ArchID flags of this workbook to flags.
calendar xlnt::workbook::base_date | ( | ) | const |
Returns the base date used by this workbook. This will generally be windows_1900 except on Apple based systems when it will default to mac_1904 unless otherwise set via void workbook::base_date(calendar base_date)
.
void xlnt::workbook::base_date | ( | calendar | base_date | ) |
Sets the base date style of this workbook. This is the date and time that a numeric value of 0 represents.
iterator xlnt::workbook::begin | ( | ) |
Returns an iterator to the first worksheet in this workbook.
const_iterator xlnt::workbook::begin | ( | ) | const |
Returns a const iterator to the first worksheet in this workbook.
const std::unordered_map<std::string, std::vector<std::uint8_t> >& xlnt::workbook::binaries | ( | ) | const |
Returns stored binary data.
class calculation_properties xlnt::workbook::calculation_properties | ( | ) | const |
Returns the calculation properties used in this workbook.
void xlnt::workbook::calculation_properties | ( | const class calculation_properties & | props | ) |
Sets the calculation properties of this workbook to props.
const_iterator xlnt::workbook::cbegin | ( | ) | const |
Returns an iterator to the first worksheet in this workbook.
const_iterator xlnt::workbook::cend | ( | ) | const |
Returns a const iterator to the worksheet following the last worksheet of the workbook. This worksheet acts as a placeholder; attempting to access it will cause an exception to be thrown.
void xlnt::workbook::clear | ( | ) |
Sets the contents of this workbook to be equivalent to that of a workbook returned by workbook::empty().
void xlnt::workbook::clear_formats | ( | ) |
Clear all cell-level formatting and formats from the styelsheet. This leaves all other styling in place (e.g. named styles).
void xlnt::workbook::clear_styles | ( | ) |
Clear all named styles from cells and remove the styles from from the styelsheet. This leaves all other styling in place (e.g. cell formats).
std::string xlnt::workbook::code_name | ( | ) | const |
Returns the code name that was set for this workbook.
void xlnt::workbook::code_name | ( | const std::string & | code_name | ) |
Sets the code name of this workbook to code_name.
bool xlnt::workbook::contains | ( | const std::string & | title | ) | const |
Returns true if this workbook contains a sheet with the given title.
Creates and returns a new sheet after the last sheet initializing it with all of the data from the provided worksheet.
Creates and returns a new sheet at the specified index initializing it with all of the data from the provided worksheet.
std::vector<xlnt::core_property> xlnt::workbook::core_properties | ( | ) | const |
Returns a vector of the type of each core property that is set to a particular value in this workbook.
variant xlnt::workbook::core_property | ( | xlnt::core_property | type | ) | const |
Returns the value of the given core property.
void xlnt::workbook::core_property | ( | xlnt::core_property | type, |
const variant & | value | ||
) |
Sets the given core property to the provided value.
class style xlnt::workbook::create_builtin_style | ( | std::size_t | builtin_id | ) |
Creates a new style and returns it.
xlnt::format xlnt::workbook::create_format | ( | bool | default_format = false | ) |
Creates a new format and returns it.
void xlnt::workbook::create_named_range | ( | const std::string & | name, |
worksheet | worksheet, | ||
const range_reference & | reference | ||
) |
Creates a new names range.
void xlnt::workbook::create_named_range | ( | const std::string & | name, |
worksheet | worksheet, | ||
const std::string & | reference_string | ||
) |
Creates a new names range.
worksheet xlnt::workbook::create_sheet | ( | ) |
Creates and returns a sheet after the last sheet in this workbook.
worksheet xlnt::workbook::create_sheet | ( | std::size_t | index | ) |
Creates and returns a sheet at the specified index.
worksheet xlnt::workbook::create_sheet_with_rel | ( | const std::string & | title, |
const relationship & | rel | ||
) |
TODO: This should be private...
class style xlnt::workbook::create_style | ( | const std::string & | name | ) |
Creates a new style and returns it.
std::vector<std::string> xlnt::workbook::custom_properties | ( | ) | const |
Returns a vector of the name of each custom property that is set to a particular value in this workbook.
variant xlnt::workbook::custom_property | ( | const std::string & | property_name | ) | const |
Returns the value of the given custom property.
void xlnt::workbook::custom_property | ( | const std::string & | property_name, |
const variant & | value | ||
) |
Creates a new custom property in this workbook and sets it to the provided value.
void xlnt::workbook::default_slicer_style | ( | const std::string & | value | ) |
Sets the default slicer style to the given value.
std::string xlnt::workbook::default_slicer_style | ( | ) | const |
Returns the default slicer style.
void xlnt::workbook::disable_known_fonts | ( | ) |
Disables knownFonts in stylesheet.
|
static |
Constructs and returns an empty workbook similar to a default. Excel workbook
void xlnt::workbook::enable_known_fonts | ( | ) |
Enables knownFonts in stylesheet.
iterator xlnt::workbook::end | ( | ) |
Returns an iterator to the worksheet following the last worksheet of the workbook. This worksheet acts as a placeholder; attempting to access it will cause an exception to be thrown.
const_iterator xlnt::workbook::end | ( | ) | const |
Returns a const iterator to the worksheet following the last worksheet of the workbook. This worksheet acts as a placeholder; attempting to access it will cause an exception to be thrown.
std::vector<xlnt::extended_property> xlnt::workbook::extended_properties | ( | ) | const |
Returns a vector of the type of each extended property that is set to a particular value in this workbook.
variant xlnt::workbook::extended_property | ( | xlnt::extended_property | type | ) | const |
Returns the value of the given extended property.
void xlnt::workbook::extended_property | ( | xlnt::extended_property | type, |
const variant & | value | ||
) |
Sets the given extended property to the provided value.
xlnt::format xlnt::workbook::format | ( | std::size_t | format_index | ) |
Returns the cell format at the given index. The index is the position of the format in xl/styles.xml.
const xlnt::format xlnt::workbook::format | ( | std::size_t | format_index | ) | const |
Returns the cell format at the given index. The index is the position of the format in xl/styles.xml.
bool xlnt::workbook::has_calculation_properties | ( | ) | const |
Returns true if this workbook has any calculation properties set.
bool xlnt::workbook::has_code_name | ( | ) | const |
Returns true if a code name has been set for this workbook.
bool xlnt::workbook::has_core_property | ( | xlnt::core_property | type | ) | const |
Returns true if the workbook has the core property with the given name.
bool xlnt::workbook::has_custom_property | ( | const std::string & | property_name | ) | const |
Returns true if the workbook has the custom property with the given name.
bool xlnt::workbook::has_extended_property | ( | xlnt::extended_property | type | ) | const |
Returns true if the workbook has the extended property with the given name.
bool xlnt::workbook::has_file_version | ( | ) | const |
Returns true if this workbook has a file version.
bool xlnt::workbook::has_named_range | ( | const std::string & | name | ) | const |
Returns true if a named range of the given name exists in the workbook.
bool xlnt::workbook::has_style | ( | const std::string & | name | ) | const |
Returns true if this workbook has a style with a name of name.
bool xlnt::workbook::has_theme | ( | ) | const |
Returns true if this workbook has a theme defined.
bool xlnt::workbook::has_title | ( | ) | const |
Returns true if this workbook has had its title set.
bool xlnt::workbook::has_view | ( | ) | const |
Returns true if this workbook has a view.
std::size_t xlnt::workbook::index | ( | worksheet | worksheet | ) |
Returns the index of the given worksheet. The worksheet must be owned by this workbook.
bool xlnt::workbook::known_fonts_enabled | ( | ) | const |
Returns true if knownFonts are enabled in the stylesheet.
std::size_t xlnt::workbook::last_edited | ( | ) | const |
Returns the LastEdited workbook file property.
void xlnt::workbook::load | ( | const std::vector< std::uint8_t > & | data | ) |
Interprets byte vector data as an XLSX file and sets the content of this workbook to match that file.
void xlnt::workbook::load | ( | const std::vector< std::uint8_t > & | data, |
const std::string & | password | ||
) |
Interprets byte vector data as an XLSX file encrypted with the given password and sets the content of this workbook to match that file.
void xlnt::workbook::load | ( | const std::string & | filename | ) |
Interprets file with the given filename as an XLSX file and sets the content of this workbook to match that file.
void xlnt::workbook::load | ( | const std::string & | filename, |
const std::string & | password | ||
) |
Interprets file with the given filename as an XLSX file encrypted with the given password and sets the content of this workbook to match that file.
void xlnt::workbook::load | ( | const xlnt::path & | filename | ) |
Interprets file with the given filename as an XLSX file and sets the content of this workbook to match that file.
void xlnt::workbook::load | ( | const xlnt::path & | filename, |
const std::string & | password | ||
) |
Interprets file with the given filename as an XLSX file encrypted with the given password and sets the content of this workbook to match that file.
void xlnt::workbook::load | ( | std::istream & | stream | ) |
Interprets data in stream as an XLSX file and sets the content of this workbook to match that file.
void xlnt::workbook::load | ( | std::istream & | stream, |
const std::string & | password | ||
) |
Interprets data in stream as an XLSX file encrypted with the given password and sets the content of this workbook to match that file.
std::size_t xlnt::workbook::lowest_edited | ( | ) | const |
Returns the LowestEdited workbook file property.
class manifest& xlnt::workbook::manifest | ( | ) |
Returns a reference to the workbook's internal manifest.
const class manifest& xlnt::workbook::manifest | ( | ) | const |
Returns a reference to the workbook's internal manifest.
class range xlnt::workbook::named_range | ( | const std::string & | name | ) |
Returns the named range with the given name.
std::vector<xlnt::named_range> xlnt::workbook::named_ranges | ( | ) | const |
Returns a vector of the named ranges in this workbook.
bool xlnt::workbook::operator!= | ( | const workbook & | rhs | ) | const |
Return true if this workbook internal implementation doesn't point to the same memory as rhs's.
Set the contents of this workbook to be equal to those of "other". Other is passed as value to allow for copy-swap idiom.
bool xlnt::workbook::operator== | ( | const workbook & | rhs | ) | const |
Return true if this workbook internal implementation points to the same memory as rhs's.
worksheet xlnt::workbook::operator[] | ( | const std::string & | name | ) |
Return the worksheet with a title of "name".
worksheet xlnt::workbook::operator[] | ( | std::size_t | index | ) |
Return the worksheet at "index".
void xlnt::workbook::remove_named_range | ( | const std::string & | name | ) |
Deletes the named range with the given name.
void xlnt::workbook::remove_sheet | ( | worksheet | worksheet | ) |
Removes the given worksheet from this workbook.
std::size_t xlnt::workbook::rup_build | ( | ) | const |
Returns the RupBuild workbook file property.
void xlnt::workbook::save | ( | std::vector< std::uint8_t > & | data | ) | const |
Serializes the workbook into an XLSX file and saves the bytes into byte vector data.
void xlnt::workbook::save | ( | std::vector< std::uint8_t > & | data, |
const std::string & | password | ||
) | const |
Serializes the workbook into an XLSX file encrypted with the given password and saves the bytes into byte vector data.
void xlnt::workbook::save | ( | const std::string & | filename | ) | const |
Serializes the workbook into an XLSX file and saves the data into a file named filename.
void xlnt::workbook::save | ( | const std::string & | filename, |
const std::string & | password | ||
) | const |
Serializes the workbook into an XLSX file encrypted with the given password and loads the bytes into a file named filename.
void xlnt::workbook::save | ( | const xlnt::path & | filename | ) | const |
Serializes the workbook into an XLSX file and saves the data into a file named filename.
void xlnt::workbook::save | ( | const xlnt::path & | filename, |
const std::string & | password | ||
) | const |
Serializes the workbook into an XLSX file encrypted with the given password and loads the bytes into a file named filename.
void xlnt::workbook::save | ( | std::ostream & | stream | ) | const |
Serializes the workbook into an XLSX file and saves the data into stream.
void xlnt::workbook::save | ( | std::ostream & | stream, |
const std::string & | password | ||
) | const |
Serializes the workbook into an XLSX file encrypted with the given password and loads the bytes into the given stream.
const rich_text& xlnt::workbook::shared_strings | ( | std::size_t | index | ) | const |
Returns a reference to the shared string related to the specified index
std::vector<rich_text>& xlnt::workbook::shared_strings | ( | ) |
Returns a reference to the shared strings being used by cells in this workbook.
const std::vector<rich_text>& xlnt::workbook::shared_strings | ( | ) | const |
Returns a reference to the shared strings being used by cells in this workbook.
worksheet xlnt::workbook::sheet_by_id | ( | std::size_t | id | ) |
Returns the worksheet with a sheetId of id. Sheet IDs are arbitrary numbers that uniquely identify a sheet. Most users won't need this.
const worksheet xlnt::workbook::sheet_by_id | ( | std::size_t | id | ) | const |
Returns the worksheet with a sheetId of id. Sheet IDs are arbitrary numbers that uniquely identify a sheet. Most users won't need this.
worksheet xlnt::workbook::sheet_by_index | ( | std::size_t | index | ) |
Returns the worksheet at the given index. This will throw an exception if index is greater than or equal to the number of sheets in this workbook.
const worksheet xlnt::workbook::sheet_by_index | ( | std::size_t | index | ) | const |
Returns the worksheet at the given index. This will throw an exception if index is greater than or equal to the number of sheets in this workbook.
worksheet xlnt::workbook::sheet_by_title | ( | const std::string & | title | ) |
Returns the worksheet with the given name. This may throw an exception if the sheet isn't found. Use workbook::contains(const std::string &) to make sure the sheet exists before calling this method.
const worksheet xlnt::workbook::sheet_by_title | ( | const std::string & | title | ) | const |
Returns the worksheet with the given name. This may throw an exception if the sheet isn't found. Use workbook::contains(const std::string &) to make sure the sheet exists before calling this method.
std::size_t xlnt::workbook::sheet_count | ( | ) | const |
Returns the number of sheets in this workbook.
bool xlnt::workbook::sheet_hidden_by_index | ( | std::size_t | index | ) | const |
Returns the hidden identifier of the worksheet at the given index. This will throw an exception if index is greater than or equal to the number of sheets in this workbook.
std::vector<std::string> xlnt::workbook::sheet_titles | ( | ) | const |
Returns a temporary vector containing the titles of each sheet in the order of the sheets in the workbook.
class style xlnt::workbook::style | ( | const std::string & | name | ) |
Returns the named style with the given name.
const class style xlnt::workbook::style | ( | const std::string & | name | ) | const |
Returns the named style with the given name.
const xlnt::theme& xlnt::workbook::theme | ( | ) | const |
Returns a const reference to this workbook's theme.
void xlnt::workbook::theme | ( | const class theme & | value | ) |
Sets the theme to value.
void xlnt::workbook::thumbnail | ( | const std::vector< std::uint8_t > & | thumbnail, |
const std::string & | extension, | ||
const std::string & | content_type | ||
) |
Sets the workbook's thumbnail to the given vector of bytes, thumbnail, with the given extension (e.g. jpg) and content_type (e.g. image/jpeg).
const std::vector<std::uint8_t>& xlnt::workbook::thumbnail | ( | ) | const |
Returns a vector of bytes representing the workbook's thumbnail.
std::string xlnt::workbook::title | ( | ) | const |
Returns the title of this workbook.
void xlnt::workbook::title | ( | const std::string & | title | ) |
Sets the title of this workbook to title.
workbook_view xlnt::workbook::view | ( | ) | const |
Returns the view.
void xlnt::workbook::view | ( | const workbook_view & | view | ) |
Sets the view to view.