From 5e54200b4cad1cac29a685f0441c39a9252ba8e6 Mon Sep 17 00:00:00 2001 From: Thomas Fussell Date: Sat, 31 Oct 2015 06:47:38 -0400 Subject: [PATCH] update docs --- docs/api/xlnt.rst | 183 ++++++++++++++++++++ docs/api/xlnt.s11n.rst | 38 +++++ docs/index.rst | 254 +++++++++++----------------- include/xlnt/formula/translator.hpp | 33 ++++ 4 files changed, 356 insertions(+), 152 deletions(-) create mode 100644 docs/api/xlnt.rst create mode 100644 docs/api/xlnt.s11n.rst create mode 100644 include/xlnt/formula/translator.hpp diff --git a/docs/api/xlnt.rst b/docs/api/xlnt.rst new file mode 100644 index 00000000..c862399d --- /dev/null +++ b/docs/api/xlnt.rst @@ -0,0 +1,183 @@ +xlnt library +============ + +.. doxygenstruct:: xlnt::cell_reference_hash + :members: + +.. doxygenclass:: xlnt::cell_reference + :members: + +.. doxygenclass:: xlnt::cell + :members: + +.. doxygenclass:: xlnt::comment + :members: + +.. doxygenstruct:: xlnt::date + :members: + +.. doxygenstruct:: xlnt::time + :members: + +.. doxygenstruct:: xlnt::datetime + :members: + +.. doxygenstruct:: xlnt::timedelta + :members: + +.. doxygenclass:: xlnt::relationship + :members: + +.. doxygenstruct:: xlnt::zip_info + :members: + +.. doxygenclass:: xlnt::zip_file + :members: + +.. doxygenclass:: xlnt::drawing + :members: + +.. doxygenclass:: xlnt::tokenizer + :members: + +.. doxygenclass:: xlnt::translator + :members: + +.. doxygenclass:: xlnt::alignment + :members: + +.. doxygenclass:: xlnt::border + :members: + +.. doxygenclass:: xlnt::color + :members: + +.. doxygenclass:: xlnt::fill + :members: + +.. doxygenclass:: xlnt::font + :members: + +.. doxygenclass:: xlnt::named_style + :members: + +.. doxygenclass:: xlnt::number_format + :members: + +.. doxygenclass:: xlnt::protection + :members: + +.. doxygenclass:: xlnt::side + :members: + +.. doxygenclass:: xlnt::style + :members: + +.. doxygenclass:: xlnt::document_properties + :members: + +.. doxygenclass:: xlnt::document_security + :members: + +.. doxygenclass:: xlnt::manifest + :members: + +.. doxygenclass:: xlnt::named_range + :members: + +.. doxygenclass:: xlnt::theme + :members: + +.. doxygenclass:: xlnt::workbook + :members: + +.. doxygenclass:: xlnt::cell_vector + :members: + +.. doxygenclass:: xlnt::column_properties + :members: + +.. doxygenstruct:: xlnt::major_order + :members: + +.. doxygenclass:: xlnt::page_margins + :members: + +.. doxygenstruct:: xlnt::page_setup + :members: + +.. doxygenclass:: xlnt::pane + :members: + +.. doxygenclass:: xlnt::range_reference + :members: + +.. doxygenclass:: xlnt::range + :members: + +.. doxygenclass:: xlnt::row_properties + :members: + +.. doxygenclass:: xlnt::sheet_protection + :members: + +.. doxygenclass:: xlnt::sheet_view + :members: + +.. doxygenclass:: xlnt::header + :members: + +.. doxygenclass:: xlnt::footer + :members: + +.. doxygenclass:: xlnt::header_footer + :members: + +.. doxygenstruct:: xlnt::margins + :members: + +.. doxygenclass:: xlnt::worksheet + :members: + +.. doxygenclass:: xlnt::comment_serializer + :members: + +.. doxygenclass:: xlnt::excel_serializer + :members: + +.. doxygenclass:: xlnt::manifest_serializer + :members: + +.. doxygenclass:: xlnt::relationship_serializer + :members: + +.. doxygenclass:: xlnt::shared_strings_serializer + :members: + +.. doxygenclass:: xlnt::style_serializer + :members: + +.. doxygenclass:: xlnt::theme_serializer + :members: + +.. doxygenclass:: xlnt::workbook_serializer + :members: + +.. doxygenclass:: xlnt::worksheet_serializer + :members: + +.. doxygenclass:: xlnt::xml_document + :members: + +.. doxygenclass:: xlnt::xml_node + :members: + +.. doxygenclass:: xlnt::xml_serializer + :members: + +library modules +=============== + +.. toctree:: + + xlnt.s11n diff --git a/docs/api/xlnt.s11n.rst b/docs/api/xlnt.s11n.rst new file mode 100644 index 00000000..4197cf5e --- /dev/null +++ b/docs/api/xlnt.s11n.rst @@ -0,0 +1,38 @@ +serialization module +==================== + +.. doxygenclass:: xlnt::comment_serializer + :members: + +.. doxygenclass:: xlnt::excel_serializer + :members: + +.. doxygenclass:: xlnt::manifest_serializer + :members: + +.. doxygenclass:: xlnt::relationship_serializer + :members: + +.. doxygenclass:: xlnt::shared_strings_serializer + :members: + +.. doxygenclass:: xlnt::style_serializer + :members: + +.. doxygenclass:: xlnt::theme_serializer + :members: + +.. doxygenclass:: xlnt::workbook_serializer + :members: + +.. doxygenclass:: xlnt::worksheet_serializer + :members: + +.. doxygenclass:: xlnt::xml_document + :members: + +.. doxygenclass:: xlnt::xml_node + :members: + +.. doxygenclass:: xlnt::xml_serializer + :members: diff --git a/docs/index.rst b/docs/index.rst index 3a5220b2..5c4c6ffe 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,189 +1,131 @@ -.. xlnt documentation master file, created by - sphinx-quickstart on Mon Oct 26 10:31:07 2015. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. +:mod:`xlnt` - user-friendly xlsx library for C++14 +=========================================================================== -Welcome to xlnt's documentation! -================================ +.. module:: xlnt +.. moduleauthor:: Thomas Fussell -Contents: +:Author: Thomas Fussell +:Source code: https://github.com/tfussell/xlnt +:Issues: https://github.com/tfussell/xlnt/issues +:Generated: |today| +:License: MIT +:Version: |release| + +Introduction +------------ + +xlnt is a C++14 library for reading, writing, and modifying xlsx files as described in ECMA 376. + +The API is generally based on openpyxl, a python library for reading and writing xlsx/xlsm files. + +This is still very much a work in progress, but the core development work is complete. + +Support ++++++++ + +Sample code: +++++++++++++ + +.. literalinclude:: /samples/sample1.cpp + +User List +--------- + + + +How to Contribute Code +---------------------- + +For further information see :ref:`development` + +.. note: + + +Other ways to help +------------------ + +Installation +------------ + +Getting the source +------------------ + +Usage examples +-------------- + +Tutorial +++++++++ .. toctree:: - :maxdepth: 2 -.. doxygenstruct:: xlnt::cell_reference_hash - :members: + tutorial -.. doxygenclass:: xlnt::cell_reference - :members: +Cookbook +++++++++ -.. doxygenclass:: xlnt::cell - :members: +.. toctree:: -.. doxygenclass:: xlnt::comment - :members: + cookbook -.. doxygenstruct:: xlnt::date - :members: +Charts +++++++ -.. doxygenstruct:: xlnt::time - :members: +.. toctree:: -.. doxygenstruct:: xlnt::datetime - :members: + charts/introduction -.. doxygenstruct:: xlnt::timedelta - :members: +Comments +++++++++ -.. doxygenclass:: xlnt::relationship - :members: +.. toctree:: -.. doxygenstruct:: xlnt::zip_info - :members: + comments -.. doxygenclass:: xlnt::zip_file - :members: +Working with styles ++++++++++++++++++++ -.. doxygenclass:: xlnt::drawing - :members: +.. toctree:: -.. doxygenclass:: xlnt::tokenizer - :members: + styles -.. doxygenclass:: xlnt::translator - :members: +Conditional Formatting +++++++++++++++++++++++ -.. doxygenclass:: xlnt::alignment - :members: +.. toctree:: -.. doxygenclass:: xlnt::border - :members: + formatting -.. doxygenclass:: xlnt::color - :members: +Data Validation ++++++++++++++++ -.. doxygenclass:: xlnt::fill - :members: +.. toctree:: -.. doxygenclass:: xlnt::font - :members: + validation -.. doxygenclass:: xlnt::named_style - :members: +Parsing Formulas +++++++++++++++++ -.. doxygenclass:: xlnt::number_format - :members: +.. toctree:: -.. doxygenclass:: xlnt::protection - :members: + formula -.. doxygenclass:: xlnt::side - :members: -.. doxygenclass:: xlnt::style - :members: +Information for Developers +-------------------------- -.. doxygenclass:: xlnt::document_properties - :members: +.. toctree:: -.. doxygenclass:: xlnt::document_security - :members: + development + windows-development -.. doxygenclass:: xlnt::manifest - :members: +API Documentation +------------------ -.. doxygenclass:: xlnt::named_range - :members: +.. toctree:: + :maxdepth: 2 -.. doxygenclass:: xlnt::theme - :members: + api/xlnt -.. doxygenclass:: xlnt::workbook - :members: - -.. doxygenclass:: xlnt::cell_vector - :members: - -.. doxygenclass:: xlnt::column_properties - :members: - -.. doxygenstruct:: xlnt::major_order - :members: - -.. doxygenclass:: xlnt::page_margins - :members: - -.. doxygenstruct:: xlnt::page_setup - :members: - -.. doxygenclass:: xlnt::pane - :members: - -.. doxygenclass:: xlnt::range_reference - :members: - -.. doxygenclass:: xlnt::range - :members: - -.. doxygenclass:: xlnt::row_properties - :members: - -.. doxygenclass:: xlnt::sheet_protection - :members: - -.. doxygenclass:: xlnt::sheet_view - :members: - -.. doxygenclass:: xlnt::header - :members: - -.. doxygenclass:: xlnt::footer - :members: - -.. doxygenclass:: xlnt::header_footer - :members: - -.. doxygenstruct:: xlnt::margins - :members: - -.. doxygenclass:: xlnt::worksheet - :members: - -.. doxygenclass:: xlnt::comment_serializer - :members: - -.. doxygenclass:: xlnt::excel_serializer - :members: - -.. doxygenclass:: xlnt::manifest_serializer - :members: - -.. doxygenclass:: xlnt::relationship_serializer - :members: - -.. doxygenclass:: xlnt::shared_strings_serializer - :members: - -.. doxygenclass:: xlnt::style_serializer - :members: - -.. doxygenclass:: xlnt::theme_serializer - :members: - -.. doxygenclass:: xlnt::workbook_serializer - :members: - -.. doxygenclass:: xlnt::worksheet_serializer - :members: - -.. doxygenclass:: xlnt::xml_document - :members: - -.. doxygenclass:: xlnt::xml_node - :members: - -.. doxygenclass:: xlnt::xml_serializer - :members: Indices and tables ================== @@ -192,3 +134,11 @@ Indices and tables * :ref:`modindex` * :ref:`search` + +Release Notes +============= + +.. toctree:: + :maxdepth: 1 + + changes diff --git a/include/xlnt/formula/translator.hpp b/include/xlnt/formula/translator.hpp new file mode 100644 index 00000000..78e40614 --- /dev/null +++ b/include/xlnt/formula/translator.hpp @@ -0,0 +1,33 @@ +#include +#include + +namespace xlnt { + +class cell_reference; +class tokenizer; + +class translator +{ + translator(const std::string &formula, const cell_reference &ref); + + std::vector get_tokens(); + + static std::string translate_row(const std::string &row_str, int row_delta); + static std::string translate_col(const std::string &col_str, col_delta); + + std::pair strip_ws_name(const std::string &range_str); + + void translate_range(const range_reference &range_ref); + void translate_formula(const cell_reference &dest); + +private: + const std::string ROW_RANGE_RE; + const std::string COL_RANGE_RE; + const std::string CELL_REF_RE; + + std::string formula_; + cell_reference reference_; + tokenizer tokenizer_; +}; + +} // namespace xlnt