crawlserv++
[under development]
Application for crawling and analyzing textual content of websites.
|
Namespace for importing and exporting OpenDocument spreadsheets. More...
Typedefs | |
using | StringString = std::pair< std::string, std::string > |
A pair of strings. More... | |
using | TableRow = std::vector< std::string > |
A vector of strings used as rows in a spreadsheet table. More... | |
using | Table = std::vector< TableRow > |
A vector of vectors of strings used as spreadsheet tables. More... | |
using | NamedTable = std::pair< std::string, Table > |
A pair containing the name and the content of a spreadsheet table. More... | |
Variables | |
constexpr auto | cellSpacing {5} |
The number of spaces before a OpenDocument XML cell element. More... | |
constexpr auto | cellLines {3} |
The number of lines used for a OpenDocument XML cell element and its content. More... | |
constexpr auto | cellConstChars {57} |
The number of additional characters for a OpenDocument XML cell element and its content. More... | |
Import and Export | |
std::string | exportSpreadsheet (const std::vector< NamedTable > &tables, bool firstRowBold) |
Exports tables as a OpenDocument spreadsheet. More... | |
Helper | |
std::string | cell (std::uint8_t spacing, const std::string &raw, const std::string &style) |
Creates the XML code for a simple cell containing a value. More... | |
Namespace for importing and exporting OpenDocument spreadsheets.
using crawlservpp::Data::ImportExport::OpenDocument::NamedTable = typedef std::pair<std::string, Table> |
A pair containing the name and the content of a spreadsheet table.
using crawlservpp::Data::ImportExport::OpenDocument::StringString = typedef std::pair<std::string, std::string> |
A pair of strings.
using crawlservpp::Data::ImportExport::OpenDocument::Table = typedef std::vector<TableRow> |
A vector of vectors of strings used as spreadsheet tables.
using crawlservpp::Data::ImportExport::OpenDocument::TableRow = typedef std::vector<std::string> |
A vector of strings used as rows in a spreadsheet table.
|
inline |
Creates the XML code for a simple cell containing a value.
If the given raw data is numeric, the cell will contain a float.
If the given raw data is a string, the special characters &'><"
will be escaped.
Newlines will be added at the end of elements for formatting purposes, and Sub-elements will be nested with one additional space.
spacing | The number of spaces to add before the cell. |
raw | The raw data contained in the cell. |
style | An optional style argument present in the cell, in the format table:style-name=" ...". |
References cellConstChars, cellLines, crawlservpp::Helper::Strings::isDec(), and crawlservpp::Helper::Strings::replaceAll().
Referenced by exportSpreadsheet().
|
inline |
Exports tables as a OpenDocument spreadsheet.
tables | Constant reference to a vector containing the tables, each consisting of a pair of its name and a vector of rows, each consisting of a vector of strings representing the values in the row. |
firstRowBold | Specifies whether the first row in the tables should be formatted bold (to indicate column headings). |
References cell(), cellSpacing, and crawlservpp::Data::Compression::Zip::compress().
Referenced by crawlservpp::Main::Server::tick().
|
inline |
The number of additional characters for a OpenDocument XML cell element and its content.
Referenced by cell().
|
inline |
The number of lines used for a OpenDocument XML cell element and its content.
Referenced by cell().
|
inline |
The number of spaces before a OpenDocument XML cell element.
Referenced by exportSpreadsheet().