|
xlnt - community edition
|
workbook is the container for all other parts of the document. More...
#include <workbook.hpp>
Public Types | |
| enum | clone_method { deep_copy, shallow_copy } |
| The method for cloning workbooks. More... | |
| 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)=default | |
| Move constructor. Constructs a workbook from existing workbook, other. More... | |
| workbook (const workbook &other)=default | |
| Copy constructor. Constructs this workbook from existing workbook, other. Creates a shallow copy, copying the workbook's internal pointers. More... | |
| ~workbook ()=default | |
| 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... | |
| workbook | clone (clone_method method) const |
| Creates a clone of this workbook. A shallow copy will copy the workbook's internal pointers, while a deep copy will copy all the internal structures and create a full clone of the workbook. More... | |
| worksheet | create_sheet () |
| Creates a sheet after the last sheet in this workbook and returns a wrapper pointing to it. More... | |
| worksheet | create_sheet (std::size_t index) |
| Creates a sheet at the specified index and returns a wrapper pointing to it. More... | |
| worksheet | create_sheet_with_rel (const std::string &title, const relationship &rel) |
| Creates a sheet wit the specified title and relationship and returns a wrapper pointing to it. TODO: This should be private... More... | |
| worksheet | copy_sheet (worksheet worksheet) |
| Creates a new sheet after the last sheet initializing it with all of the data from the provided worksheet. Returns a wrapper pointing to the copied sheet. The worksheet to be copied needs to be part of the same workbook (have the same parent) as this workbook - otherwise, an invalid_parameter exception will be thrown. More... | |
| worksheet | copy_sheet (worksheet worksheet, std::size_t index) |
| Creates a new sheet at the specified index initializing it with all of the data from the provided worksheet. Returns a wrapper pointing to the copied sheet. The worksheet to be copied needs to be part of the same workbook (have the same parent) as this workbook - otherwise, an invalid_parameter exception will be thrown. More... | |
| worksheet | active_sheet () |
| Returns a wrapper pointing to 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 a wrapper pointing to the worksheet with the given name. This will throw a key_not_found 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 a wrapper pointing to the worksheet with the given name. This will throw a key_not_found 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 a wrapper pointing to the worksheet at the given index. Assumes that the index is valid (please call sheet_count() to check). This method will throw an invalid_parameter 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 a wrapper pointing to the worksheet at the given index. Assumes that the index is valid (please call sheet_count() to check). This method will throw an invalid_parameter exception if index is greater than or equal to the number of sheets in this workbook. More... | |
| bool | has_sheet_id (std::size_t id) const |
| Returns whether this workbook has a sheet with the specified ID. Most users won't need this. More... | |
| worksheet | sheet_by_id (std::size_t id) |
| Returns a wrapper pointing to the worksheet with a sheetId of id. Sheet IDs are arbitrary numbers that uniquely identify a sheet. Assumes that the ID is valid (please call has_sheet_id() to check). If the ID is invalid, a key_not_found exception will be thrown. Most users won't need this. More... | |
| const worksheet | sheet_by_id (std::size_t id) const |
| Returns a wrapper pointing to the worksheet with a sheetId of id. Sheet IDs are arbitrary numbers that uniquely identify a sheet. Assumes that the ID is valid (please call has_sheet_id() to check). If the ID is invalid, a key_not_found exception will be thrown. 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. Assumes that the index is valid (please call sheet_count() to check). This will throw an invalid_parameter 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) const |
| Returns the index of the given worksheet. The worksheet must be owned by this workbook. If the worksheet is not owned by this workbook, an invalid_parameter exception will be thrown. More... | |
| void | move_sheet (worksheet worksheet, std::size_t newIndex) |
| Moves a sheet to a new position defined. The worksheet must be owned by this workbook. Assumes that the index is valid (please call sheet_count() to check). This method will throw an invalid_parameter exception if index is greater than or equal to the number of sheets in this workbook, or if the worksheet is not part of (not owned by) this workbook. More... | |
| void | remove_sheet (worksheet worksheet) |
| Removes the given worksheet from this workbook. The worksheet must be owned by this workbook. If the worksheet is not part of (not owned by) this workbook, an invalid_parameter exception will be thrown. 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 xlnt::invalid_parameter 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 xlnt::invalid_parameter 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 xlnt::invalid_parameter 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 a copy of the value of the given core property. Assumes that the specified core_property exists (please call has_core_property() to check). If the specified core_property does not exist, a null variant will be returned. 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 a copy of the value of the given extended property. Assumes that the specified extended_property exists (please call has_extended_property() to check). If the specified extended_property does not exist, a null variant will be returned. 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 a copy of the value of the given custom property. Assumes that the specified custom_property exists (please call has_custom_property() to check). If the specified custom_property does not exist, a null variant will be returned. 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. Assumes that this workbook has a title (please call has_title() to check). If this workbook has no title, an invalid_attribute exception will be thrown. 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 named 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. Assumes that the specified named_range exists (please call has_named_range() to check). If the specified named_range does not exist, an xlnt::key_not_found exception will be thrown. More... | |
| void | remove_named_range (const std::string &name) |
| Deletes the named range with the given name. Assumes that the specified named_range exists (please call has_named_range() to check). If the specified named_range does not exist, an xlnt::key_not_found exception will be thrown. 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. If the workbook requires a password (which is not provided), an xlnt::invalid_password will be thrown. If the file is empty/malformed, an xlnt::invalid_file exception will be thrown. If the file is valid but uses features not yet supported by XLNT which cannot be ignored/skipped, an xlnt::unsupported exception will be thrown. 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. If the specified password is invalid, an xlnt::invalid_password will be thrown. If the file is empty/malformed, an xlnt::invalid_file exception will be thrown. If the file is valid but uses features not yet supported by XLNT which cannot be ignored/skipped, an xlnt::unsupported exception will be thrown. 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. If the file does not exist at the specified path, or is empty/malformed, an xlnt::invalid_file exception will be thrown. If the file is valid but uses features not yet supported by XLNT which cannot be ignored/skipped, an xlnt::unsupported exception will be thrown. If the workbook requires a password (which is not provided), an xlnt::invalid_password will be thrown. 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. If the file does not exist at the specified path, or is empty/malformed, an xlnt::invalid_file exception will be thrown. If the file is valid but uses features not yet supported by XLNT which cannot be ignored/skipped, an xlnt::unsupported exception will be thrown. If the specified password is invalid, an xlnt::invalid_password will be thrown. 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. If the file does not exist at the specified path, or is empty/malformed, an xlnt::invalid_file exception will be thrown. If the file is valid but uses features not yet supported by XLNT which cannot be ignored/skipped, an xlnt::unsupported exception will be thrown. If the workbook requires a password (which is not provided), an xlnt::invalid_password will be thrown. 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. If the file does not exist at the specified path, or is empty/malformed, an xlnt::invalid_file exception will be thrown. If the file is valid but uses features not yet supported by XLNT which cannot be ignored/skipped, an xlnt::unsupported exception will be thrown. If the specified password is invalid, an xlnt::invalid_password will be thrown. 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. If the workbook requires a password (which is not provided), an xlnt::invalid_password will be thrown. If the file is empty/malformed, an xlnt::invalid_file exception will be thrown. If the file is valid but uses features not yet supported by XLNT which cannot be ignored/skipped, an xlnt::unsupported exception will be thrown. 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. If the specified password is invalid, an xlnt::invalid_password will be thrown. If the file is empty/malformed, an xlnt::invalid_file exception will be thrown. If the file is valid but uses features not yet supported by XLNT which cannot be ignored/skipped, an xlnt::unsupported exception will be thrown. More... | |
| bool | has_view () const |
| Returns true if this workbook has a view. More... | |
| workbook_view | view () const |
| Returns a copy of the view. Assumes that the view exists (please call has_view() to check). If the view does not exist, an xlnt::invalid_attribute exception will be thrown. 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. Assumes that the code_name exists (please call has_code_name() to check). If the code_name does not exist, an xlnt::invalid_attribute exception will be thrown. 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... | |
| void | clear_file_version () |
| Clears the information contained by the file version (e.g. AppName, LastEdited, LowestEdited, RupBuild). More... | |
| bool | has_app_name () const |
| Returns true if this workbook has a non-empty AppName workbook file property. More... | |
| const std::string & | app_name () const |
| Returns the AppName workbook file property. Assumes that this workbook has an AppName property (please call has_app_name() to check). If this workbook has no AppName property, an empty string will be returned. More... | |
| void | app_name (const std::string &app_name) |
| Sets the AppName workbook file property. Creates the file version information if it does not exist yet. More... | |
| bool | has_last_edited () const |
| Returns true if this workbook has a non-empty LastEdited workbook file property. More... | |
| const std::string & | last_edited_str () const |
| Returns the LastEdited workbook file property, as a string. Assumes that this workbook has a LastEdited property (please call has_last_edited() to check). If this workbook has no LastEdited property, an empty string will be returned. More... | |
| std::size_t | last_edited () const |
| Returns the LastEdited workbook file property, parsed from a string to a size_t. Assumes that this workbook has a LastEdited property (please call has_last_edited() to check). If this workbook has no LastEdited property, an invalid_attribute exception will be thrown. If the LastEdited property cannot be parsed as a size_t, an invalid_attribute exception will be thrown. More... | |
| void | last_edited (const std::string &last_edited) |
| Sets the LastEdited workbook file property, as a string. Creates the file version information if it does not exist yet. More... | |
| void | last_edited (std::size_t last_edited) |
| Sets the LastEdited workbook file property, as a number (internally converted to a string). Creates the file version information if it does not exist yet. More... | |
| bool | has_lowest_edited () const |
| Returns true if this workbook has a non-empty LowestEdited workbook file property. More... | |
| const std::string & | lowest_edited_str () const |
| Returns the LowestEdited workbook file property, as a string. Assumes that this workbook has a LowestEdited property (please call has_lowest_edited() to check). If this workbook has no LowestEdited property, an empty string will be returned. More... | |
| std::size_t | lowest_edited () const |
| Returns the LowestEdited workbook file property, parsed from a string to size_t. Assumes that this workbook has a LowestEdited property (please call has_lowest_edited() to check). If this workbook has no LowestEdited property, an invalid_attribute exception will be thrown. If the LowestEdited property cannot be parsed as a size_t, an invalid_attribute exception will be thrown. More... | |
| void | lowest_edited (const std::string &lowest_edited) |
| Sets the LowestEdited workbook file property, as a string. Creates the file version information if it does not exist yet. More... | |
| void | lowest_edited (std::size_t lowest_edited) |
| Sets the LowestEdited workbook file property, as a number (internally converted to a string). Creates the file version information if it does not exist yet. More... | |
| bool | has_rup_build () const |
| Returns true if this workbook has a non-empty RupBuild workbook file property. More... | |
| const std::string & | rup_build_str () const |
| std::size_t | rup_build () const |
| Returns the RupBuild workbook file property, parsed from a string to size_t. Assumes that this workbook has a RupBuild property (please call has_rup_build() to check). If this workbook has no RupBuild property, an invalid_attribute exception will be thrown. If the RupBuild property cannot be parsed as a size_t, an invalid_attribute exception will be thrown. More... | |
| void | rup_build (const std::string &rup_build) |
| Sets the RupBuild workbook file property, as a string. Creates the file version information if it does not exist yet. More... | |
| void | rup_build (std::size_t rup_build) |
| Sets the RupBuild workbook file property, as a number (internally converted to a string). Creates the file version information if it does not exist yet. 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. Assumes that this workbook has a theme (please call has_theme() to check). If this workbook has no theme, an invalid_attribute exception will be thrown. More... | |
| void | theme (const class theme &value) |
| Sets the theme to value. More... | |
| xlnt::format | format (std::size_t format_index) |
| Returns a wrapper pointing to 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 a wrapper pointing to 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... | |
| std::size_t | format_count () const |
| Returns the number of formats in this workbook. More... | |
| bool | has_style (const std::string &name) const |
| Returns true if this workbook has a style with the given name. More... | |
| class style | style (const std::string &name) |
| Returns a wrapper pointing to the named style with the given name. Assumes that this workbook has a style with the given name (please call has_style() to check). If this workbook has no style with the given name, a key_not_found exception will be thrown. More... | |
| const class style | style (const std::string &name) const |
| Returns a wrapper pointing to the named style with the given name. Assumes that this workbook has a style with the given name (please call has_style() to check). If this workbook has no style with the given name, a key_not_found exception will be thrown. More... | |
| class style | create_style (const std::string &name) |
| Creates a new style and returns a wrapper pointing to it. More... | |
| class style | create_builtin_style (std::size_t builtin_id) |
| Creates a new style and returns a wrapper pointing to it. Assumes that the builtin ID exists. If the builtin ID does not exist, an invalid_parameter exception will be thrown. 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... | |
| bool | has_thumbnail () const |
| Returns true if this workbook has a thumbnail. More... | |
| const std::vector< std::uint8_t > & | thumbnail () const |
| Returns a vector of bytes representing the workbook's thumbnail. Assumes that this workbook has a thumbnail (please call has_thumbnail() to check). If the workbook has no thumbnail, an invalid_attribute exception will be thrown. 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... | |
| void | clear_calculation_properties () |
| Clears the calculation properties of this workbook. More... | |
| class calculation_properties | calculation_properties () const |
| Returns the a copy of the calculation properties used in this workbook. Assumes that this workbook has calculation properties (please call has_calculation_properties() to check). If this workbook has no calculation properties, a default-constructed calculation_properties object will be returned. More... | |
| void | calculation_properties (const class calculation_properties &props) |
| Sets the calculation properties of this workbook to props. More... | |
| bool | compare (const workbook &other, bool compare_by_reference) const |
| Returns true if this workbook is equal to other. If compare_by_reference is true, the comparison will only check that both workbook instances point to the same internal workbook. Otherwise, if compare_by_reference is false, all workbook properties except for the abs_path are compared. More... | |
| workbook & | operator= (const workbook &other)=default |
| Set the contents of this workbook to be equal to those of "other". Creates a shallow copy, copying the workbook's internal pointers. More... | |
| workbook & | operator= (workbook &&other)=default |
| Set the contents of this workbook to be equal to those of "other" by consuming (moving) the "other" instance. More... | |
| worksheet | operator[] (const std::string &name) |
| Returns a wrapper pointing to the worksheet with a title of "name". This will throw a key_not_found 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 | operator[] (std::size_t index) |
| Returns a wrapper pointing to the worksheet at "index". This method will throw an invalid_parameter exception if index is greater than or equal to the number of sheets in this workbook (call sheet_count() to check). 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 | cell |
| class | streaming_workbook_reader |
| class | worksheet |
| class | detail::xlsx_consumer |
| class | detail::xlsx_producer |
| struct | detail::worksheet_impl |
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.
|
strong |
The method for cloning workbooks.
| 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
|
default |
Move constructor. Constructs a workbook from existing workbook, other.
|
default |
Copy constructor. Constructs this workbook from existing workbook, other. Creates a shallow copy, copying the workbook's internal pointers.
|
default |
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 a wrapper pointing to 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.
| const std::string& xlnt::workbook::app_name | ( | ) | const |
Returns the AppName workbook file property. Assumes that this workbook has an AppName property (please call has_app_name() to check). If this workbook has no AppName property, an empty string will be returned.
| void xlnt::workbook::app_name | ( | const std::string & | app_name | ) |
Sets the AppName workbook file property. Creates the file version information if it does not exist yet.
| 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 a copy of the calculation properties used in this workbook. Assumes that this workbook has calculation properties (please call has_calculation_properties() to check). If this workbook has no calculation properties, a default-constructed calculation_properties object will be returned.
| 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 xlnt::invalid_parameter 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_calculation_properties | ( | ) |
Clears the calculation properties of this workbook.
| void xlnt::workbook::clear_file_version | ( | ) |
Clears the information contained by the file version (e.g. AppName, LastEdited, LowestEdited, RupBuild).
| 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).
| workbook xlnt::workbook::clone | ( | clone_method | method | ) | const |
Creates a clone of this workbook. A shallow copy will copy the workbook's internal pointers, while a deep copy will copy all the internal structures and create a full clone of the workbook.
| std::string xlnt::workbook::code_name | ( | ) | const |
Returns the code name that was set for this workbook. Assumes that the code_name exists (please call has_code_name() to check). If the code_name does not exist, an xlnt::invalid_attribute exception will be thrown.
| void xlnt::workbook::code_name | ( | const std::string & | code_name | ) |
Sets the code name of this workbook to code_name.
| bool xlnt::workbook::compare | ( | const workbook & | other, |
| bool | compare_by_reference | ||
| ) | const |
Returns true if this workbook is equal to other. If compare_by_reference is true, the comparison will only check that both workbook instances point to the same internal workbook. Otherwise, if compare_by_reference is false, all workbook properties except for the abs_path are compared.
| bool xlnt::workbook::contains | ( | const std::string & | title | ) | const |
Returns true if this workbook contains a sheet with the given title.
Creates a new sheet after the last sheet initializing it with all of the data from the provided worksheet. Returns a wrapper pointing to the copied sheet. The worksheet to be copied needs to be part of the same workbook (have the same parent) as this workbook - otherwise, an invalid_parameter exception will be thrown.
Creates a new sheet at the specified index initializing it with all of the data from the provided worksheet. Returns a wrapper pointing to the copied sheet. The worksheet to be copied needs to be part of the same workbook (have the same parent) as this workbook - otherwise, an invalid_parameter exception will be thrown.
| 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 a copy of the value of the given core property. Assumes that the specified core_property exists (please call has_core_property() to check). If the specified core_property does not exist, a null variant will be returned.
| 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 a wrapper pointing to it. Assumes that the builtin ID exists. If the builtin ID does not exist, an invalid_parameter exception will be thrown.
| xlnt::format xlnt::workbook::create_format | ( | bool | default_format = false | ) |
Creates a new format and returns a wrapper pointing to 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 named range.
| worksheet xlnt::workbook::create_sheet | ( | ) |
Creates a sheet after the last sheet in this workbook and returns a wrapper pointing to it.
| worksheet xlnt::workbook::create_sheet | ( | std::size_t | index | ) |
Creates a sheet at the specified index and returns a wrapper pointing to it.
| worksheet xlnt::workbook::create_sheet_with_rel | ( | const std::string & | title, |
| const relationship & | rel | ||
| ) |
Creates a sheet wit the specified title and relationship and returns a wrapper pointing to it. TODO: This should be private...
| class style xlnt::workbook::create_style | ( | const std::string & | name | ) |
Creates a new style and returns a wrapper pointing to 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 a copy of the value of the given custom property. Assumes that the specified custom_property exists (please call has_custom_property() to check). If the specified custom_property does not exist, a null variant will be returned.
| 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 xlnt::invalid_parameter 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 xlnt::invalid_parameter 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 a copy of the value of the given extended property. Assumes that the specified extended_property exists (please call has_extended_property() to check). If the specified extended_property does not exist, a null variant will be returned.
| 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 a wrapper pointing to 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.
| std::size_t xlnt::workbook::format_count | ( | ) | const |
Returns the number of formats in this workbook.
| bool xlnt::workbook::has_app_name | ( | ) | const |
Returns true if this workbook has a non-empty AppName workbook file property.
| 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_last_edited | ( | ) | const |
Returns true if this workbook has a non-empty LastEdited workbook file property.
| bool xlnt::workbook::has_lowest_edited | ( | ) | const |
Returns true if this workbook has a non-empty LowestEdited workbook file property.
| 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_rup_build | ( | ) | const |
Returns true if this workbook has a non-empty RupBuild workbook file property.
| bool xlnt::workbook::has_sheet_id | ( | std::size_t | id | ) | const |
Returns whether this workbook has a sheet with the specified ID. Most users won't need this.
| bool xlnt::workbook::has_style | ( | const std::string & | name | ) | const |
Returns true if this workbook has a style with the given name.
| bool xlnt::workbook::has_theme | ( | ) | const |
Returns true if this workbook has a theme defined.
| bool xlnt::workbook::has_thumbnail | ( | ) | const |
Returns true if this workbook has a thumbnail.
| 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 | ) | const |
Returns the index of the given worksheet. The worksheet must be owned by this workbook. If the worksheet is not owned by this workbook, an invalid_parameter exception will be thrown.
| 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, parsed from a string to a size_t. Assumes that this workbook has a LastEdited property (please call has_last_edited() to check). If this workbook has no LastEdited property, an invalid_attribute exception will be thrown. If the LastEdited property cannot be parsed as a size_t, an invalid_attribute exception will be thrown.
| void xlnt::workbook::last_edited | ( | const std::string & | last_edited | ) |
Sets the LastEdited workbook file property, as a string. Creates the file version information if it does not exist yet.
| void xlnt::workbook::last_edited | ( | std::size_t | last_edited | ) |
Sets the LastEdited workbook file property, as a number (internally converted to a string). Creates the file version information if it does not exist yet.
| const std::string& xlnt::workbook::last_edited_str | ( | ) | const |
Returns the LastEdited workbook file property, as a string. Assumes that this workbook has a LastEdited property (please call has_last_edited() to check). If this workbook has no LastEdited property, an empty string will be returned.
| 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. If the workbook requires a password (which is not provided), an xlnt::invalid_password will be thrown. If the file is empty/malformed, an xlnt::invalid_file exception will be thrown. If the file is valid but uses features not yet supported by XLNT which cannot be ignored/skipped, an xlnt::unsupported exception will be thrown.
| 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. If the specified password is invalid, an xlnt::invalid_password will be thrown. If the file is empty/malformed, an xlnt::invalid_file exception will be thrown. If the file is valid but uses features not yet supported by XLNT which cannot be ignored/skipped, an xlnt::unsupported exception will be thrown.
| 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. If the file does not exist at the specified path, or is empty/malformed, an xlnt::invalid_file exception will be thrown. If the file is valid but uses features not yet supported by XLNT which cannot be ignored/skipped, an xlnt::unsupported exception will be thrown. If the workbook requires a password (which is not provided), an xlnt::invalid_password will be thrown.
| 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. If the file does not exist at the specified path, or is empty/malformed, an xlnt::invalid_file exception will be thrown. If the file is valid but uses features not yet supported by XLNT which cannot be ignored/skipped, an xlnt::unsupported exception will be thrown. If the specified password is invalid, an xlnt::invalid_password will be thrown.
| 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. If the file does not exist at the specified path, or is empty/malformed, an xlnt::invalid_file exception will be thrown. If the file is valid but uses features not yet supported by XLNT which cannot be ignored/skipped, an xlnt::unsupported exception will be thrown. If the workbook requires a password (which is not provided), an xlnt::invalid_password will be thrown.
| 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. If the file does not exist at the specified path, or is empty/malformed, an xlnt::invalid_file exception will be thrown. If the file is valid but uses features not yet supported by XLNT which cannot be ignored/skipped, an xlnt::unsupported exception will be thrown. If the specified password is invalid, an xlnt::invalid_password will be thrown.
| 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. If the workbook requires a password (which is not provided), an xlnt::invalid_password will be thrown. If the file is empty/malformed, an xlnt::invalid_file exception will be thrown. If the file is valid but uses features not yet supported by XLNT which cannot be ignored/skipped, an xlnt::unsupported exception will be thrown.
| 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. If the specified password is invalid, an xlnt::invalid_password will be thrown. If the file is empty/malformed, an xlnt::invalid_file exception will be thrown. If the file is valid but uses features not yet supported by XLNT which cannot be ignored/skipped, an xlnt::unsupported exception will be thrown.
| std::size_t xlnt::workbook::lowest_edited | ( | ) | const |
Returns the LowestEdited workbook file property, parsed from a string to size_t. Assumes that this workbook has a LowestEdited property (please call has_lowest_edited() to check). If this workbook has no LowestEdited property, an invalid_attribute exception will be thrown. If the LowestEdited property cannot be parsed as a size_t, an invalid_attribute exception will be thrown.
| void xlnt::workbook::lowest_edited | ( | const std::string & | lowest_edited | ) |
Sets the LowestEdited workbook file property, as a string. Creates the file version information if it does not exist yet.
| void xlnt::workbook::lowest_edited | ( | std::size_t | lowest_edited | ) |
Sets the LowestEdited workbook file property, as a number (internally converted to a string). Creates the file version information if it does not exist yet.
| const std::string& xlnt::workbook::lowest_edited_str | ( | ) | const |
Returns the LowestEdited workbook file property, as a string. Assumes that this workbook has a LowestEdited property (please call has_lowest_edited() to check). If this workbook has no LowestEdited property, an empty string will be returned.
| 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.
| void xlnt::workbook::move_sheet | ( | worksheet | worksheet, |
| std::size_t | newIndex | ||
| ) |
Moves a sheet to a new position defined. The worksheet must be owned by this workbook. Assumes that the index is valid (please call sheet_count() to check). This method will throw an invalid_parameter exception if index is greater than or equal to the number of sheets in this workbook, or if the worksheet is not part of (not owned by) this workbook.
| class range xlnt::workbook::named_range | ( | const std::string & | name | ) |
Returns the named range with the given name. Assumes that the specified named_range exists (please call has_named_range() to check). If the specified named_range does not exist, an xlnt::key_not_found exception will be thrown.
| 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". Creates a shallow copy, copying the workbook's internal pointers.
Set the contents of this workbook to be equal to those of "other" by consuming (moving) the "other" instance.
| 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 | ) |
Returns a wrapper pointing to the worksheet with a title of "name". This will throw a key_not_found exception if the sheet isn't found. Use workbook::contains(const std::string &) to make sure the sheet exists before calling this method.
| worksheet xlnt::workbook::operator[] | ( | std::size_t | index | ) |
Returns a wrapper pointing to the worksheet at "index". This method will throw an invalid_parameter exception if index is greater than or equal to the number of sheets in this workbook (call sheet_count() to check).
| void xlnt::workbook::remove_named_range | ( | const std::string & | name | ) |
Deletes the named range with the given name. Assumes that the specified named_range exists (please call has_named_range() to check). If the specified named_range does not exist, an xlnt::key_not_found exception will be thrown.
| void xlnt::workbook::remove_sheet | ( | worksheet | worksheet | ) |
Removes the given worksheet from this workbook. The worksheet must be owned by this workbook. If the worksheet is not part of (not owned by) this workbook, an invalid_parameter exception will be thrown.
| std::size_t xlnt::workbook::rup_build | ( | ) | const |
Returns the RupBuild workbook file property, parsed from a string to size_t. Assumes that this workbook has a RupBuild property (please call has_rup_build() to check). If this workbook has no RupBuild property, an invalid_attribute exception will be thrown. If the RupBuild property cannot be parsed as a size_t, an invalid_attribute exception will be thrown.
| void xlnt::workbook::rup_build | ( | const std::string & | rup_build | ) |
Sets the RupBuild workbook file property, as a string. Creates the file version information if it does not exist yet.
| void xlnt::workbook::rup_build | ( | std::size_t | rup_build | ) |
Sets the RupBuild workbook file property, as a number (internally converted to a string). Creates the file version information if it does not exist yet.
| const std::string& xlnt::workbook::rup_build_str | ( | ) | const |
Returns the RupBuild workbook file property, as a string. Assumes that this workbook has a RupBuild property (please call has_rup_build() to check). If this workbook has no RupBuild property, an empty string will be returned.
| 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 a wrapper pointing to the worksheet with a sheetId of id. Sheet IDs are arbitrary numbers that uniquely identify a sheet. Assumes that the ID is valid (please call has_sheet_id() to check). If the ID is invalid, a key_not_found exception will be thrown. Most users won't need this.
| const worksheet xlnt::workbook::sheet_by_id | ( | std::size_t | id | ) | const |
Returns a wrapper pointing to the worksheet with a sheetId of id. Sheet IDs are arbitrary numbers that uniquely identify a sheet. Assumes that the ID is valid (please call has_sheet_id() to check). If the ID is invalid, a key_not_found exception will be thrown. Most users won't need this.
| worksheet xlnt::workbook::sheet_by_index | ( | std::size_t | index | ) |
Returns a wrapper pointing to the worksheet at the given index. Assumes that the index is valid (please call sheet_count() to check). This method will throw an invalid_parameter 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 a wrapper pointing to the worksheet at the given index. Assumes that the index is valid (please call sheet_count() to check). This method will throw an invalid_parameter 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 a wrapper pointing to the worksheet with the given name. This will throw a key_not_found 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 a wrapper pointing to the worksheet with the given name. This will throw a key_not_found 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. Assumes that the index is valid (please call sheet_count() to check). This will throw an invalid_parameter 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 a wrapper pointing to the named style with the given name. Assumes that this workbook has a style with the given name (please call has_style() to check). If this workbook has no style with the given name, a key_not_found exception will be thrown.
| const class style xlnt::workbook::style | ( | const std::string & | name | ) | const |
Returns a wrapper pointing to the named style with the given name. Assumes that this workbook has a style with the given name (please call has_style() to check). If this workbook has no style with the given name, a key_not_found exception will be thrown.
| const xlnt::theme& xlnt::workbook::theme | ( | ) | const |
Returns a const reference to this workbook's theme. Assumes that this workbook has a theme (please call has_theme() to check). If this workbook has no theme, an invalid_attribute exception will be thrown.
| 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. Assumes that this workbook has a thumbnail (please call has_thumbnail() to check). If the workbook has no thumbnail, an invalid_attribute exception will be thrown.
| std::string xlnt::workbook::title | ( | ) | const |
Returns the title of this workbook. Assumes that this workbook has a title (please call has_title() to check). If this workbook has no title, an invalid_attribute exception will be thrown.
| void xlnt::workbook::title | ( | const std::string & | title | ) |
Sets the title of this workbook to title.
| workbook_view xlnt::workbook::view | ( | ) | const |
Returns a copy of the view. Assumes that the view exists (please call has_view() to check). If the view does not exist, an xlnt::invalid_attribute exception will be thrown.
| void xlnt::workbook::view | ( | const workbook_view & | view | ) |
Sets the view to view.
1.8.13