mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
add placeholder api comments for #28
This commit is contained in:
parent
846ea8e0d6
commit
340a4b3195
|
@ -21,15 +21,16 @@
|
||||||
//
|
//
|
||||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||||
// @author: see AUTHORS file
|
// @author: see AUTHORS file
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
#include <xlnt/xlnt_config.hpp> // for XLNT_API, XLNT_API
|
#include <xlnt/xlnt_config.hpp>
|
||||||
#include <xlnt/cell/cell_type.hpp> // for cell_type
|
#include <xlnt/cell/cell_type.hpp>
|
||||||
#include <xlnt/cell/index_types.hpp> // for column_t, row_t
|
#include <xlnt/cell/index_types.hpp>
|
||||||
|
|
||||||
namespace xlnt {
|
namespace xlnt {
|
||||||
|
|
||||||
|
@ -60,6 +61,7 @@ namespace detail {
|
||||||
|
|
||||||
class xlsx_consumer;
|
class xlsx_consumer;
|
||||||
class xlsx_producer;
|
class xlsx_producer;
|
||||||
|
|
||||||
struct cell_impl;
|
struct cell_impl;
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
@ -76,6 +78,9 @@ struct cell_impl;
|
||||||
class XLNT_API cell
|
class XLNT_API cell
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
/// Alias xlnt::cell_type to xlnt::cell::type since it looks nicer.
|
||||||
|
/// </summary>
|
||||||
using type = cell_type;
|
using type = cell_type;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -83,6 +88,9 @@ public:
|
||||||
/// </summary>
|
/// </summary>
|
||||||
static const std::unordered_map<std::string, int> &error_codes();
|
static const std::unordered_map<std::string, int> &error_codes();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default copy constructor.
|
||||||
|
/// </summary>
|
||||||
cell(const cell &) = default;
|
cell(const cell &) = default;
|
||||||
|
|
||||||
// value
|
// value
|
||||||
|
@ -506,6 +514,9 @@ private:
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class format modifiable_format();
|
class format modifiable_format();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete default zero-argument constructor.
|
||||||
|
/// </summary>
|
||||||
cell() = delete;
|
cell() = delete;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -91,7 +91,7 @@ public:
|
||||||
/// </summary>
|
/// </summary>
|
||||||
cell_reference(column_t column, row_t row);
|
cell_reference(column_t column, row_t row);
|
||||||
|
|
||||||
// absoluateness
|
// absoluteness
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Convert a coordinate to an absolute coordinate string (e.g. B12 -> $B$12)
|
/// Convert a coordinate to an absolute coordinate string (e.g. B12 -> $B$12)
|
||||||
|
|
|
@ -65,22 +65,49 @@ public:
|
||||||
/// </summary>
|
/// </summary>
|
||||||
std::string author() const;
|
std::string author() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Make this comment only visible when the associated cell is hovered.
|
||||||
|
/// </summary>
|
||||||
void hide();
|
void hide();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Make this comment always visible.
|
||||||
|
/// </summary>
|
||||||
void show();
|
void show();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns true if this comment is not hidden.
|
||||||
|
/// </summary>
|
||||||
bool visible() const;
|
bool visible() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set the absolute position of this cell to the given coordinates.
|
||||||
|
/// </summary>
|
||||||
void position(int left, int top);
|
void position(int left, int top);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the distance from the left side of the sheet to the left side of the comment.
|
||||||
|
/// </summary>
|
||||||
int left() const;
|
int left() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the distance from the top of the sheet to the top of the comment.
|
||||||
|
/// </summary>
|
||||||
int top() const;
|
int top() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set the size of the comment.
|
||||||
|
/// </summary>
|
||||||
void size(int width, int height);
|
void size(int width, int height);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the width of this comment.
|
||||||
|
/// </summary>
|
||||||
int width() const;
|
int width() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the height of this comment.
|
||||||
|
/// </summary>
|
||||||
int height() const;
|
int height() const;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -89,16 +116,44 @@ public:
|
||||||
friend XLNT_API bool operator==(const comment &left, const comment &right);
|
friend XLNT_API bool operator==(const comment &left, const comment &right);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
/// The formatted textual content in this cell displayed directly after the author.
|
||||||
|
/// </summary>
|
||||||
formatted_text text_;
|
formatted_text text_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The name of the person that created this comment.
|
||||||
|
/// </summary>
|
||||||
std::string author_;
|
std::string author_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// True if this comment is not hidden.
|
||||||
|
/// </summary>
|
||||||
bool visible_ = false;
|
bool visible_ = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The fill color
|
||||||
|
/// </summary>
|
||||||
std::string fill_;
|
std::string fill_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Distance from the left side of the sheet.
|
||||||
|
/// </summary>
|
||||||
int left_ = 0;
|
int left_ = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Distance from the top of the sheet.
|
||||||
|
/// </summary>
|
||||||
int top_ = 0;
|
int top_ = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Width of the comment box.
|
||||||
|
/// </summary>
|
||||||
int width_ = 0;
|
int width_ = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Height of the comment box.
|
||||||
|
/// </summary>
|
||||||
int height_ = 0;
|
int height_ = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -30,21 +30,53 @@
|
||||||
|
|
||||||
namespace xlnt {
|
namespace xlnt {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Encapsulates zero or more formatted text runs where a text run
|
||||||
|
/// is a string of text with the same defined formatting.
|
||||||
|
/// </summary>
|
||||||
class XLNT_API formatted_text
|
class XLNT_API formatted_text
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
/// Remove all text runs from this text.
|
||||||
|
/// </summary>
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clear any runs in this text and add a single run with default formatting and
|
||||||
|
/// the given string as its textual content.
|
||||||
|
/// </summary>
|
||||||
void plain_text(const std::string &s);
|
void plain_text(const std::string &s);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Combine the textual content of each text run in order and return the result.
|
||||||
|
/// </summary>
|
||||||
std::string plain_text() const;
|
std::string plain_text() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a copy of the individual runs that comprise this text.
|
||||||
|
/// </summary>
|
||||||
std::vector<text_run> runs() const;
|
std::vector<text_run> runs() const;
|
||||||
void runs(const std::vector<text_run> &new_runs);
|
|
||||||
void add_run(const text_run &t);
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set the runs of this text all at once.
|
||||||
|
/// </summary>
|
||||||
|
void runs(const std::vector<text_run> &new_runs);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Add a new run to the end of the set of runs.
|
||||||
|
/// </summary>
|
||||||
|
void add_run(const text_run &t);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns true if the runs that make up this text are identical to those in rhs.
|
||||||
|
/// </summary>
|
||||||
bool operator==(const formatted_text &rhs) const;
|
bool operator==(const formatted_text &rhs) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::vector<text_run> runs_;
|
std::vector<text_run> runs_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -30,49 +30,163 @@
|
||||||
|
|
||||||
namespace xlnt {
|
namespace xlnt {
|
||||||
|
|
||||||
|
//todo: should this just be a struct?
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A formatted string
|
||||||
|
/// </summary>
|
||||||
class XLNT_API text_run
|
class XLNT_API text_run
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
text_run();
|
text_run();
|
||||||
text_run(const std::string &string);
|
|
||||||
|
|
||||||
bool has_formatting() const;
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
text_run(const std::string &string);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
bool has_formatting() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string get_string() const;
|
std::string get_string() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_string(const std::string &string);
|
void set_string(const std::string &string);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_size() const;
|
bool has_size() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t get_size() const;
|
std::size_t get_size() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_size(std::size_t size);
|
void set_size(std::size_t size);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_color() const;
|
bool has_color() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
color get_color() const;
|
color get_color() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_color(const color &new_color);
|
void set_color(const color &new_color);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_font() const;
|
bool has_font() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string get_font() const;
|
std::string get_font() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_font(const std::string &font);
|
void set_font(const std::string &font);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_family() const;
|
bool has_family() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t get_family() const;
|
std::size_t get_family() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_family(std::size_t family);
|
void set_family(std::size_t family);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_scheme() const;
|
bool has_scheme() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string get_scheme() const;
|
std::string get_scheme() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_scheme(const std::string &scheme);
|
void set_scheme(const std::string &scheme);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool bold_set() const;
|
bool bold_set() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool is_bold() const;
|
bool is_bold() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_bold(bool bold);
|
void set_bold(bool bold);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string string_;
|
std::string string_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<std::size_t> size_;
|
optional<std::size_t> size_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<color> color_;
|
optional<color> color_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<std::string> font_;
|
optional<std::string> font_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<std::size_t> family_;
|
optional<std::size_t> family_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<std::string> scheme_;
|
optional<std::string> scheme_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<bool> bold_;
|
optional<bool> bold_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -169,12 +169,24 @@ public:
|
||||||
void unregister_override_type(const path &part);
|
void unregister_override_type(const path &part);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string next_relationship_id(const path &part) const;
|
std::string next_relationship_id(const path &part) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::unordered_map<std::string, std::string> default_content_types_;
|
std::unordered_map<std::string, std::string> default_content_types_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::unordered_map<path, std::string> override_content_types_;
|
std::unordered_map<path, std::string> override_content_types_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::unordered_map<path, std::unordered_map<std::string, relationship>> relationships_;
|
std::unordered_map<path, std::unordered_map<std::string, relationship>> relationships_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -102,8 +102,14 @@ class XLNT_API relationship
|
||||||
public:
|
public:
|
||||||
using type = relationship_type;
|
using type = relationship_type;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
relationship();
|
relationship();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
relationship(const std::string &id, type t, const uri &source, const uri &target, target_mode mode);
|
relationship(const std::string &id, type t, const uri &source, const uri &target, target_mode mode);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -142,10 +148,29 @@ public:
|
||||||
bool operator!=(const relationship &rhs) const;
|
bool operator!=(const relationship &rhs) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string id_;
|
std::string id_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
type type_;
|
type type_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
uri source_;
|
uri source_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
uri target_;
|
uri target_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
target_mode mode_;
|
target_mode mode_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -35,49 +35,190 @@ namespace xlnt {
|
||||||
class XLNT_API uri
|
class XLNT_API uri
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
uri();
|
uri();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
uri(const uri &base, const uri &relative);
|
uri(const uri &base, const uri &relative);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
uri(const uri &base, const path &relative);
|
uri(const uri &base, const path &relative);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
uri(const std::string &uri_string);
|
uri(const std::string &uri_string);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool is_relative() const;
|
bool is_relative() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool is_absolute() const;
|
bool is_absolute() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string get_scheme() const;
|
std::string get_scheme() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string get_authority() const;
|
std::string get_authority() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_authentication() const;
|
bool has_authentication() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string get_authentication() const;
|
std::string get_authentication() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string get_username() const;
|
std::string get_username() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string get_password() const;
|
std::string get_password() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string get_host() const;
|
std::string get_host() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_port() const;
|
bool has_port() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t get_port() const;
|
std::size_t get_port() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
path get_path() const;
|
path get_path() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_query() const;
|
bool has_query() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string get_query() const;
|
std::string get_query() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_fragment() const;
|
bool has_fragment() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string get_fragment() const;
|
std::string get_fragment() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string to_string() const;
|
std::string to_string() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
uri make_absolute(const uri &base);
|
uri make_absolute(const uri &base);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
uri make_reference(const uri &base);
|
uri make_reference(const uri &base);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
friend XLNT_API bool operator==(const uri &left, const uri &right);
|
friend XLNT_API bool operator==(const uri &left, const uri &right);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool absolute_;
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
bool absolute_ = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string scheme_;
|
std::string scheme_;
|
||||||
bool has_authentication_;
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
bool has_authentication_ = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string username_;
|
std::string username_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string password_;
|
std::string password_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string host_;
|
std::string host_;
|
||||||
bool has_port_;
|
|
||||||
std::size_t port_;
|
/// <summary>
|
||||||
bool has_query_;
|
///
|
||||||
|
/// </summary>
|
||||||
|
bool has_port_ = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
std::size_t port_ = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
bool has_query_ = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string query_;
|
std::string query_;
|
||||||
bool has_fragment_;
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
bool has_fragment_ = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string fragment_;
|
std::string fragment_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
path path_;
|
path path_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <xlnt/xlnt_config.hpp>
|
#include <xlnt/xlnt_config.hpp>
|
||||||
#include <xlnt/utils/hash_combine.hpp>
|
|
||||||
#include <xlnt/styles/horizontal_alignment.hpp>
|
#include <xlnt/styles/horizontal_alignment.hpp>
|
||||||
#include <xlnt/styles/vertical_alignment.hpp>
|
#include <xlnt/styles/vertical_alignment.hpp>
|
||||||
#include <xlnt/utils/optional.hpp>
|
#include <xlnt/utils/optional.hpp>
|
||||||
|
@ -37,28 +36,64 @@ namespace xlnt {
|
||||||
class XLNT_API alignment
|
class XLNT_API alignment
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<bool> shrink() const;
|
optional<bool> shrink() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
alignment &shrink(bool shrink_to_fit);
|
alignment &shrink(bool shrink_to_fit);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<bool> wrap() const;
|
optional<bool> wrap() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
alignment &wrap(bool wrap_text);
|
alignment &wrap(bool wrap_text);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<int> indent() const;
|
optional<int> indent() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
alignment &indent(int indent_size);
|
alignment &indent(int indent_size);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<int> rotation() const;
|
optional<int> rotation() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
alignment &rotation(int text_rotation);
|
alignment &rotation(int text_rotation);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<horizontal_alignment> horizontal() const;
|
optional<horizontal_alignment> horizontal() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
alignment &horizontal(horizontal_alignment horizontal);
|
alignment &horizontal(horizontal_alignment horizontal);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<vertical_alignment> vertical() const;
|
optional<vertical_alignment> vertical() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
alignment &vertical(vertical_alignment vertical);
|
alignment &vertical(vertical_alignment vertical);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -32,11 +32,13 @@
|
||||||
#include <xlnt/styles/border_style.hpp>
|
#include <xlnt/styles/border_style.hpp>
|
||||||
#include <xlnt/styles/color.hpp>
|
#include <xlnt/styles/color.hpp>
|
||||||
#include <xlnt/styles/diagonal_direction.hpp>
|
#include <xlnt/styles/diagonal_direction.hpp>
|
||||||
#include <xlnt/styles/side.hpp>
|
|
||||||
#include <xlnt/utils/optional.hpp>
|
#include <xlnt/utils/optional.hpp>
|
||||||
|
|
||||||
namespace xlnt {
|
namespace xlnt {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
enum class XLNT_API border_side
|
enum class XLNT_API border_side
|
||||||
{
|
{
|
||||||
start,
|
start,
|
||||||
|
@ -58,13 +60,30 @@ namespace xlnt {
|
||||||
class XLNT_API border
|
class XLNT_API border
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
class XLNT_API border_property
|
class XLNT_API border_property
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<class color> color() const;
|
optional<class color> color() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
border_property &color(const xlnt::color &c);
|
border_property &color(const xlnt::color &c);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<border_style> style() const;
|
optional<border_style> style() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
border_property &style(border_style style);
|
border_property &style(border_style style);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -78,40 +97,98 @@ public:
|
||||||
friend bool operator!=(const border_property &left, const border_property &right) { return !(left == right); }
|
friend bool operator!=(const border_property &left, const border_property &right) { return !(left == right); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<class color> color_;
|
optional<class color> color_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<border_style> style_;
|
optional<border_style> style_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const std::vector<border_side> &all_sides();
|
static const std::vector<border_side> &all_sides();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
border();
|
border();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<border_property> side(border_side s) const;
|
optional<border_property> side(border_side s) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
border &side(border_side s, const border_property &prop);
|
border &side(border_side s, const border_property &prop);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<diagonal_direction> diagonal() const;
|
optional<diagonal_direction> diagonal() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
border &diagonal(diagonal_direction dir);
|
border &diagonal(diagonal_direction dir);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true if left is exactly equal to right.
|
/// Returns true if left is exactly equal to right.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
XLNT_API friend bool operator==(const border &left, const border &right);
|
XLNT_API friend bool operator==(const border &left, const border &right);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true if left is not exactly equal to right.
|
/// Returns true if left is not exactly equal to right.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
XLNT_API friend bool operator!=(const border &left, const border &right) { return !(left == right); }
|
XLNT_API friend bool operator!=(const border &left, const border &right) { return !(left == right); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<border_property> start_;
|
optional<border_property> start_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<border_property> end_;
|
optional<border_property> end_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<border_property> top_;
|
optional<border_property> top_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<border_property> bottom_;
|
optional<border_property> bottom_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<border_property> vertical_;
|
optional<border_property> vertical_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<border_property> horizontal_;
|
optional<border_property> horizontal_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<border_property> diagonal_;
|
optional<border_property> diagonal_;
|
||||||
|
|
||||||
//bool outline_ = true;
|
//bool outline_ = true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<diagonal_direction> diagonal_direction_;
|
optional<diagonal_direction> diagonal_direction_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,9 @@
|
||||||
|
|
||||||
namespace xlnt {
|
namespace xlnt {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
enum class XLNT_API border_style
|
enum class XLNT_API border_style
|
||||||
{
|
{
|
||||||
none,
|
none,
|
||||||
|
|
|
@ -30,6 +30,9 @@
|
||||||
|
|
||||||
namespace xlnt {
|
namespace xlnt {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
class XLNT_API indexed_color
|
class XLNT_API indexed_color
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -43,6 +46,9 @@ private:
|
||||||
std::size_t index_;
|
std::size_t index_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
class XLNT_API theme_color
|
class XLNT_API theme_color
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -56,6 +62,9 @@ private:
|
||||||
std::size_t index_;
|
std::size_t index_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
class XLNT_API rgb_color
|
class XLNT_API rgb_color
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -100,48 +109,155 @@ public:
|
||||||
auto_
|
auto_
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const color black();
|
static const color black();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const color white();
|
static const color white();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const color red();
|
static const color red();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const color darkred();
|
static const color darkred();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const color blue();
|
static const color blue();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const color darkblue();
|
static const color darkblue();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const color green();
|
static const color green();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const color darkgreen();
|
static const color darkgreen();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const color yellow();
|
static const color yellow();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const color darkyellow();
|
static const color darkyellow();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
color();
|
color();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
color(const rgb_color &rgb);
|
color(const rgb_color &rgb);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
color(const indexed_color &indexed);
|
color(const indexed_color &indexed);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
color(const theme_color &theme);
|
color(const theme_color &theme);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
type get_type() const;
|
type get_type() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool is_auto() const;
|
bool is_auto() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_auto(bool value);
|
void set_auto(bool value);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const rgb_color &get_rgb() const;
|
const rgb_color &get_rgb() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const indexed_color &get_indexed() const;
|
const indexed_color &get_indexed() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const theme_color &get_theme() const;
|
const theme_color &get_theme() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
double get_tint() const;
|
double get_tint() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_tint(double tint);
|
void set_tint(double tint);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator==(const color &other) const;
|
bool operator==(const color &other) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator!=(const color &other) const { return !(*this == other); }
|
bool operator!=(const color &other) const { return !(*this == other); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void assert_type(type t) const;
|
void assert_type(type t) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
type type_;
|
type type_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
rgb_color rgb_;
|
rgb_color rgb_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
indexed_color indexed_;
|
indexed_color indexed_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
theme_color theme_;
|
theme_color theme_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
double tint_;
|
double tint_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,9 @@
|
||||||
|
|
||||||
namespace xlnt {
|
namespace xlnt {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
enum class XLNT_API pattern_fill_type
|
enum class XLNT_API pattern_fill_type
|
||||||
{
|
{
|
||||||
none,
|
none,
|
||||||
|
@ -54,21 +57,45 @@ enum class XLNT_API pattern_fill_type
|
||||||
gray0625
|
gray0625
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
class XLNT_API pattern_fill
|
class XLNT_API pattern_fill
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
pattern_fill();
|
pattern_fill();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
pattern_fill_type type() const;
|
pattern_fill_type type() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
pattern_fill &type(pattern_fill_type new_type);
|
pattern_fill &type(pattern_fill_type new_type);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<color> foreground() const;
|
optional<color> foreground() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
pattern_fill &foreground(const color &foreground);
|
pattern_fill &foreground(const color &foreground);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<color> background() const;
|
optional<color> background() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
pattern_fill &background(const color &background);
|
pattern_fill &background(const color &background);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -82,64 +109,129 @@ public:
|
||||||
XLNT_API friend bool operator!=(const pattern_fill &left, const pattern_fill &right) { return !(left == right); }
|
XLNT_API friend bool operator!=(const pattern_fill &left, const pattern_fill &right) { return !(left == right); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
pattern_fill_type type_ = pattern_fill_type::none;
|
pattern_fill_type type_ = pattern_fill_type::none;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<color> foreground_;
|
optional<color> foreground_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<color> background_;
|
optional<color> background_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
enum class XLNT_API gradient_fill_type
|
enum class XLNT_API gradient_fill_type
|
||||||
{
|
{
|
||||||
linear,
|
linear,
|
||||||
path
|
path
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
class XLNT_API gradient_fill
|
class XLNT_API gradient_fill
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
gradient_fill();
|
gradient_fill();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
gradient_fill_type type() const;
|
gradient_fill_type type() const;
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
gradient_fill &type(gradient_fill_type new_type);
|
gradient_fill &type(gradient_fill_type new_type);
|
||||||
|
|
||||||
// Degree
|
// Degree
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
gradient_fill °ree(double degree);
|
gradient_fill °ree(double degree);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
double degree() const;
|
double degree() const;
|
||||||
|
|
||||||
// Left
|
// Left
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
double left() const;
|
double left() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
gradient_fill &left(double value);
|
gradient_fill &left(double value);
|
||||||
|
|
||||||
// Right
|
// Right
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
double right() const;
|
double right() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
gradient_fill &right(double value);
|
gradient_fill &right(double value);
|
||||||
|
|
||||||
// Top
|
// Top
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
double top() const;
|
double top() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
gradient_fill &top(double value);
|
gradient_fill &top(double value);
|
||||||
|
|
||||||
// Bottom
|
// Bottom
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
double bottom() const;
|
double bottom() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
gradient_fill &bottom(double value);
|
gradient_fill &bottom(double value);
|
||||||
|
|
||||||
// Stops
|
// Stops
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
gradient_fill &add_stop(double position, color stop_color);
|
gradient_fill &add_stop(double position, color stop_color);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
gradient_fill &clear_stops();
|
gradient_fill &clear_stops();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::unordered_map<double, color> stops() const;
|
std::unordered_map<double, color> stops() const;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -153,18 +245,45 @@ public:
|
||||||
XLNT_API friend bool operator!=(const gradient_fill &left, const gradient_fill &right) { return !(left == right); }
|
XLNT_API friend bool operator!=(const gradient_fill &left, const gradient_fill &right) { return !(left == right); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
gradient_fill_type type_ = gradient_fill_type::linear;
|
gradient_fill_type type_ = gradient_fill_type::linear;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
double degree_ = 0;
|
double degree_ = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
double left_ = 0;
|
double left_ = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
double right_ = 0;
|
double right_ = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
double top_ = 0;
|
double top_ = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
double bottom_ = 0;
|
double bottom_ = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::unordered_map<double, color> stops_;
|
std::unordered_map<double, color> stops_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
enum class XLNT_API fill_type
|
enum class XLNT_API fill_type
|
||||||
{
|
{
|
||||||
pattern,
|
pattern,
|
||||||
|
@ -229,8 +348,19 @@ public:
|
||||||
XLNT_API friend bool operator!=(const fill &left, const fill &right) { return !(left == right); }
|
XLNT_API friend bool operator!=(const fill &left, const fill &right) { return !(left == right); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
fill_type type_ = fill_type::pattern;
|
fill_type type_ = fill_type::pattern;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
xlnt::gradient_fill gradient_;
|
xlnt::gradient_fill gradient_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
xlnt::pattern_fill pattern_;
|
xlnt::pattern_fill pattern_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,9 @@ class style;
|
||||||
class XLNT_API font
|
class XLNT_API font
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
enum class underline_style
|
enum class underline_style
|
||||||
{
|
{
|
||||||
none,
|
none,
|
||||||
|
@ -47,49 +50,115 @@ public:
|
||||||
single,
|
single,
|
||||||
single_accounting
|
single_accounting
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
font();
|
font();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
font &bold(bool bold);
|
font &bold(bool bold);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool bold() const;
|
bool bold() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
font &superscript(bool superscript);
|
font &superscript(bool superscript);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool superscript() const;
|
bool superscript() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
font &italic(bool italic);
|
font &italic(bool italic);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool italic() const;
|
bool italic() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
font &strikethrough(bool strikethrough);
|
font &strikethrough(bool strikethrough);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool strikethrough() const;
|
bool strikethrough() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
font &underline(underline_style new_underline);
|
font &underline(underline_style new_underline);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool underlined() const;
|
bool underlined() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
underline_style underline() const;
|
underline_style underline() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
font &size(std::size_t size);
|
font &size(std::size_t size);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t size() const;
|
std::size_t size() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
font &name(const std::string &name);
|
font &name(const std::string &name);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string name() const;
|
std::string name() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
font &color(const color &c);
|
font &color(const color &c);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<xlnt::color> color() const;
|
optional<xlnt::color> color() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
font &family(std::size_t family);
|
font &family(std::size_t family);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<std::size_t> family() const;
|
optional<std::size_t> family() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
font &scheme(const std::string &scheme);
|
font &scheme(const std::string &scheme);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<std::string> scheme() const;
|
optional<std::string> scheme() const;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -105,16 +174,59 @@ public:
|
||||||
private:
|
private:
|
||||||
friend class style;
|
friend class style;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string name_ = "Calibri";
|
std::string name_ = "Calibri";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t size_ = 12;
|
std::size_t size_ = 12;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool bold_ = false;
|
bool bold_ = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool italic_ = false;
|
bool italic_ = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool superscript_ = false;
|
bool superscript_ = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool subscript_ = false;
|
bool subscript_ = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool strikethrough_ = false;
|
bool strikethrough_ = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
underline_style underline_ = underline_style::none;
|
underline_style underline_ = underline_style::none;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<xlnt::color> color_;
|
optional<xlnt::color> color_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<std::size_t> family_;
|
optional<std::size_t> family_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<std::string> scheme_;
|
optional<std::string> scheme_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -38,8 +38,10 @@ class number_format;
|
||||||
class protection;
|
class protection;
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
struct format_impl;
|
struct format_impl;
|
||||||
struct stylesheet;
|
struct stylesheet;
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -48,48 +50,182 @@ struct stylesheet;
|
||||||
class XLNT_API format
|
class XLNT_API format
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t id() const;
|
std::size_t id() const;
|
||||||
|
|
||||||
|
// Alignment
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
class alignment &alignment();
|
class alignment &alignment();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const class alignment &alignment() const;
|
const class alignment &alignment() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
format alignment(const xlnt::alignment &new_alignment, bool applied);
|
format alignment(const xlnt::alignment &new_alignment, bool applied);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool alignment_applied() const;
|
bool alignment_applied() const;
|
||||||
|
|
||||||
|
// Border
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
class border &border();
|
class border &border();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const class border &border() const;
|
const class border &border() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
format border(const xlnt::border &new_border, bool applied);
|
format border(const xlnt::border &new_border, bool applied);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool border_applied() const;
|
bool border_applied() const;
|
||||||
|
|
||||||
|
// Fill
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
class fill &fill();
|
class fill &fill();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const class fill &fill() const;
|
const class fill &fill() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
format fill(const xlnt::fill &new_fill, bool applied);
|
format fill(const xlnt::fill &new_fill, bool applied);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool fill_applied() const;
|
bool fill_applied() const;
|
||||||
|
|
||||||
|
// Font
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
class font &font();
|
class font &font();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const class font &font() const;
|
const class font &font() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
format font(const xlnt::font &new_font, bool applied);
|
format font(const xlnt::font &new_font, bool applied);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool font_applied() const;
|
bool font_applied() const;
|
||||||
|
|
||||||
|
// Number Format
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
class number_format &number_format();
|
class number_format &number_format();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const class number_format &number_format() const;
|
const class number_format &number_format() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
format number_format(const xlnt::number_format &new_number_format, bool applied);
|
format number_format(const xlnt::number_format &new_number_format, bool applied);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool number_format_applied() const;
|
bool number_format_applied() const;
|
||||||
|
|
||||||
|
// Protection
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
class protection &protection();
|
class protection &protection();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const class protection &protection() const;
|
const class protection &protection() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
format protection(const xlnt::protection &new_protection, bool applied);
|
format protection(const xlnt::protection &new_protection, bool applied);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool protection_applied() const;
|
bool protection_applied() const;
|
||||||
|
|
||||||
|
// Style
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_style() const;
|
bool has_style() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void clear_style();
|
void clear_style();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
format style(const std::string &name);
|
format style(const std::string &name);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
format style(const xlnt::style &new_style);
|
format style(const xlnt::style &new_style);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const class style style() const;
|
const class style style() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend struct detail::stylesheet;
|
friend struct detail::stylesheet;
|
||||||
friend class cell;
|
friend class cell;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
format(detail::format_impl *d);
|
format(detail::format_impl *d);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
detail::format_impl *d_;
|
detail::format_impl *d_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -38,56 +38,206 @@ enum class calendar;
|
||||||
class XLNT_API number_format
|
class XLNT_API number_format
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const number_format general();
|
static const number_format general();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const number_format text();
|
static const number_format text();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const number_format number();
|
static const number_format number();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const number_format number_00();
|
static const number_format number_00();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const number_format number_comma_separated1();
|
static const number_format number_comma_separated1();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const number_format percentage();
|
static const number_format percentage();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const number_format percentage_00();
|
static const number_format percentage_00();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const number_format date_yyyymmdd2();
|
static const number_format date_yyyymmdd2();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const number_format date_yymmdd();
|
static const number_format date_yymmdd();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const number_format date_ddmmyyyy();
|
static const number_format date_ddmmyyyy();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const number_format date_dmyslash();
|
static const number_format date_dmyslash();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const number_format date_dmyminus();
|
static const number_format date_dmyminus();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const number_format date_dmminus();
|
static const number_format date_dmminus();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const number_format date_myminus();
|
static const number_format date_myminus();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const number_format date_xlsx14();
|
static const number_format date_xlsx14();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const number_format date_xlsx15();
|
static const number_format date_xlsx15();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const number_format date_xlsx16();
|
static const number_format date_xlsx16();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const number_format date_xlsx17();
|
static const number_format date_xlsx17();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const number_format date_xlsx22();
|
static const number_format date_xlsx22();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const number_format date_datetime();
|
static const number_format date_datetime();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const number_format date_time1();
|
static const number_format date_time1();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const number_format date_time2();
|
static const number_format date_time2();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const number_format date_time3();
|
static const number_format date_time3();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const number_format date_time4();
|
static const number_format date_time4();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const number_format date_time5();
|
static const number_format date_time5();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static const number_format date_time6();
|
static const number_format date_time6();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static number_format from_builtin_id(std::size_t builtin_id);
|
static number_format from_builtin_id(std::size_t builtin_id);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
number_format();
|
number_format();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
number_format(std::size_t builtin_id);
|
number_format(std::size_t builtin_id);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
number_format(const std::string &code);
|
number_format(const std::string &code);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
number_format(const std::string &code, std::size_t custom_id);
|
number_format(const std::string &code, std::size_t custom_id);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_format_string(const std::string &format_code);
|
void set_format_string(const std::string &format_code);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_format_string(const std::string &format_code, std::size_t custom_id);
|
void set_format_string(const std::string &format_code, std::size_t custom_id);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string get_format_string() const;
|
std::string get_format_string() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_id() const;
|
bool has_id() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_id(std::size_t id);
|
void set_id(std::size_t id);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t get_id() const;
|
std::size_t get_id() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string format(const std::string &text) const;
|
std::string format(const std::string &text) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string format(long double number, calendar base_date) const;
|
std::string format(long double number, calendar base_date) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool is_date_format() const;
|
bool is_date_format() const;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true if left is exactly equal to right.
|
/// Returns true if left is exactly equal to right.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -99,8 +249,19 @@ public:
|
||||||
XLNT_API friend bool operator!=(const number_format &left, const number_format &right) { return !(left == right); }
|
XLNT_API friend bool operator!=(const number_format &left, const number_format &right) { return !(left == right); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool id_set_;
|
bool id_set_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t id_;
|
std::size_t id_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string format_string_;
|
std::string format_string_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -36,17 +36,49 @@ namespace xlnt {
|
||||||
class XLNT_API protection
|
class XLNT_API protection
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static protection unlocked_and_visible();
|
static protection unlocked_and_visible();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static protection locked_and_visible();
|
static protection locked_and_visible();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static protection unlocked_and_hidden();
|
static protection unlocked_and_hidden();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static protection locked_and_hidden();
|
static protection locked_and_hidden();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
protection();
|
protection();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool locked() const;
|
bool locked() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
protection &locked(bool locked);
|
protection &locked(bool locked);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool hidden() const;
|
bool hidden() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
protection &hidden(bool hidden);
|
protection &hidden(bool hidden);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -60,7 +92,14 @@ public:
|
||||||
XLNT_API friend bool operator!=(const protection &left, const protection &right) { return !(left == right); }
|
XLNT_API friend bool operator!=(const protection &left, const protection &right) { return !(left == right); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool locked_;
|
bool locked_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool hidden_;
|
bool hidden_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -39,8 +39,10 @@ class number_format;
|
||||||
class protection;
|
class protection;
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
struct style_impl;
|
struct style_impl;
|
||||||
struct stylesheet;
|
struct stylesheet;
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -50,56 +52,194 @@ struct stylesheet;
|
||||||
class XLNT_API style
|
class XLNT_API style
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
/// Delete zero-argument constructor
|
||||||
|
/// </summary>
|
||||||
style() = delete;
|
style() = delete;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default copy constructor
|
||||||
|
/// </summary>
|
||||||
style(const style &other) = default;
|
style(const style &other) = default;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Return the name of this style.
|
||||||
|
/// </summary>
|
||||||
std::string name() const;
|
std::string name() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
style name(const std::string &name);
|
style name(const std::string &name);
|
||||||
|
|
||||||
class alignment &alignment();
|
/// <summary>
|
||||||
const class alignment &alignment() const;
|
///
|
||||||
style alignment(const xlnt::alignment &new_alignment, bool applied = true);
|
/// </summary>
|
||||||
bool alignment_applied() const;
|
|
||||||
|
|
||||||
class border &border();
|
|
||||||
const class border &border() const;
|
|
||||||
style border(const xlnt::border &new_border, bool applied = true);
|
|
||||||
bool border_applied() const;
|
|
||||||
|
|
||||||
class fill &fill();
|
|
||||||
const class fill &fill() const;
|
|
||||||
style fill(const xlnt::fill &new_fill, bool applied = true);
|
|
||||||
bool fill_applied() const;
|
|
||||||
|
|
||||||
class font &font();
|
|
||||||
const class font &font() const;
|
|
||||||
style font(const xlnt::font &new_font, bool applied = true);
|
|
||||||
bool font_applied() const;
|
|
||||||
|
|
||||||
class number_format &number_format();
|
|
||||||
const class number_format &number_format() const;
|
|
||||||
style number_format(const xlnt::number_format &new_number_format, bool applied = true);
|
|
||||||
bool number_format_applied() const;
|
|
||||||
|
|
||||||
class protection &protection();
|
|
||||||
const class protection &protection() const;
|
|
||||||
style protection(const xlnt::protection &new_protection, bool applied = true);
|
|
||||||
bool protection_applied() const;
|
|
||||||
|
|
||||||
bool hidden() const;
|
bool hidden() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
style hidden(bool value);
|
style hidden(bool value);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<bool> custom() const;
|
optional<bool> custom() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
style custom(bool value);
|
style custom(bool value);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional<std::size_t> builtin_id() const;
|
optional<std::size_t> builtin_id() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
style builtin_id(std::size_t builtin_id);
|
style builtin_id(std::size_t builtin_id);
|
||||||
|
|
||||||
|
// Formatting components
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
class alignment &alignment();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
const class alignment &alignment() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
style alignment(const xlnt::alignment &new_alignment, bool applied = true);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
bool alignment_applied() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
class border &border();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
const class border &border() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
style border(const xlnt::border &new_border, bool applied = true);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
bool border_applied() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
class fill &fill();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
const class fill &fill() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
style fill(const xlnt::fill &new_fill, bool applied = true);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
bool fill_applied() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
class font &font();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
const class font &font() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
style font(const xlnt::font &new_font, bool applied = true);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
bool font_applied() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
class number_format &number_format();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
const class number_format &number_format() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
style number_format(const xlnt::number_format &new_number_format, bool applied = true);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
bool number_format_applied() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
class protection &protection();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
const class protection &protection() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
style protection(const xlnt::protection &new_protection, bool applied = true);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
bool protection_applied() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator==(const style &other) const;
|
bool operator==(const style &other) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend struct detail::stylesheet;
|
friend struct detail::stylesheet;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
style(detail::style_impl *d);
|
style(detail::style_impl *d);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
detail::style_impl *d_;
|
detail::style_impl *d_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,9 @@ struct XLNT_API date
|
||||||
/// </summary>
|
/// </summary>
|
||||||
static date from_number(int days_since_base_year, calendar base_date);
|
static date from_number(int days_since_base_year, calendar base_date);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
date(int year_, int month_, int day_);
|
date(int year_, int month_, int day_);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -54,15 +57,29 @@ struct XLNT_API date
|
||||||
/// </summary>
|
/// </summary>
|
||||||
int to_number(calendar base_date) const;
|
int to_number(calendar base_date) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
int weekday() const;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Return true if this date is equal to comparand.
|
/// Return true if this date is equal to comparand.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool operator==(const date &comparand) const;
|
bool operator==(const date &comparand) const;
|
||||||
|
|
||||||
int weekday() const;
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
int year;
|
int year;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
int month;
|
int month;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
int day;
|
int day;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -55,21 +55,69 @@ struct XLNT_API datetime
|
||||||
/// </summary>
|
/// </summary>
|
||||||
static datetime from_number(long double number, calendar base_date);
|
static datetime from_number(long double number, calendar base_date);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
datetime(const date &d, const time &t);
|
datetime(const date &d, const time &t);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
datetime(int year_, int month_, int day_, int hour_ = 0, int minute_ = 0, int second_ = 0, int microsecond_ = 0);
|
datetime(int year_, int month_, int day_, int hour_ = 0, int minute_ = 0, int second_ = 0, int microsecond_ = 0);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string to_string() const;
|
std::string to_string() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
long double to_number(calendar base_date) const;
|
long double to_number(calendar base_date) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator==(const datetime &comparand) const;
|
bool operator==(const datetime &comparand) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
int weekday() const;
|
int weekday() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
int year;
|
int year;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
int month;
|
int month;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
int day;
|
int day;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
int hour;
|
int hour;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
int minute;
|
int minute;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
int second;
|
int second;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
int microsecond;
|
int microsecond;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -37,13 +37,30 @@ namespace xlnt {
|
||||||
class XLNT_API exception : public std::runtime_error
|
class XLNT_API exception : public std::runtime_error
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
exception(const std::string &message);
|
exception(const std::string &message);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
exception(const exception &) = default;
|
exception(const exception &) = default;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
virtual ~exception();
|
virtual ~exception();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_message(const std::string &message);
|
void set_message(const std::string &message);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string message_;
|
std::string message_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -53,8 +70,19 @@ private:
|
||||||
class XLNT_API invalid_parameter : public exception
|
class XLNT_API invalid_parameter : public exception
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
invalid_parameter();
|
invalid_parameter();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
invalid_parameter(const invalid_parameter &) = default;
|
invalid_parameter(const invalid_parameter &) = default;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
virtual ~invalid_parameter();
|
virtual ~invalid_parameter();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -64,8 +92,19 @@ public:
|
||||||
class XLNT_API invalid_sheet_title : public exception
|
class XLNT_API invalid_sheet_title : public exception
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
invalid_sheet_title(const std::string &title);
|
invalid_sheet_title(const std::string &title);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
invalid_sheet_title(const invalid_sheet_title &) = default;
|
invalid_sheet_title(const invalid_sheet_title &) = default;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
virtual ~invalid_sheet_title();
|
virtual ~invalid_sheet_title();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -75,7 +114,14 @@ public:
|
||||||
class XLNT_API missing_number_format : public exception
|
class XLNT_API missing_number_format : public exception
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
missing_number_format();
|
missing_number_format();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
virtual ~missing_number_format();
|
virtual ~missing_number_format();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -85,8 +131,19 @@ public:
|
||||||
class XLNT_API invalid_file : public exception
|
class XLNT_API invalid_file : public exception
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
invalid_file(const std::string &filename);
|
invalid_file(const std::string &filename);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
invalid_file(const invalid_file &) = default;
|
invalid_file(const invalid_file &) = default;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
virtual ~invalid_file();
|
virtual ~invalid_file();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -97,8 +154,19 @@ public:
|
||||||
class XLNT_API illegal_character : public exception
|
class XLNT_API illegal_character : public exception
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
illegal_character(char c);
|
illegal_character(char c);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
illegal_character(const illegal_character &) = default;
|
illegal_character(const illegal_character &) = default;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
virtual ~illegal_character();
|
virtual ~illegal_character();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -108,8 +176,19 @@ public:
|
||||||
class XLNT_API invalid_data_type : public exception
|
class XLNT_API invalid_data_type : public exception
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
invalid_data_type();
|
invalid_data_type();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
invalid_data_type(const invalid_data_type &) = default;
|
invalid_data_type(const invalid_data_type &) = default;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
virtual ~invalid_data_type();
|
virtual ~invalid_data_type();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -119,9 +198,20 @@ public:
|
||||||
class XLNT_API invalid_column_string_index : public exception
|
class XLNT_API invalid_column_string_index : public exception
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
invalid_column_string_index();
|
invalid_column_string_index();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
invalid_column_string_index(const invalid_column_string_index &) = default;
|
invalid_column_string_index(const invalid_column_string_index &) = default;
|
||||||
~invalid_column_string_index();
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
virtual ~invalid_column_string_index();
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -130,10 +220,25 @@ public:
|
||||||
class XLNT_API invalid_cell_reference : public exception
|
class XLNT_API invalid_cell_reference : public exception
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
invalid_cell_reference(column_t column, row_t row);
|
invalid_cell_reference(column_t column, row_t row);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
invalid_cell_reference(const std::string &reference_string);
|
invalid_cell_reference(const std::string &reference_string);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
invalid_cell_reference(const invalid_cell_reference &) = default;
|
invalid_cell_reference(const invalid_cell_reference &) = default;
|
||||||
~invalid_cell_reference();
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
virtual ~invalid_cell_reference();
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -142,8 +247,19 @@ public:
|
||||||
class XLNT_API invalid_attribute : public exception
|
class XLNT_API invalid_attribute : public exception
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
invalid_attribute();
|
invalid_attribute();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
invalid_attribute(const invalid_attribute &) = default;
|
invalid_attribute(const invalid_attribute &) = default;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
virtual ~invalid_attribute();
|
virtual ~invalid_attribute();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -153,8 +269,19 @@ public:
|
||||||
class XLNT_API key_not_found : public exception
|
class XLNT_API key_not_found : public exception
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
key_not_found();
|
key_not_found();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
key_not_found(const key_not_found &) = default;
|
key_not_found(const key_not_found &) = default;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
virtual ~key_not_found();
|
virtual ~key_not_found();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -164,8 +291,19 @@ public:
|
||||||
class XLNT_API no_visible_worksheets : public exception
|
class XLNT_API no_visible_worksheets : public exception
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
no_visible_worksheets();
|
no_visible_worksheets();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
no_visible_worksheets(const no_visible_worksheets &) = default;
|
no_visible_worksheets(const no_visible_worksheets &) = default;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
virtual ~no_visible_worksheets();
|
virtual ~no_visible_worksheets();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -175,7 +313,14 @@ public:
|
||||||
class XLNT_API unhandled_switch_case : public exception
|
class XLNT_API unhandled_switch_case : public exception
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
unhandled_switch_case();
|
unhandled_switch_case();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
virtual ~unhandled_switch_case();
|
virtual ~unhandled_switch_case();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -185,8 +330,19 @@ public:
|
||||||
class XLNT_API unsupported : public exception
|
class XLNT_API unsupported : public exception
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
unsupported(const std::string &message);
|
unsupported(const std::string &message);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
unsupported(const unsupported &) = default;
|
unsupported(const unsupported &) = default;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
virtual ~unsupported();
|
virtual ~unsupported();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,48 +0,0 @@
|
||||||
// Copyright 2005-2014 Daniel James.
|
|
||||||
// Boost Software License - Version 1.0 - August 17th, 2003
|
|
||||||
//
|
|
||||||
// Permission is hereby granted, free of charge, to any person or organization
|
|
||||||
// obtaining a copy of the software and accompanying documentation covered by
|
|
||||||
// this license (the "Software") to use, reproduce, display, distribute,
|
|
||||||
// execute, and transmit the Software, and to prepare derivative works of the
|
|
||||||
// Software, and to permit third-parties to whom the Software is furnished to
|
|
||||||
// do so, all subject to the following:
|
|
||||||
//
|
|
||||||
// The copyright notices in the Software and this entire statement, including
|
|
||||||
// the above license grant, this restriction and the following disclaimer,
|
|
||||||
// must be included in all copies of the Software, in whole or in part, and
|
|
||||||
// all derivative works of the Software, unless such copies or derivative
|
|
||||||
// works are solely in the form of machine-executable object code generated by
|
|
||||||
// a source language processor.
|
|
||||||
//
|
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
|
||||||
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
|
||||||
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
|
||||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
||||||
// DEALINGS IN THE SOFTWARE.
|
|
||||||
//
|
|
||||||
// Based on Peter Dimov's proposal
|
|
||||||
// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf
|
|
||||||
// issue 6.18.
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <functional>
|
|
||||||
|
|
||||||
#include <xlnt/xlnt_config.hpp>
|
|
||||||
|
|
||||||
namespace xlnt {
|
|
||||||
|
|
||||||
// TODO: Can this be in source->detail, or must it be in a header?
|
|
||||||
/// <summary>
|
|
||||||
/// Return a value by combining the hashed value of v (using std::hash) with seed.
|
|
||||||
/// </summary>
|
|
||||||
template <class T>
|
|
||||||
inline void XLNT_API hash_combine(std::size_t &seed, const T &v)
|
|
||||||
{
|
|
||||||
std::hash<T> hasher;
|
|
||||||
seed ^= hasher(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace xlnt
|
|
|
@ -5,54 +5,89 @@
|
||||||
|
|
||||||
namespace xlnt {
|
namespace xlnt {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Many settings in xlnt are allowed to not have a value set. This class
|
||||||
|
/// encapsulates a value which may or may not be set. Memory is allocated
|
||||||
|
/// within the optional class.
|
||||||
|
/// </summary>
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class XLNT_API optional
|
class XLNT_API optional
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional() : has_value_(false), value_(T())
|
optional() : has_value_(false), value_(T())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
optional(const T &value) : has_value_(true), value_(value)
|
optional(const T &value) : has_value_(true), value_(value)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
operator bool() const
|
operator bool() const
|
||||||
{
|
{
|
||||||
return is_set();
|
return is_set();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool is_set() const
|
bool is_set() const
|
||||||
{
|
{
|
||||||
return has_value_;
|
return has_value_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set(const T &value)
|
void set(const T &value)
|
||||||
{
|
{
|
||||||
has_value_ = true;
|
has_value_ = true;
|
||||||
value_ = value;
|
value_ = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
T &operator*()
|
T &operator*()
|
||||||
{
|
{
|
||||||
return get();
|
return get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const T &operator*() const
|
const T &operator*() const
|
||||||
{
|
{
|
||||||
return get();
|
return get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
T *operator->()
|
T *operator->()
|
||||||
{
|
{
|
||||||
return &get();
|
return &get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const T *operator->() const
|
const T *operator->() const
|
||||||
{
|
{
|
||||||
return &get();
|
return &get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
T &get()
|
T &get()
|
||||||
{
|
{
|
||||||
if (!has_value_)
|
if (!has_value_)
|
||||||
|
@ -63,6 +98,9 @@ public:
|
||||||
return value_;
|
return value_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const T &get() const
|
const T &get() const
|
||||||
{
|
{
|
||||||
if (!has_value_)
|
if (!has_value_)
|
||||||
|
@ -73,12 +111,18 @@ public:
|
||||||
return value_;
|
return value_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void clear()
|
void clear()
|
||||||
{
|
{
|
||||||
has_value_ = false;
|
has_value_ = false;
|
||||||
value_ = T();
|
value_ = T();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator==(const optional<T> &other) const
|
bool operator==(const optional<T> &other) const
|
||||||
{
|
{
|
||||||
return has_value_ == other.has_value_
|
return has_value_ == other.has_value_
|
||||||
|
@ -87,7 +131,14 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_value_;
|
bool has_value_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
T value_;
|
T value_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,10 @@ public:
|
||||||
/// Append the provided part to this path and return the result.
|
/// Append the provided part to this path and return the result.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
path append(const path &to_append) const;
|
path append(const path &to_append) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns true if left path is equal to right path.
|
||||||
|
/// </summary>
|
||||||
friend XLNT_API bool operator==(const path &left, const path &right);
|
friend XLNT_API bool operator==(const path &left, const path &right);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -47,15 +47,44 @@ struct XLNT_API time
|
||||||
/// </summary>
|
/// </summary>
|
||||||
static time from_number(long double number);
|
static time from_number(long double number);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
explicit time(int hour_ = 0, int minute_ = 0, int second_ = 0, int microsecond_ = 0);
|
explicit time(int hour_ = 0, int minute_ = 0, int second_ = 0, int microsecond_ = 0);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
explicit time(const std::string &time_string);
|
explicit time(const std::string &time_string);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
long double to_number() const;
|
long double to_number() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator==(const time &comparand) const;
|
bool operator==(const time &comparand) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
int hour;
|
int hour;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
int minute;
|
int minute;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
int second;
|
int second;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
int microsecond;
|
int microsecond;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -34,18 +34,49 @@ namespace xlnt {
|
||||||
/// </summary>
|
/// </summary>
|
||||||
struct XLNT_API timedelta
|
struct XLNT_API timedelta
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static timedelta from_number(long double number);
|
static timedelta from_number(long double number);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
timedelta();
|
timedelta();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
timedelta(int days_, int hours_, int minutes_, int seconds_, int microseconds_);
|
timedelta(int days_, int hours_, int minutes_, int seconds_, int microseconds_);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
long double to_number() const;
|
long double to_number() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
int days;
|
int days;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
int hours;
|
int hours;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
int minutes;
|
int minutes;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
int seconds;
|
int seconds;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
int microseconds;
|
int microseconds;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -20,12 +20,11 @@
|
||||||
//
|
//
|
||||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||||
// @author: see AUTHORS file
|
// @author: see AUTHORS file
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <xlnt/xlnt_config.hpp> // for XLNT_API
|
|
||||||
|
|
||||||
#include <xlnt/xlnt_config.hpp>
|
#include <xlnt/xlnt_config.hpp>
|
||||||
|
|
||||||
namespace xlnt {
|
namespace xlnt {
|
||||||
|
@ -33,14 +32,35 @@ namespace xlnt {
|
||||||
class XLNT_API utf8string
|
class XLNT_API utf8string
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static utf8string from_utf8(const std::string &s);
|
static utf8string from_utf8(const std::string &s);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static utf8string from_latin1(const std::string &s);
|
static utf8string from_latin1(const std::string &s);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static utf8string from_utf16(const std::vector<std::uint16_t> &s);
|
static utf8string from_utf16(const std::vector<std::uint16_t> &s);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static utf8string from_utf32(const std::vector<std::uint32_t> &s);
|
static utf8string from_utf32(const std::vector<std::uint32_t> &s);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool is_valid() const;
|
bool is_valid() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::vector<std::uint8_t> bytes_;
|
std::vector<std::uint8_t> bytes_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
//
|
//
|
||||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||||
// @author: see AUTHORS file
|
// @author: see AUTHORS file
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
@ -33,23 +34,64 @@ namespace xlnt {
|
||||||
class workbook;
|
class workbook;
|
||||||
class worksheet;
|
class worksheet;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
class XLNT_API const_worksheet_iterator : public std::iterator<std::bidirectional_iterator_tag, const worksheet, std::ptrdiff_t, const worksheet*, const worksheet>
|
class XLNT_API const_worksheet_iterator : public std::iterator<std::bidirectional_iterator_tag, const worksheet, std::ptrdiff_t, const worksheet*, const worksheet>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_worksheet_iterator(const workbook &wb, std::size_t index);
|
const_worksheet_iterator(const workbook &wb, std::size_t index);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_worksheet_iterator(const const_worksheet_iterator &);
|
const_worksheet_iterator(const const_worksheet_iterator &);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_worksheet_iterator &operator=(const const_worksheet_iterator &);
|
const_worksheet_iterator &operator=(const const_worksheet_iterator &);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const worksheet operator*();
|
const worksheet operator*();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator==(const const_worksheet_iterator &comparand) const;
|
bool operator==(const const_worksheet_iterator &comparand) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator!=(const const_worksheet_iterator &comparand) const
|
bool operator!=(const const_worksheet_iterator &comparand) const
|
||||||
{
|
{
|
||||||
return !(*this == comparand);
|
return !(*this == comparand);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_worksheet_iterator operator++(int);
|
const_worksheet_iterator operator++(int);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_worksheet_iterator &operator++();
|
const_worksheet_iterator &operator++();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const workbook &wb_;
|
const workbook &wb_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t index_;
|
std::size_t index_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -35,13 +35,34 @@ namespace xlnt {
|
||||||
class XLNT_API document_security
|
class XLNT_API document_security
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
document_security();
|
document_security();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool lock_revision;
|
bool lock_revision;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool lock_structure;
|
bool lock_structure;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool lock_windows;
|
bool lock_windows;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string revision_password;
|
std::string revision_password;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string workbook_password;
|
std::string workbook_password;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -43,19 +43,50 @@ std::vector<std::pair<std::string, std::string>> XLNT_API split_named_range(cons
|
||||||
class XLNT_API named_range
|
class XLNT_API named_range
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
using target = std::pair<worksheet, range_reference>;
|
using target = std::pair<worksheet, range_reference>;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
named_range();
|
named_range();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
named_range(const named_range &other);
|
named_range(const named_range &other);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
named_range(const std::string &name, const std::vector<target> &targets);
|
named_range(const std::string &name, const std::vector<target> &targets);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string get_name() const;
|
std::string get_name() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const std::vector<target> &get_targets() const;
|
const std::vector<target> &get_targets() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
named_range &operator=(const named_range &other);
|
named_range &operator=(const named_range &other);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string name_;
|
std::string name_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::vector<target> targets_;
|
std::vector<target> targets_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,9 @@
|
||||||
|
|
||||||
namespace xlnt {
|
namespace xlnt {
|
||||||
|
|
||||||
|
enum class calendar;
|
||||||
|
enum class relationship_type;
|
||||||
|
|
||||||
class alignment;
|
class alignment;
|
||||||
class border;
|
class border;
|
||||||
class cell;
|
class cell;
|
||||||
|
@ -65,14 +68,13 @@ class zip_file;
|
||||||
|
|
||||||
struct datetime;
|
struct datetime;
|
||||||
|
|
||||||
enum class calendar;
|
|
||||||
enum class relationship_type;
|
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
struct stylesheet;
|
struct stylesheet;
|
||||||
struct workbook_impl;
|
struct workbook_impl;
|
||||||
class xlsx_consumer;
|
class xlsx_consumer;
|
||||||
class xlsx_producer;
|
class xlsx_producer;
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -81,9 +83,24 @@ class xlsx_producer;
|
||||||
class XLNT_API workbook
|
class XLNT_API workbook
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
using iterator = worksheet_iterator;
|
using iterator = worksheet_iterator;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
using const_iterator = const_worksheet_iterator;
|
using const_iterator = const_worksheet_iterator;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
using reverse_iterator = std::reverse_iterator<iterator>;
|
using reverse_iterator = std::reverse_iterator<iterator>;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
|
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -91,12 +108,24 @@ public:
|
||||||
/// </summary>
|
/// </summary>
|
||||||
friend void swap(workbook &left, workbook &right);
|
friend void swap(workbook &left, workbook &right);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static workbook minimal();
|
static workbook minimal();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static workbook empty_excel();
|
static workbook empty_excel();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static workbook empty_libre_office();
|
static workbook empty_libre_office();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static workbook empty_numbers();
|
static workbook empty_numbers();
|
||||||
|
|
||||||
// constructors
|
// constructors
|
||||||
|
@ -305,151 +334,485 @@ public:
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void set_application(const std::string &application);
|
void set_application(const std::string &application);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
calendar get_base_date() const;
|
calendar get_base_date() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_base_date(calendar base_date);
|
void set_base_date(calendar base_date);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string get_creator() const;
|
std::string get_creator() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_creator(const std::string &creator);
|
void set_creator(const std::string &creator);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string get_last_modified_by() const;
|
std::string get_last_modified_by() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_last_modified_by(const std::string &last_modified_by);
|
void set_last_modified_by(const std::string &last_modified_by);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
datetime get_created() const;
|
datetime get_created() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_created(const datetime &when);
|
void set_created(const datetime &when);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
datetime get_modified() const;
|
datetime get_modified() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_modified(const datetime &when);
|
void set_modified(const datetime &when);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
int get_doc_security() const;
|
int get_doc_security() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_doc_security(int doc_security);
|
void set_doc_security(int doc_security);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool get_scale_crop() const;
|
bool get_scale_crop() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_scale_crop(bool scale_crop);
|
void set_scale_crop(bool scale_crop);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string get_company() const;
|
std::string get_company() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_company(const std::string &company);
|
void set_company(const std::string &company);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool links_up_to_date() const;
|
bool links_up_to_date() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_links_up_to_date(bool links_up_to_date);
|
void set_links_up_to_date(bool links_up_to_date);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool is_shared_doc() const;
|
bool is_shared_doc() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_shared_doc(bool shared_doc);
|
void set_shared_doc(bool shared_doc);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool hyperlinks_changed() const;
|
bool hyperlinks_changed() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_hyperlinks_changed(bool hyperlinks_changed);
|
void set_hyperlinks_changed(bool hyperlinks_changed);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string get_app_version() const;
|
std::string get_app_version() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_app_version(const std::string &version);
|
void set_app_version(const std::string &version);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string get_title() const;
|
std::string get_title() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_title(const std::string &title);
|
void set_title(const std::string &title);
|
||||||
|
|
||||||
// named ranges
|
// named ranges
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::vector<named_range> get_named_ranges() const;
|
std::vector<named_range> get_named_ranges() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void create_named_range(const std::string &name, worksheet worksheet, const range_reference &reference);
|
void create_named_range(const std::string &name, worksheet worksheet, const range_reference &reference);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void create_named_range(const std::string &name, worksheet worksheet, const std::string &reference_string);
|
void create_named_range(const std::string &name, worksheet worksheet, const std::string &reference_string);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_named_range(const std::string &name) const;
|
bool has_named_range(const std::string &name) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range get_named_range(const std::string &name);
|
range get_named_range(const std::string &name);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void remove_named_range(const std::string &name);
|
void remove_named_range(const std::string &name);
|
||||||
|
|
||||||
// serialization
|
// serialization
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void save(std::vector<std::uint8_t> &data) const;
|
void save(std::vector<std::uint8_t> &data) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void save(const std::string &filename) const;
|
void save(const std::string &filename) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void save(const xlnt::path &filename) const;
|
void save(const xlnt::path &filename) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void save(std::ostream &stream) const;
|
void save(std::ostream &stream) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void save(const std::string &filename, const std::string &password);
|
void save(const std::string &filename, const std::string &password);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void save(const xlnt::path &filename, const std::string &password);
|
void save(const xlnt::path &filename, const std::string &password);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void save(std::ostream &stream, const std::string &password);
|
void save(std::ostream &stream, const std::string &password);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void save(const std::vector<std::uint8_t> &data, const std::string &password);
|
void save(const std::vector<std::uint8_t> &data, const std::string &password);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void load(const std::vector<std::uint8_t> &data);
|
void load(const std::vector<std::uint8_t> &data);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void load(const std::string &filename);
|
void load(const std::string &filename);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void load(const xlnt::path &filename);
|
void load(const xlnt::path &filename);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void load(std::istream &stream);
|
void load(std::istream &stream);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void load(const std::string &filename, const std::string &password);
|
void load(const std::string &filename, const std::string &password);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void load(const xlnt::path &filename, const std::string &password);
|
void load(const xlnt::path &filename, const std::string &password);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void load(std::istream &stream, const std::string &password);
|
void load(std::istream &stream, const std::string &password);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void load(const std::vector<std::uint8_t> &data, const std::string &password);
|
void load(const std::vector<std::uint8_t> &data, const std::string &password);
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void save(const std::wstring &filename);
|
void save(const std::wstring &filename);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void save(const std::wstring &filename, const std::string &password);
|
void save(const std::wstring &filename, const std::string &password);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void load(const std::wstring &filename);
|
void load(const std::wstring &filename);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void load(const std::wstring &filename, const std::string &password);
|
void load(const std::wstring &filename, const std::string &password);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_view() const;
|
bool has_view() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
workbook_view get_view() const;
|
workbook_view get_view() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_view(const workbook_view &view);
|
void set_view(const workbook_view &view);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_code_name() const;
|
bool has_code_name() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string get_code_name() const;
|
std::string get_code_name() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_code_name(const std::string &code_name);
|
void set_code_name(const std::string &code_name);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool x15_enabled() const;
|
bool x15_enabled() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void enable_x15();
|
void enable_x15();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void disable_x15();
|
void disable_x15();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_absolute_path() const;
|
bool has_absolute_path() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
path get_absolute_path() const;
|
path get_absolute_path() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_absolute_path(const path &absolute_path);
|
void set_absolute_path(const path &absolute_path);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void clear_absolute_path();
|
void clear_absolute_path();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_properties() const;
|
bool has_properties() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_file_version() const;
|
bool has_file_version() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string get_app_name() const;
|
std::string get_app_name() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t get_last_edited() const;
|
std::size_t get_last_edited() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t get_lowest_edited() const;
|
std::size_t get_lowest_edited() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t get_rup_build() const;
|
std::size_t get_rup_build() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_arch_id() const;
|
bool has_arch_id() const;
|
||||||
|
|
||||||
// calculation
|
// calculation
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_calculation_properties() const;
|
bool has_calculation_properties() const;
|
||||||
|
|
||||||
// theme
|
// theme
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_theme() const;
|
bool has_theme() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const theme &get_theme() const;
|
const theme &get_theme() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_theme(const theme &value);
|
void set_theme(const theme &value);
|
||||||
|
|
||||||
// formats
|
// formats
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
format get_format(std::size_t format_index);
|
format get_format(std::size_t format_index);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const format get_format(std::size_t format_index) const;
|
const format get_format(std::size_t format_index) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
format create_format(bool default_format = false);
|
format create_format(bool default_format = false);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void clear_formats();
|
void clear_formats();
|
||||||
|
|
||||||
// styles
|
// styles
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_style(const std::string &name) const;
|
bool has_style(const std::string &name) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
class style style(const std::string &name);
|
class style style(const std::string &name);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const class style style(const std::string &name) const;
|
const class style style(const std::string &name) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
class style create_style(const std::string &name);
|
class style create_style(const std::string &name);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void clear_styles();
|
void clear_styles();
|
||||||
|
|
||||||
// manifest
|
// manifest
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
manifest &get_manifest();
|
manifest &get_manifest();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const manifest &get_manifest() const;
|
const manifest &get_manifest() const;
|
||||||
|
|
||||||
// shared strings
|
// shared strings
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void add_shared_string(const formatted_text &shared, bool allow_duplicates=false);
|
void add_shared_string(const formatted_text &shared, bool allow_duplicates=false);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::vector<formatted_text> &get_shared_strings();
|
std::vector<formatted_text> &get_shared_strings();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const std::vector<formatted_text> &get_shared_strings() const;
|
const std::vector<formatted_text> &get_shared_strings() const;
|
||||||
|
|
||||||
// thumbnail
|
// thumbnail
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_thumbnail(const std::vector<std::uint8_t> &thumbnail,
|
void set_thumbnail(const std::vector<std::uint8_t> &thumbnail,
|
||||||
const std::string &extension, const std::string &content_type);
|
const std::string &extension, const std::string &content_type);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const std::vector<std::uint8_t> &get_thumbnail() const;
|
const std::vector<std::uint8_t> &get_thumbnail() const;
|
||||||
|
|
||||||
// operators
|
// operators
|
||||||
|
@ -487,22 +850,49 @@ private:
|
||||||
friend class detail::xlsx_consumer;
|
friend class detail::xlsx_consumer;
|
||||||
friend class detail::xlsx_producer;
|
friend class detail::xlsx_producer;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
workbook(detail::workbook_impl *impl);
|
workbook(detail::workbook_impl *impl);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
detail::workbook_impl &impl();
|
detail::workbook_impl &impl();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const detail::workbook_impl &impl() const;
|
const detail::workbook_impl &impl() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void register_app_properties_in_manifest();
|
void register_app_properties_in_manifest();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void register_core_properties_in_manifest();
|
void register_core_properties_in_manifest();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void register_shared_string_table_in_manifest();
|
void register_shared_string_table_in_manifest();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void register_stylesheet_in_manifest();
|
void register_stylesheet_in_manifest();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void register_theme_in_manifest();
|
void register_theme_in_manifest();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void register_comments_in_manifest(worksheet ws);
|
void register_comments_in_manifest(worksheet ws);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -35,19 +35,69 @@ namespace xlnt {
|
||||||
class XLNT_API workbook_view
|
class XLNT_API workbook_view
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool auto_filter_date_grouping = false;
|
bool auto_filter_date_grouping = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool minimized = false;
|
bool minimized = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool show_horizontal_scroll = false;
|
bool show_horizontal_scroll = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool show_sheet_tabs = false;
|
bool show_sheet_tabs = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool show_vertical_scroll = false;
|
bool show_vertical_scroll = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool visible = true;
|
bool visible = true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t active_tab = 0;
|
std::size_t active_tab = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t first_sheet = 0;
|
std::size_t first_sheet = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t tab_ratio = 500;
|
std::size_t tab_ratio = 500;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t window_width = 28800;
|
std::size_t window_width = 28800;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t window_height = 17460;
|
std::size_t window_height = 17460;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t x_window = 0;
|
std::size_t x_window = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t y_window = 460;
|
std::size_t y_window = 460;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -33,23 +33,64 @@ namespace xlnt {
|
||||||
class workbook;
|
class workbook;
|
||||||
class worksheet;
|
class worksheet;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
class XLNT_API worksheet_iterator : public std::iterator<std::bidirectional_iterator_tag, worksheet, std::ptrdiff_t, worksheet*, worksheet>
|
class XLNT_API worksheet_iterator : public std::iterator<std::bidirectional_iterator_tag, worksheet, std::ptrdiff_t, worksheet*, worksheet>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
worksheet_iterator(workbook &wb, std::size_t index);
|
worksheet_iterator(workbook &wb, std::size_t index);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
worksheet_iterator(const worksheet_iterator &);
|
worksheet_iterator(const worksheet_iterator &);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
worksheet_iterator &operator=(const worksheet_iterator &);
|
worksheet_iterator &operator=(const worksheet_iterator &);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
worksheet operator*();
|
worksheet operator*();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator==(const worksheet_iterator &comparand) const;
|
bool operator==(const worksheet_iterator &comparand) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator!=(const worksheet_iterator &comparand) const
|
bool operator!=(const worksheet_iterator &comparand) const
|
||||||
{
|
{
|
||||||
return !(*this == comparand);
|
return !(*this == comparand);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
worksheet_iterator operator++(int);
|
worksheet_iterator operator++(int);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
worksheet_iterator &operator++();
|
worksheet_iterator &operator++();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
workbook &wb_;
|
workbook &wb_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t index_;
|
std::size_t index_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -33,40 +33,92 @@
|
||||||
|
|
||||||
namespace xlnt {
|
namespace xlnt {
|
||||||
|
|
||||||
|
enum class major_order;
|
||||||
|
|
||||||
class cell;
|
class cell;
|
||||||
class cell_reference;
|
class cell_reference;
|
||||||
class range_reference;
|
class range_reference;
|
||||||
enum class major_order;
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
class XLNT_API cell_iterator : public std::iterator<std::bidirectional_iterator_tag, cell, std::ptrdiff_t, cell *, cell>
|
class XLNT_API cell_iterator : public std::iterator<std::bidirectional_iterator_tag, cell, std::ptrdiff_t, cell *, cell>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_iterator(worksheet ws, const cell_reference &start_cell, const range_reference &limits);
|
cell_iterator(worksheet ws, const cell_reference &start_cell, const range_reference &limits);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_iterator(worksheet ws, const cell_reference &start_cell, const range_reference &limits, major_order order);
|
cell_iterator(worksheet ws, const cell_reference &start_cell, const range_reference &limits, major_order order);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_iterator(const cell_iterator &other);
|
cell_iterator(const cell_iterator &other);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell operator*();
|
cell operator*();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_iterator &operator=(const cell_iterator &) = default;
|
cell_iterator &operator=(const cell_iterator &) = default;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator==(const cell_iterator &other) const;
|
bool operator==(const cell_iterator &other) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator!=(const cell_iterator &other) const;
|
bool operator!=(const cell_iterator &other) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_iterator &operator--();
|
cell_iterator &operator--();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_iterator operator--(int);
|
cell_iterator operator--(int);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_iterator &operator++();
|
cell_iterator &operator++();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_iterator operator++(int);
|
cell_iterator operator++(int);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
worksheet ws_;
|
worksheet ws_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_reference current_cell_;
|
cell_reference current_cell_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range_reference range_;
|
range_reference range_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
major_order order_;
|
major_order order_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -46,54 +46,155 @@ class range_reference;
|
||||||
class XLNT_API cell_vector
|
class XLNT_API cell_vector
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
using iterator = cell_iterator;
|
using iterator = cell_iterator;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
using const_iterator = const_cell_iterator;
|
using const_iterator = const_cell_iterator;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
using reverse_iterator = std::reverse_iterator<iterator>;
|
using reverse_iterator = std::reverse_iterator<iterator>;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
|
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_vector(worksheet ws, const range_reference &ref, major_order order = major_order::row);
|
cell_vector(worksheet ws, const range_reference &ref, major_order order = major_order::row);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t num_cells() const;
|
std::size_t num_cells() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell front();
|
cell front();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const cell front() const;
|
const cell front() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell back();
|
cell back();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const cell back() const;
|
const cell back() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell operator[](std::size_t column_index);
|
cell operator[](std::size_t column_index);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const cell operator[](std::size_t column_index) const;
|
const cell operator[](std::size_t column_index) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell get_cell(std::size_t column_index);
|
cell get_cell(std::size_t column_index);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const cell get_cell(std::size_t column_index) const;
|
const cell get_cell(std::size_t column_index) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t length() const;
|
std::size_t length() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
iterator begin();
|
iterator begin();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
iterator end();
|
iterator end();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_iterator begin() const;
|
const_iterator begin() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_iterator cbegin() const;
|
const_iterator cbegin() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_iterator end() const;
|
const_iterator end() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_iterator cend() const;
|
const_iterator cend() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
reverse_iterator rbegin();
|
reverse_iterator rbegin();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
reverse_iterator rend();
|
reverse_iterator rend();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_reverse_iterator rbegin() const;
|
const_reverse_iterator rbegin() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_reverse_iterator rend() const;
|
const_reverse_iterator rend() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_reverse_iterator crbegin() const;
|
const_reverse_iterator crbegin() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_reverse_iterator crend() const;
|
const_reverse_iterator crend() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
worksheet ws_;
|
worksheet ws_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range_reference ref_;
|
range_reference ref_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
major_order order_;
|
major_order order_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,19 @@ namespace xlnt {
|
||||||
class XLNT_API column_properties
|
class XLNT_API column_properties
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
long double width;
|
long double width;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t style;
|
std::size_t style;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool custom;
|
bool custom;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -33,40 +33,92 @@
|
||||||
|
|
||||||
namespace xlnt {
|
namespace xlnt {
|
||||||
|
|
||||||
|
enum class major_order;
|
||||||
|
|
||||||
class cell;
|
class cell;
|
||||||
class cell_reference;
|
class cell_reference;
|
||||||
class range_reference;
|
class range_reference;
|
||||||
enum class major_order;
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
class XLNT_API const_cell_iterator : public std::iterator<std::bidirectional_iterator_tag, const cell, std::ptrdiff_t, const cell*, const cell>
|
class XLNT_API const_cell_iterator : public std::iterator<std::bidirectional_iterator_tag, const cell, std::ptrdiff_t, const cell*, const cell>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_cell_iterator(worksheet ws, const cell_reference &start_cell);
|
const_cell_iterator(worksheet ws, const cell_reference &start_cell);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_cell_iterator(worksheet ws, const cell_reference &start_cell, major_order order);
|
const_cell_iterator(worksheet ws, const cell_reference &start_cell, major_order order);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_cell_iterator(const const_cell_iterator &other);
|
const_cell_iterator(const const_cell_iterator &other);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_cell_iterator &operator=(const const_cell_iterator &) = default;
|
const_cell_iterator &operator=(const const_cell_iterator &) = default;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const cell operator*() const;
|
const cell operator*() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator==(const const_cell_iterator &other) const;
|
bool operator==(const const_cell_iterator &other) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator!=(const const_cell_iterator &other) const;
|
bool operator!=(const const_cell_iterator &other) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_cell_iterator &operator--();
|
const_cell_iterator &operator--();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_cell_iterator operator--(int);
|
const_cell_iterator operator--(int);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_cell_iterator &operator++();
|
const_cell_iterator &operator++();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_cell_iterator operator++(int);
|
const_cell_iterator operator++(int);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
worksheet ws_;
|
worksheet ws_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_reference current_cell_;
|
cell_reference current_cell_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range_reference range_;
|
range_reference range_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
major_order order_;
|
major_order order_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -45,31 +45,76 @@ struct worksheet_impl;
|
||||||
class XLNT_API const_range_iterator : public std::iterator<std::bidirectional_iterator_tag, const cell_vector, std::ptrdiff_t, const cell_vector*, const cell_vector>
|
class XLNT_API const_range_iterator : public std::iterator<std::bidirectional_iterator_tag, const cell_vector, std::ptrdiff_t, const cell_vector*, const cell_vector>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_range_iterator(
|
const_range_iterator(
|
||||||
const worksheet &ws, const range_reference &start_cell, major_order order = major_order::row);
|
const worksheet &ws, const range_reference &start_cell, major_order order = major_order::row);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_range_iterator(const const_range_iterator &other);
|
const_range_iterator(const const_range_iterator &other);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const cell_vector operator*() const;
|
const cell_vector operator*() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_range_iterator &operator=(const const_range_iterator &) = default;
|
const_range_iterator &operator=(const const_range_iterator &) = default;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator==(const const_range_iterator &other) const;
|
bool operator==(const const_range_iterator &other) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator!=(const const_range_iterator &other) const;
|
bool operator!=(const const_range_iterator &other) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_range_iterator &operator--();
|
const_range_iterator &operator--();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_range_iterator operator--(int);
|
const_range_iterator operator--(int);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_range_iterator &operator++();
|
const_range_iterator &operator++();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_range_iterator operator++(int);
|
const_range_iterator operator++(int);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
detail::worksheet_impl *ws_;
|
detail::worksheet_impl *ws_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_reference current_cell_;
|
cell_reference current_cell_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range_reference range_;
|
range_reference range_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
major_order order_;
|
major_order order_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -36,23 +36,60 @@ namespace xlnt {
|
||||||
class XLNT_API footer
|
class XLNT_API footer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
footer();
|
footer();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_text(const std::string &text);
|
void set_text(const std::string &text);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_font_name(const std::string &font_name);
|
void set_font_name(const std::string &font_name);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_font_size(std::size_t font_size);
|
void set_font_size(std::size_t font_size);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_font_color(const std::string &font_color);
|
void set_font_color(const std::string &font_color);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool is_default() const;
|
bool is_default() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool default_;
|
bool default_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string text_;
|
std::string text_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string font_name_;
|
std::string font_name_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t font_size_;
|
std::size_t font_size_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string font_color_;
|
std::string font_color_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -36,23 +36,60 @@ namespace xlnt {
|
||||||
class XLNT_API header
|
class XLNT_API header
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
header();
|
header();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_text(const std::string &text);
|
void set_text(const std::string &text);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_font_name(const std::string &font_name);
|
void set_font_name(const std::string &font_name);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_font_size(std::size_t font_size);
|
void set_font_size(std::size_t font_size);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_font_color(const std::string &font_color);
|
void set_font_color(const std::string &font_color);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool is_default() const;
|
bool is_default() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool default_;
|
bool default_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string text_;
|
std::string text_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string font_name_;
|
std::string font_name_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t font_size_;
|
std::size_t font_size_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string font_color_;
|
std::string font_color_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -38,22 +38,65 @@ namespace xlnt {
|
||||||
class XLNT_API header_footer
|
class XLNT_API header_footer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
header_footer();
|
header_footer();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
header &get_left_header();
|
header &get_left_header();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
header &get_center_header();
|
header &get_center_header();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
header &get_right_header();
|
header &get_right_header();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
footer &get_left_footer();
|
footer &get_left_footer();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
footer &get_center_footer();
|
footer &get_center_footer();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
footer &get_right_footer();
|
footer &get_right_footer();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool is_default_header() const;
|
bool is_default_header() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool is_default_footer() const;
|
bool is_default_footer() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool is_default() const;
|
bool is_default() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
header left_header_, right_header_, center_header_;
|
header left_header_, right_header_, center_header_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
footer left_footer_, right_footer_, center_footer_;
|
footer left_footer_, right_footer_, center_footer_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -33,32 +33,100 @@ namespace xlnt {
|
||||||
class XLNT_API page_margins
|
class XLNT_API page_margins
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
page_margins();
|
page_margins();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
double get_top() const;
|
double get_top() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_top(double top);
|
void set_top(double top);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
double get_left() const;
|
double get_left() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_left(double left);
|
void set_left(double left);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
double get_bottom() const;
|
double get_bottom() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_bottom(double bottom);
|
void set_bottom(double bottom);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
double get_right() const;
|
double get_right() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_right(double right);
|
void set_right(double right);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
double get_header() const;
|
double get_header() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_header(double header);
|
void set_header(double header);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
double get_footer() const;
|
double get_footer() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_footer(double footer);
|
void set_footer(double footer);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
double top_ = 1;
|
double top_ = 1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
double left_ = 0.75;
|
double left_ = 0.75;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
double bottom_ = 1;
|
double bottom_ = 1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
double right_ = 0.75;
|
double right_ = 0.75;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
double header_ = 0.5;
|
double header_ = 0.5;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
double footer_ = 0.5;
|
double footer_ = 0.5;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -37,58 +37,160 @@ namespace xlnt {
|
||||||
struct XLNT_API page_setup
|
struct XLNT_API page_setup
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
page_setup();
|
page_setup();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
page_break get_break() const;
|
page_break get_break() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_break(page_break b);
|
void set_break(page_break b);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
sheet_state get_sheet_state() const;
|
sheet_state get_sheet_state() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_sheet_state(sheet_state sheet_state);
|
void set_sheet_state(sheet_state sheet_state);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
paper_size get_paper_size() const;
|
paper_size get_paper_size() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_paper_size(paper_size paper_size);
|
void set_paper_size(paper_size paper_size);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
orientation get_orientation() const;
|
orientation get_orientation() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_orientation(orientation orientation);
|
void set_orientation(orientation orientation);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool fit_to_page() const;
|
bool fit_to_page() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_fit_to_page(bool fit_to_page);
|
void set_fit_to_page(bool fit_to_page);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool fit_to_height() const;
|
bool fit_to_height() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_fit_to_height(bool fit_to_height);
|
void set_fit_to_height(bool fit_to_height);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool fit_to_width() const;
|
bool fit_to_width() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_fit_to_width(bool fit_to_width);
|
void set_fit_to_width(bool fit_to_width);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_horizontal_centered(bool horizontal_centered);
|
void set_horizontal_centered(bool horizontal_centered);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool get_horizontal_centered() const;
|
bool get_horizontal_centered() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_vertical_centered(bool vertical_centered);
|
void set_vertical_centered(bool vertical_centered);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool get_vertical_centered() const;
|
bool get_vertical_centered() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_scale(double scale);
|
void set_scale(double scale);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
double get_scale() const;
|
double get_scale() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
page_break break_;
|
page_break break_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
sheet_state sheet_state_;
|
sheet_state sheet_state_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
paper_size paper_size_;
|
paper_size paper_size_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
orientation orientation_;
|
orientation orientation_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool fit_to_page_;
|
bool fit_to_page_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool fit_to_height_;
|
bool fit_to_height_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool fit_to_width_;
|
bool fit_to_width_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool horizontal_centered_;
|
bool horizontal_centered_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool vertical_centered_;
|
bool vertical_centered_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
double scale_;
|
double scale_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -55,10 +55,29 @@ enum class XLNT_API pane_corner
|
||||||
class XLNT_API pane
|
class XLNT_API pane
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_reference top_left_cell;
|
cell_reference top_left_cell;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
pane_state state;
|
pane_state state;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
pane_corner active_pane;
|
pane_corner active_pane;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
row_t y_split;
|
row_t y_split;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
column_t x_split;
|
column_t x_split;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -46,61 +46,175 @@ class range_iterator;
|
||||||
class XLNT_API range
|
class XLNT_API range
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
using iterator = range_iterator;
|
using iterator = range_iterator;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
using const_iterator = const_range_iterator;
|
using const_iterator = const_range_iterator;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
using reverse_iterator = std::reverse_iterator<iterator>;
|
using reverse_iterator = std::reverse_iterator<iterator>;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
|
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range(worksheet ws, const range_reference &reference, major_order order = major_order::row, bool skip_null = false);
|
range(worksheet ws, const range_reference &reference, major_order order = major_order::row, bool skip_null = false);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
~range();
|
~range();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range(const range &) = default;
|
range(const range &) = default;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_vector operator[](std::size_t vector_index);
|
cell_vector operator[](std::size_t vector_index);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const cell_vector operator[](std::size_t vector_index) const;
|
const cell_vector operator[](std::size_t vector_index) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator==(const range &comparand) const;
|
bool operator==(const range &comparand) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator!=(const range &comparand) const;
|
bool operator!=(const range &comparand) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_vector get_vector(std::size_t vector_index);
|
cell_vector get_vector(std::size_t vector_index);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const cell_vector get_vector(std::size_t vector_index) const;
|
const cell_vector get_vector(std::size_t vector_index) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell get_cell(const cell_reference &ref);
|
cell get_cell(const cell_reference &ref);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const cell get_cell(const cell_reference &ref) const;
|
const cell get_cell(const cell_reference &ref) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range_reference get_reference() const;
|
range_reference get_reference() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t length() const;
|
std::size_t length() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool contains(const cell_reference &ref);
|
bool contains(const cell_reference &ref);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
iterator begin();
|
iterator begin();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
iterator end();
|
iterator end();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_iterator begin() const;
|
const_iterator begin() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_iterator end() const;
|
const_iterator end() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_iterator cbegin() const;
|
const_iterator cbegin() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_iterator cend() const;
|
const_iterator cend() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
reverse_iterator rbegin();
|
reverse_iterator rbegin();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
reverse_iterator rend();
|
reverse_iterator rend();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_reverse_iterator rbegin() const;
|
const_reverse_iterator rbegin() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_reverse_iterator rend() const;
|
const_reverse_iterator rend() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_reverse_iterator crbegin() const;
|
const_reverse_iterator crbegin() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_reverse_iterator crend() const;
|
const_reverse_iterator crend() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
worksheet ws_;
|
worksheet ws_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range_reference ref_;
|
range_reference ref_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
major_order order_;
|
major_order order_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool skip_null_;
|
bool skip_null_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -41,30 +41,75 @@ class cell_vector;
|
||||||
class XLNT_API range_iterator : public std::iterator<std::bidirectional_iterator_tag, cell_vector, std::ptrdiff_t, cell_vector*, cell_vector>
|
class XLNT_API range_iterator : public std::iterator<std::bidirectional_iterator_tag, cell_vector, std::ptrdiff_t, cell_vector*, cell_vector>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range_iterator(worksheet &ws, const range_reference &start_cell, const range_reference &limits, major_order order = major_order::row);
|
range_iterator(worksheet &ws, const range_reference &start_cell, const range_reference &limits, major_order order = major_order::row);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range_iterator(const range_iterator &other);
|
range_iterator(const range_iterator &other);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_vector operator*() const;
|
cell_vector operator*() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range_iterator &operator=(const range_iterator &) = default;
|
range_iterator &operator=(const range_iterator &) = default;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator==(const range_iterator &other) const;
|
bool operator==(const range_iterator &other) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator!=(const range_iterator &other) const;
|
bool operator!=(const range_iterator &other) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range_iterator &operator--();
|
range_iterator &operator--();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range_iterator operator--(int);
|
range_iterator operator--(int);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range_iterator &operator++();
|
range_iterator &operator++();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range_iterator operator++(int);
|
range_iterator operator++(int);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
worksheet ws_;
|
worksheet ws_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_reference current_cell_;
|
cell_reference current_cell_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range_reference range_;
|
range_reference range_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
major_order order_;
|
major_order order_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -39,53 +39,140 @@ public:
|
||||||
/// </summary>
|
/// </summary>
|
||||||
static range_reference make_absolute(const range_reference &relative_reference);
|
static range_reference make_absolute(const range_reference &relative_reference);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range_reference();
|
range_reference();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
explicit range_reference(const std::string &range_string);
|
explicit range_reference(const std::string &range_string);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
explicit range_reference(const char *range_string);
|
explicit range_reference(const char *range_string);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
explicit range_reference(const std::pair<cell_reference, cell_reference> &reference_pair);
|
explicit range_reference(const std::pair<cell_reference, cell_reference> &reference_pair);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range_reference(const cell_reference &start, const cell_reference &end);
|
range_reference(const cell_reference &start, const cell_reference &end);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range_reference(column_t column_index_start, row_t row_index_start, column_t column_index_end, row_t row_index_end);
|
range_reference(column_t column_index_start, row_t row_index_start, column_t column_index_end, row_t row_index_end);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool is_single_cell() const;
|
bool is_single_cell() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t get_width() const;
|
std::size_t get_width() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t get_height() const;
|
std::size_t get_height() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_reference get_top_left() const;
|
cell_reference get_top_left() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_reference get_bottom_right() const;
|
cell_reference get_bottom_right() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_reference &get_top_left();
|
cell_reference &get_top_left();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_reference &get_bottom_right();
|
cell_reference &get_bottom_right();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range_reference make_offset(int column_offset, int row_offset) const;
|
range_reference make_offset(int column_offset, int row_offset) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string to_string() const;
|
std::string to_string() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator==(const range_reference &comparand) const;
|
bool operator==(const range_reference &comparand) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator==(const std::string &reference_string) const;
|
bool operator==(const std::string &reference_string) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator==(const char *reference_string) const;
|
bool operator==(const char *reference_string) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator!=(const range_reference &comparand) const;
|
bool operator!=(const range_reference &comparand) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator!=(const std::string &reference_string) const;
|
bool operator!=(const std::string &reference_string) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator!=(const char *reference_string) const;
|
bool operator!=(const char *reference_string) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
XLNT_API friend bool operator==(const std::string &reference_string, const range_reference &ref);
|
XLNT_API friend bool operator==(const std::string &reference_string, const range_reference &ref);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
XLNT_API friend bool operator==(const char *reference_string, const range_reference &ref);
|
XLNT_API friend bool operator==(const char *reference_string, const range_reference &ref);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
XLNT_API friend bool operator!=(const std::string &reference_string, const range_reference &ref);
|
XLNT_API friend bool operator!=(const std::string &reference_string, const range_reference &ref);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
XLNT_API friend bool operator!=(const char *reference_string, const range_reference &ref);
|
XLNT_API friend bool operator!=(const char *reference_string, const range_reference &ref);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_reference top_left_;
|
cell_reference top_left_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_reference bottom_right_;
|
cell_reference bottom_right_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -33,10 +33,29 @@ namespace xlnt {
|
||||||
class XLNT_API row_properties
|
class XLNT_API row_properties
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
long double height;
|
long double height;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool visible;
|
bool visible;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
int outline_level;
|
int outline_level;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool collapsed;
|
bool collapsed;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
int style_index;
|
int style_index;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -35,16 +35,50 @@ namespace xlnt {
|
||||||
class XLNT_API selection
|
class XLNT_API selection
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_active_cell() const { return has_active_cell_; }
|
bool has_active_cell() const { return has_active_cell_; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_reference get_active_cell() const { return active_cell_; }
|
cell_reference get_active_cell() const { return active_cell_; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range_reference get_sqref() const { return sqref_; }
|
range_reference get_sqref() const { return sqref_; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
pane_corner get_pane() const { return pane_; }
|
pane_corner get_pane() const { return pane_; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_pane(pane_corner corner) { pane_ = corner; }
|
void set_pane(pane_corner corner) { pane_ = corner; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_active_cell_ = false;
|
bool has_active_cell_ = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_reference active_cell_;
|
cell_reference active_cell_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range_reference sqref_;
|
range_reference sqref_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
pane_corner pane_;
|
pane_corner pane_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -35,12 +35,25 @@ namespace xlnt {
|
||||||
class XLNT_API sheet_protection
|
class XLNT_API sheet_protection
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
static std::string hash_password(const std::string &password);
|
static std::string hash_password(const std::string &password);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_password(const std::string &password);
|
void set_password(const std::string &password);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string get_hashed_password() const;
|
std::string get_hashed_password() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string hashed_password_;
|
std::string hashed_password_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -36,13 +36,35 @@ namespace xlnt {
|
||||||
class XLNT_API sheet_view
|
class XLNT_API sheet_view
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
pane &get_pane() { return pane_; }
|
pane &get_pane() { return pane_; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const pane &get_pane() const { return pane_; }
|
const pane &get_pane() const { return pane_; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::vector<selection> &get_selections() { return selections_; }
|
std::vector<selection> &get_selections() { return selections_; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const std::vector<selection> &get_selections() const { return selections_; }
|
const std::vector<selection> &get_selections() const { return selections_; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
pane pane_;
|
pane pane_;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::vector<selection> selections_;
|
std::vector<selection> selections_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -55,9 +55,12 @@ class workbook;
|
||||||
struct date;
|
struct date;
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
struct worksheet_impl;
|
|
||||||
class xlsx_consumer;
|
class xlsx_consumer;
|
||||||
class xlsx_producer;
|
class xlsx_producer;
|
||||||
|
|
||||||
|
struct worksheet_impl;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -67,191 +70,678 @@ class xlsx_producer;
|
||||||
class XLNT_API worksheet
|
class XLNT_API worksheet
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
using iterator = range_iterator;
|
using iterator = range_iterator;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
using const_iterator = const_range_iterator;
|
using const_iterator = const_range_iterator;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
using reverse_iterator = std::reverse_iterator<iterator>;
|
using reverse_iterator = std::reverse_iterator<iterator>;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
|
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
worksheet();
|
worksheet();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
worksheet(const worksheet &rhs);
|
worksheet(const worksheet &rhs);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string to_string() const;
|
std::string to_string() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
workbook &get_workbook();
|
workbook &get_workbook();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const workbook &get_workbook() const;
|
const workbook &get_workbook() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void garbage_collect();
|
void garbage_collect();
|
||||||
|
|
||||||
// identification
|
// identification
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t get_id() const;
|
std::size_t get_id() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_id(std::size_t id);
|
void set_id(std::size_t id);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string get_title() const;
|
std::string get_title() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_title(const std::string &title);
|
void set_title(const std::string &title);
|
||||||
|
|
||||||
// freeze panes
|
// freeze panes
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_reference get_frozen_panes() const;
|
cell_reference get_frozen_panes() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void freeze_panes(cell top_left_cell);
|
void freeze_panes(cell top_left_cell);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void freeze_panes(const std::string &top_left_coordinate);
|
void freeze_panes(const std::string &top_left_coordinate);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void unfreeze_panes();
|
void unfreeze_panes();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_frozen_panes() const;
|
bool has_frozen_panes() const;
|
||||||
|
|
||||||
// container
|
// container
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell get_cell(column_t column, row_t row);
|
cell get_cell(column_t column, row_t row);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const cell get_cell(column_t column, row_t row) const;
|
const cell get_cell(column_t column, row_t row) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell get_cell(const cell_reference &reference);
|
cell get_cell(const cell_reference &reference);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const cell get_cell(const cell_reference &reference) const;
|
const cell get_cell(const cell_reference &reference) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_cell(const cell_reference &reference) const;
|
bool has_cell(const cell_reference &reference) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range get_range(const std::string &reference_string);
|
range get_range(const std::string &reference_string);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range get_range(const range_reference &reference);
|
range get_range(const range_reference &reference);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const range get_range(const std::string &reference_string) const;
|
const range get_range(const std::string &reference_string) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const range get_range(const range_reference &reference) const;
|
const range get_range(const range_reference &reference) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range rows() const;
|
range rows() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range rows(const std::string &range_string) const;
|
range rows(const std::string &range_string) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range rows(int row_offset, int column_offset) const;
|
range rows(int row_offset, int column_offset) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range rows(const std::string &range_string, int row_offset, int column_offset) const;
|
range rows(const std::string &range_string, int row_offset, int column_offset) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range columns() const;
|
range columns() const;
|
||||||
|
|
||||||
// properties
|
// properties
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
column_properties &get_column_properties(column_t column);
|
column_properties &get_column_properties(column_t column);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const column_properties &get_column_properties(column_t column) const;
|
const column_properties &get_column_properties(column_t column) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_column_properties(column_t column) const;
|
bool has_column_properties(column_t column) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void add_column_properties(column_t column, const column_properties &props);
|
void add_column_properties(column_t column, const column_properties &props);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
row_properties &get_row_properties(row_t row);
|
row_properties &get_row_properties(row_t row);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const row_properties &get_row_properties(row_t row) const;
|
const row_properties &get_row_properties(row_t row) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_row_properties(row_t row) const;
|
bool has_row_properties(row_t row) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void add_row_properties(row_t row, const row_properties &props);
|
void add_row_properties(row_t row, const row_properties &props);
|
||||||
|
|
||||||
// positioning
|
// positioning
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_reference get_point_pos(int left, int top) const;
|
cell_reference get_point_pos(int left, int top) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell_reference get_point_pos(const std::pair<int, int> &point) const;
|
cell_reference get_point_pos(const std::pair<int, int> &point) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string unique_sheet_name(const std::string &value) const;
|
std::string unique_sheet_name(const std::string &value) const;
|
||||||
|
|
||||||
// named range
|
// named range
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void create_named_range(const std::string &name, const std::string &reference_string);
|
void create_named_range(const std::string &name, const std::string &reference_string);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void create_named_range(const std::string &name, const range_reference &reference);
|
void create_named_range(const std::string &name, const range_reference &reference);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_named_range(const std::string &name);
|
bool has_named_range(const std::string &name);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range get_named_range(const std::string &name);
|
range get_named_range(const std::string &name);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void remove_named_range(const std::string &name);
|
void remove_named_range(const std::string &name);
|
||||||
|
|
||||||
// extents
|
// extents
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
row_t get_lowest_row() const;
|
row_t get_lowest_row() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
row_t get_highest_row() const;
|
row_t get_highest_row() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
row_t get_next_row() const;
|
row_t get_next_row() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
column_t get_lowest_column() const;
|
column_t get_lowest_column() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
column_t get_highest_column() const;
|
column_t get_highest_column() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range_reference calculate_dimension() const;
|
range_reference calculate_dimension() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_dimension() const;
|
bool has_dimension() const;
|
||||||
|
|
||||||
// cell merge
|
// cell merge
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void merge_cells(const std::string &reference_string);
|
void merge_cells(const std::string &reference_string);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void merge_cells(const range_reference &reference);
|
void merge_cells(const range_reference &reference);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void merge_cells(column_t start_column, row_t start_row, column_t end_column, row_t end_row);
|
void merge_cells(column_t start_column, row_t start_row, column_t end_column, row_t end_row);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void unmerge_cells(const std::string &reference_string);
|
void unmerge_cells(const std::string &reference_string);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void unmerge_cells(const range_reference &reference);
|
void unmerge_cells(const range_reference &reference);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void unmerge_cells(column_t start_column, row_t start_row, column_t end_column, row_t end_row);
|
void unmerge_cells(column_t start_column, row_t start_row, column_t end_column, row_t end_row);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::vector<range_reference> get_merged_ranges() const;
|
std::vector<range_reference> get_merged_ranges() const;
|
||||||
|
|
||||||
// append
|
// append
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void append();
|
void append();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void append(const std::vector<std::string> &cells);
|
void append(const std::vector<std::string> &cells);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void append(const std::vector<int> &cells);
|
void append(const std::vector<int> &cells);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void append(const std::unordered_map<std::string, std::string> &cells);
|
void append(const std::unordered_map<std::string, std::string> &cells);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void append(const std::unordered_map<int, std::string> &cells);
|
void append(const std::unordered_map<int, std::string> &cells);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void append(const std::vector<int>::const_iterator begin, const std::vector<int>::const_iterator end);
|
void append(const std::vector<int>::const_iterator begin, const std::vector<int>::const_iterator end);
|
||||||
|
|
||||||
// operators
|
// operators
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator==(const worksheet &other) const;
|
bool operator==(const worksheet &other) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator!=(const worksheet &other) const;
|
bool operator!=(const worksheet &other) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator==(std::nullptr_t) const;
|
bool operator==(std::nullptr_t) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool operator!=(std::nullptr_t) const;
|
bool operator!=(std::nullptr_t) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void operator=(const worksheet &other);
|
void operator=(const worksheet &other);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
cell operator[](const cell_reference &reference);
|
cell operator[](const cell_reference &reference);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const cell operator[](const cell_reference &reference) const;
|
const cell operator[](const cell_reference &reference) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range operator[](const range_reference &reference);
|
range operator[](const range_reference &reference);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const range operator[](const range_reference &reference) const;
|
const range operator[](const range_reference &reference) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range operator[](const std::string &range_string);
|
range operator[](const std::string &range_string);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const range operator[](const std::string &range_string) const;
|
const range operator[](const std::string &range_string) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range operator()(const cell_reference &top_left, const cell_reference &bottom_right);
|
range operator()(const cell_reference &top_left, const cell_reference &bottom_right);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const range operator()(const cell_reference &top_left, const cell_reference &bottom_right) const;
|
const range operator()(const cell_reference &top_left, const cell_reference &bottom_right) const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool compare(const worksheet &other, bool reference) const;
|
bool compare(const worksheet &other, bool reference) const;
|
||||||
|
|
||||||
// page
|
// page
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_page_setup() const;
|
bool has_page_setup() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
page_setup get_page_setup() const;
|
page_setup get_page_setup() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_page_setup(const page_setup &setup);
|
void set_page_setup(const page_setup &setup);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_page_margins() const;
|
bool has_page_margins() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
page_margins get_page_margins() const;
|
page_margins get_page_margins() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_page_margins(const page_margins &margins);
|
void set_page_margins(const page_margins &margins);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_format_properties() const;
|
bool has_format_properties() const;
|
||||||
|
|
||||||
// auto filter
|
// auto filter
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range_reference get_auto_filter() const;
|
range_reference get_auto_filter() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void auto_filter(const std::string &range_string);
|
void auto_filter(const std::string &range_string);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void auto_filter(const xlnt::range &range);
|
void auto_filter(const xlnt::range &range);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void auto_filter(const range_reference &reference);
|
void auto_filter(const range_reference &reference);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void unset_auto_filter();
|
void unset_auto_filter();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_auto_filter() const;
|
bool has_auto_filter() const;
|
||||||
|
|
||||||
// comments
|
// comments
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void increment_comments();
|
void increment_comments();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void decrement_comments();
|
void decrement_comments();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::size_t get_comment_count() const;
|
std::size_t get_comment_count() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void reserve(std::size_t n);
|
void reserve(std::size_t n);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
header_footer &get_header_footer();
|
header_footer &get_header_footer();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const header_footer &get_header_footer() const;
|
const header_footer &get_header_footer() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_parent(workbook &wb);
|
void set_parent(workbook &wb);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::vector<std::string> get_formula_attributes() const;
|
std::vector<std::string> get_formula_attributes() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
sheet_state get_sheet_state() const;
|
sheet_state get_sheet_state() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_sheet_state(sheet_state state);
|
void set_sheet_state(sheet_state state);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
iterator begin();
|
iterator begin();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
iterator end();
|
iterator end();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_iterator begin() const;
|
const_iterator begin() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_iterator end() const;
|
const_iterator end() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_iterator cbegin() const;
|
const_iterator cbegin() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
const_iterator cend() const;
|
const_iterator cend() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range iter_cells(bool skip_null);
|
range iter_cells(bool skip_null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_print_title_rows(row_t first_row, row_t last_row);
|
void set_print_title_rows(row_t first_row, row_t last_row);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_print_title_rows(row_t last_row);
|
void set_print_title_rows(row_t last_row);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_print_title_cols(column_t first_column, column_t last_column);
|
void set_print_title_cols(column_t first_column, column_t last_column);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_print_title_cols(column_t last_column);
|
void set_print_title_cols(column_t last_column);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
std::string get_print_titles() const;
|
std::string get_print_titles() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void set_print_area(const std::string &print_area);
|
void set_print_area(const std::string &print_area);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
range_reference get_print_area() const;
|
range_reference get_print_area() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool has_view() const;
|
bool has_view() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
sheet_view get_view() const;
|
sheet_view get_view() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
bool x14ac_enabled() const;
|
bool x14ac_enabled() const;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void enable_x14ac();
|
void enable_x14ac();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void disable_x14ac();
|
void disable_x14ac();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class workbook;
|
|
||||||
friend class cell;
|
friend class cell;
|
||||||
friend class range_iterator;
|
|
||||||
friend class const_range_iterator;
|
friend class const_range_iterator;
|
||||||
|
friend class range_iterator;
|
||||||
|
friend class workbook;
|
||||||
friend class detail::xlsx_consumer;
|
friend class detail::xlsx_consumer;
|
||||||
friend class detail::xlsx_producer;
|
friend class detail::xlsx_producer;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
void register_comments_in_manifest();
|
void register_comments_in_manifest();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
worksheet(detail::worksheet_impl *d);
|
worksheet(detail::worksheet_impl *d);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
detail::worksheet_impl *d_;
|
detail::worksheet_impl *d_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,6 @@
|
||||||
|
|
||||||
// styles
|
// styles
|
||||||
#include <xlnt/styles/alignment.hpp>
|
#include <xlnt/styles/alignment.hpp>
|
||||||
#include <xlnt/styles/base_format.hpp>
|
|
||||||
#include <xlnt/styles/border.hpp>
|
#include <xlnt/styles/border.hpp>
|
||||||
#include <xlnt/styles/border_style.hpp>
|
#include <xlnt/styles/border_style.hpp>
|
||||||
#include <xlnt/styles/color.hpp>
|
#include <xlnt/styles/color.hpp>
|
||||||
|
@ -51,7 +50,6 @@
|
||||||
#include <xlnt/styles/horizontal_alignment.hpp>
|
#include <xlnt/styles/horizontal_alignment.hpp>
|
||||||
#include <xlnt/styles/number_format.hpp>
|
#include <xlnt/styles/number_format.hpp>
|
||||||
#include <xlnt/styles/protection.hpp>
|
#include <xlnt/styles/protection.hpp>
|
||||||
#include <xlnt/styles/side.hpp>
|
|
||||||
#include <xlnt/styles/style.hpp>
|
#include <xlnt/styles/style.hpp>
|
||||||
#include <xlnt/styles/vertical_alignment.hpp>
|
#include <xlnt/styles/vertical_alignment.hpp>
|
||||||
|
|
||||||
|
|
|
@ -20,12 +20,9 @@
|
||||||
//
|
//
|
||||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||||
// @author: see AUTHORS file
|
// @author: see AUTHORS file
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// Change these values for programs using this library.
|
|
||||||
|
|
||||||
namespace xlnt {
|
|
||||||
|
|
||||||
#ifndef XLNT_API
|
#ifndef XLNT_API
|
||||||
#if !defined(XLNT_STATIC) && defined(_MSC_VER)
|
#if !defined(XLNT_STATIC) && defined(_MSC_VER)
|
||||||
#ifdef XLNT_EXPORT
|
#ifdef XLNT_EXPORT
|
||||||
|
@ -40,5 +37,3 @@ namespace xlnt {
|
||||||
#define XLNT_API
|
#define XLNT_API
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} // namespace xlnt
|
|
||||||
|
|
|
@ -21,16 +21,16 @@
|
||||||
//
|
//
|
||||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||||
// @author: see AUTHORS file
|
// @author: see AUTHORS file
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <detail/number_formatter.hpp>
|
#include <detail/number_formatter.hpp>
|
||||||
|
#include <xlnt/styles/number_format.hpp>
|
||||||
#include <xlnt/utils/datetime.hpp>
|
#include <xlnt/utils/datetime.hpp>
|
||||||
#include <xlnt/utils/exceptions.hpp>
|
#include <xlnt/utils/exceptions.hpp>
|
||||||
#include <xlnt/utils/hash_combine.hpp>
|
|
||||||
#include <xlnt/styles/number_format.hpp>
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
//
|
//
|
||||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||||
// @author: see AUTHORS file
|
// @author: see AUTHORS file
|
||||||
|
|
||||||
#include <xlnt/styles/protection.hpp>
|
#include <xlnt/styles/protection.hpp>
|
||||||
#include <xlnt/utils/hash_combine.hpp>
|
|
||||||
|
|
||||||
namespace xlnt {
|
namespace xlnt {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user