mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
clang format headers
This commit is contained in:
parent
838f358f34
commit
860ad43506
|
@ -2,9 +2,13 @@
|
|||
BasedOnStyle: LLVM
|
||||
AccessModifierOffset: -4
|
||||
AlignAfterOpenBracket: DontAlign
|
||||
AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignOperands: false
|
||||
AlignTrailingComments: false
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: false
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
AllowShortIfStatementsOnASingleLine: true
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
|
@ -21,12 +25,24 @@ BraceWrapping:
|
|||
AfterUnion: true
|
||||
BeforeCatch: true
|
||||
BeforeElse: true
|
||||
BreakBeforeBinaryOperators: NonAssignment
|
||||
BreakBeforeBraces: Custom
|
||||
ColumnLimit: 120
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||
Cpp11BracedListStyle: true
|
||||
DerivePointerAlignment: false
|
||||
DisableFormat: false
|
||||
IncludeCategories:
|
||||
- Regex: '^<xlnt/xlnt_config.hpp>$'
|
||||
Priority: 2
|
||||
- Regex: '^<xlnt/'
|
||||
Priority: 3
|
||||
- Regex: '^<detail/'
|
||||
Priority: 4
|
||||
- Regex: '^<.*>&'
|
||||
Priority: 1
|
||||
- Regex: '^".*"'
|
||||
Priority: 5
|
||||
IndentCaseLabels: false
|
||||
IndentWidth: 4
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
|
@ -35,6 +51,7 @@ NamespaceIndentation: None
|
|||
MaxEmptyLinesToKeep: 1
|
||||
PenaltyBreakComment: 1000
|
||||
PointerAlignment: Right
|
||||
SortIncludes: true
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceInEmptyParentheses: false
|
||||
|
|
|
@ -57,12 +57,12 @@ struct datetime;
|
|||
struct time;
|
||||
struct timedelta;
|
||||
|
||||
namespace detail {
|
||||
namespace detail {
|
||||
|
||||
class xlsx_consumer;
|
||||
class xlsx_producer;
|
||||
|
||||
struct cell_impl;
|
||||
struct cell_impl;
|
||||
|
||||
} // namespace detail
|
||||
|
||||
|
@ -87,7 +87,7 @@ public:
|
|||
/// Return a map of error strings such as \#DIV/0! and their associated indices.
|
||||
/// </summary>
|
||||
static const std::unordered_map<std::string, int> &error_codes();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Default copy constructor.
|
||||
/// </summary>
|
||||
|
@ -118,7 +118,7 @@ public:
|
|||
/// Set the value of this cell to the given value.
|
||||
/// Overloads exist for most C++ fundamental types like bool, int, etc. as well
|
||||
/// as for std::string and xlnt datetime types: date, time, datetime, and timedelta.
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
void value(T value);
|
||||
|
||||
|
@ -231,20 +231,20 @@ public:
|
|||
|
||||
/// <summary>
|
||||
/// Return a reference to the format applied to this cell.
|
||||
/// If this cell has no format, an invalid_attribute exception will be thrown.
|
||||
/// If this cell has no format, an invalid_attribute exception will be thrown.
|
||||
/// </summary>
|
||||
const class format format() const;
|
||||
|
||||
/// <summary>
|
||||
/// Applies the cell-level formatting of new_format to this cell.
|
||||
/// </summary>
|
||||
|
||||
/// <summary>
|
||||
/// Applies the cell-level formatting of new_format to this cell.
|
||||
/// </summary>
|
||||
void format(const class format new_format);
|
||||
|
||||
/// <summary>
|
||||
/// Remove the cell-level formatting from this cell.
|
||||
/// This doesn't affect the style that may also be applied to the cell.
|
||||
/// Throws an invalid_attribute exception if no format is applied.
|
||||
/// </summary>
|
||||
|
||||
/// <summary>
|
||||
/// Remove the cell-level formatting from this cell.
|
||||
/// This doesn't affect the style that may also be applied to the cell.
|
||||
/// Throws an invalid_attribute exception if no format is applied.
|
||||
/// </summary>
|
||||
void clear_format();
|
||||
|
||||
/// <summary>
|
||||
|
@ -252,10 +252,10 @@ public:
|
|||
/// </summary>
|
||||
class number_format number_format() const;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new format in the workbook, sets its number_format
|
||||
/// to the given format, and applies the format to this cell.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Creates a new format in the workbook, sets its number_format
|
||||
/// to the given format, and applies the format to this cell.
|
||||
/// </summary>
|
||||
void number_format(const class number_format &format);
|
||||
|
||||
/// <summary>
|
||||
|
@ -263,10 +263,10 @@ public:
|
|||
/// </summary>
|
||||
class font font() const;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new format in the workbook, sets its font
|
||||
/// to the given font, and applies the format to this cell.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Creates a new format in the workbook, sets its font
|
||||
/// to the given font, and applies the format to this cell.
|
||||
/// </summary>
|
||||
void font(const class font &font_);
|
||||
|
||||
/// <summary>
|
||||
|
@ -274,10 +274,10 @@ public:
|
|||
/// </summary>
|
||||
class fill fill() const;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new format in the workbook, sets its fill
|
||||
/// to the given fill, and applies the format to this cell.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Creates a new format in the workbook, sets its fill
|
||||
/// to the given fill, and applies the format to this cell.
|
||||
/// </summary>
|
||||
void fill(const class fill &fill_);
|
||||
|
||||
/// <summary>
|
||||
|
@ -285,10 +285,10 @@ public:
|
|||
/// </summary>
|
||||
class border border() const;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new format in the workbook, sets its border
|
||||
/// to the given border, and applies the format to this cell.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Creates a new format in the workbook, sets its border
|
||||
/// to the given border, and applies the format to this cell.
|
||||
/// </summary>
|
||||
void border(const class border &border_);
|
||||
|
||||
/// <summary>
|
||||
|
@ -296,10 +296,10 @@ public:
|
|||
/// </summary>
|
||||
class alignment alignment() const;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new format in the workbook, sets its alignment
|
||||
/// to the given alignment, and applies the format to this cell.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Creates a new format in the workbook, sets its alignment
|
||||
/// to the given alignment, and applies the format to this cell.
|
||||
/// </summary>
|
||||
void alignment(const class alignment &alignment_);
|
||||
|
||||
/// <summary>
|
||||
|
@ -313,58 +313,58 @@ public:
|
|||
/// </summary>
|
||||
void protection(const class protection &protection_);
|
||||
|
||||
// style
|
||||
// style
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this cell has had a style applied to it.
|
||||
/// </summary>
|
||||
bool has_style() const;
|
||||
/// <summary>
|
||||
/// Returns true if this cell has had a style applied to it.
|
||||
/// </summary>
|
||||
bool has_style() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns a wrapper pointing to the named style applied to this cell.
|
||||
/// </summary>
|
||||
const class style style() const;
|
||||
/// <summary>
|
||||
/// Returns a wrapper pointing to the named style applied to this cell.
|
||||
/// </summary>
|
||||
const class style style() const;
|
||||
|
||||
/// <summary>
|
||||
/// Equivalent to style(new_style.name())
|
||||
/// </summary>
|
||||
void style(const class style &new_style);
|
||||
/// <summary>
|
||||
/// Equivalent to style(new_style.name())
|
||||
/// </summary>
|
||||
void style(const class style &new_style);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the named style applied to this cell to a style named style_name.
|
||||
/// If this style has not been previously created in the workbook, a
|
||||
/// key_not_found exception will be thrown.
|
||||
/// </summary>
|
||||
void style(const std::string &style_name);
|
||||
/// <summary>
|
||||
/// Sets the named style applied to this cell to a style named style_name.
|
||||
/// If this style has not been previously created in the workbook, a
|
||||
/// key_not_found exception will be thrown.
|
||||
/// </summary>
|
||||
void style(const std::string &style_name);
|
||||
|
||||
/// <summary>
|
||||
/// Removes the named style from this cell.
|
||||
/// An invalid_attribute exception will be thrown if this cell has no style.
|
||||
/// This will not affect the cell format of the cell.
|
||||
/// </summary>
|
||||
void clear_style();
|
||||
/// <summary>
|
||||
/// Removes the named style from this cell.
|
||||
/// An invalid_attribute exception will be thrown if this cell has no style.
|
||||
/// This will not affect the cell format of the cell.
|
||||
/// </summary>
|
||||
void clear_style();
|
||||
|
||||
// formula
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string representation of the formula applied to this cell.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Returns the string representation of the formula applied to this cell.
|
||||
/// </summary>
|
||||
std::string formula() const;
|
||||
|
||||
/// <summary>
|
||||
/// Sets the formula of this cell to the given value.
|
||||
/// This formula string should begin with '='.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Sets the formula of this cell to the given value.
|
||||
/// This formula string should begin with '='.
|
||||
/// </summary>
|
||||
void formula(const std::string &formula);
|
||||
|
||||
/// <summary>
|
||||
/// Removes the formula from this cell. After this is called, has_formula() will return false.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Removes the formula from this cell. After this is called, has_formula() will return false.
|
||||
/// </summary>
|
||||
void clear_formula();
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this cell has had a formula applied to it.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Returns true if this cell has had a formula applied to it.
|
||||
/// </summary>
|
||||
bool has_formula() const;
|
||||
|
||||
// printing
|
||||
|
@ -491,16 +491,16 @@ private:
|
|||
// make these friends so they can use the private constructor
|
||||
friend class style;
|
||||
friend class worksheet;
|
||||
friend class detail::xlsx_consumer;
|
||||
friend class detail::xlsx_producer;
|
||||
friend class detail::xlsx_consumer;
|
||||
friend class detail::xlsx_producer;
|
||||
friend struct detail::cell_impl;
|
||||
|
||||
/// <summary>
|
||||
/// Returns a non-const reference to the format of this cell.
|
||||
/// This is for internal use only.
|
||||
/// </summary>
|
||||
class format modifiable_format();
|
||||
|
||||
/// <summary>
|
||||
/// Returns a non-const reference to the format of this cell.
|
||||
/// This is for internal use only.
|
||||
/// </summary>
|
||||
class format modifiable_format();
|
||||
|
||||
/// <summary>
|
||||
/// Delete default zero-argument constructor.
|
||||
/// </summary>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
@ -41,7 +42,7 @@ class range_reference;
|
|||
struct XLNT_API cell_reference_hash
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
std::size_t operator()(const cell_reference &k) const;
|
||||
};
|
||||
|
@ -191,7 +192,7 @@ public:
|
|||
/// cell_reference("A", 1), cell_reference("B", 1) will return
|
||||
/// range_reference(cell_reference("A", 1), cell_reference("B", 1))
|
||||
/// </summary>
|
||||
range_reference operator, (const cell_reference &other) const;
|
||||
range_reference operator,(const cell_reference &other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true if this reference is identical to comparand including
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
@ -54,7 +55,7 @@ public:
|
|||
/// Return the text that will be displayed for this comment.
|
||||
/// </summary>
|
||||
formatted_text text() const;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Return the plain text that will be displayed for this comment without formatting information.
|
||||
/// </summary>
|
||||
|
@ -74,7 +75,7 @@ public:
|
|||
/// Make this comment always visible.
|
||||
/// </summary>
|
||||
void show();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this comment is not hidden.
|
||||
/// </summary>
|
||||
|
@ -84,12 +85,12 @@ public:
|
|||
/// Set the absolute position of this cell to the given coordinates.
|
||||
/// </summary>
|
||||
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;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the distance from the top of the sheet to the top of the comment.
|
||||
/// </summary>
|
||||
|
@ -99,12 +100,12 @@ public:
|
|||
/// Set the size of the comment.
|
||||
/// </summary>
|
||||
void size(int width, int height);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the width of this comment.
|
||||
/// </summary>
|
||||
int width() const;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the height of this comment.
|
||||
/// </summary>
|
||||
|
@ -120,17 +121,17 @@ private:
|
|||
/// The formatted textual content in this cell displayed directly after the author.
|
||||
/// </summary>
|
||||
formatted_text text_;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The name of the person that created this comment.
|
||||
/// </summary>
|
||||
std::string author_;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// True if this comment is not hidden.
|
||||
/// </summary>
|
||||
bool visible_ = false;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The fill color
|
||||
/// </summary>
|
||||
|
@ -140,7 +141,7 @@ private:
|
|||
/// Distance from the left side of the sheet.
|
||||
/// </summary>
|
||||
int left_ = 0;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Distance from the top of the sheet.
|
||||
/// </summary>
|
||||
|
@ -150,7 +151,7 @@ private:
|
|||
/// Width of the comment box.
|
||||
/// </summary>
|
||||
int width_ = 0;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Height of the comment box.
|
||||
/// </summary>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
@ -57,7 +58,7 @@ public:
|
|||
/// Returns a copy of the individual runs that comprise this text.
|
||||
/// </summary>
|
||||
std::vector<text_run> runs() const;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Set the runs of this text all at once.
|
||||
/// </summary>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <algorithm>
|
||||
|
@ -47,7 +48,7 @@ class XLNT_API column_t
|
|||
{
|
||||
public:
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
using index_t = std::uint32_t;
|
||||
|
||||
|
@ -234,27 +235,27 @@ public:
|
|||
/// <summary>
|
||||
/// Return the result of adding rhs to this column.
|
||||
/// </summary>
|
||||
friend XLNT_API column_t operator+(column_t lhs, const column_t& rhs);
|
||||
friend XLNT_API column_t operator+(column_t lhs, const column_t &rhs);
|
||||
|
||||
/// <summary>
|
||||
/// Return the result of subtracing lhs by rhs column.
|
||||
/// </summary>
|
||||
friend XLNT_API column_t operator-(column_t lhs, const column_t& rhs);
|
||||
friend XLNT_API column_t operator-(column_t lhs, const column_t &rhs);
|
||||
|
||||
/// <summary>
|
||||
/// Return the result of multiply lhs by rhs column.
|
||||
/// </summary>
|
||||
friend XLNT_API column_t operator*(column_t lhs, const column_t& rhs);
|
||||
friend XLNT_API column_t operator*(column_t lhs, const column_t &rhs);
|
||||
|
||||
/// <summary>
|
||||
/// Return the result of divide lhs by rhs column.
|
||||
/// </summary>
|
||||
friend XLNT_API column_t operator/(column_t lhs, const column_t& rhs);
|
||||
friend XLNT_API column_t operator/(column_t lhs, const column_t &rhs);
|
||||
|
||||
/// <summary>
|
||||
/// Return the result of mod lhs by rhs column.
|
||||
/// </summary>
|
||||
friend XLNT_API column_t operator%(column_t lhs, const column_t& rhs);
|
||||
friend XLNT_API column_t operator%(column_t lhs, const column_t &rhs);
|
||||
|
||||
/// <summary>
|
||||
/// Add rhs to this column and return a reference to this column.
|
||||
|
@ -319,7 +320,7 @@ public:
|
|||
struct XLNT_API column_hash
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
std::size_t operator()(const column_t &k) const;
|
||||
};
|
||||
|
@ -339,7 +340,7 @@ struct hash<xlnt::column_t>
|
|||
/// </summary>
|
||||
size_t operator()(const xlnt::column_t &k) const
|
||||
{
|
||||
static xlnt::column_hash hasher;
|
||||
static xlnt::column_hash hasher;
|
||||
return hasher(k);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
@ -31,38 +32,38 @@
|
|||
|
||||
namespace xlnt {
|
||||
|
||||
//todo: should this just be a struct?
|
||||
// todo: should this just be a struct?
|
||||
|
||||
/// <summary>
|
||||
/// A formatted string
|
||||
/// </summary>
|
||||
class XLNT_API text_run
|
||||
class XLNT_API text_run
|
||||
{
|
||||
public:
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
text_run();
|
||||
text_run();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
text_run(const std::string &string);
|
||||
text_run(const std::string &string);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool has_formatting() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string string() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void string(const std::string &string);
|
||||
std::string string() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void string(const std::string &string);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -173,7 +174,7 @@ private:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string string_;
|
||||
std::string string_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
@ -39,150 +40,150 @@ namespace xlnt {
|
|||
class XLNT_API manifest
|
||||
{
|
||||
public:
|
||||
/// <summary>
|
||||
/// Unregisters all default and override type and all relationships and known parts.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Unregisters all default and override type and all relationships and known parts.
|
||||
/// </summary>
|
||||
void clear();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the path to all internal package parts registered as a source
|
||||
/// or target of a relationship.
|
||||
/// </summary>
|
||||
std::vector<path> parts() const;
|
||||
|
||||
// Relationships
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the manifest contains a relationship with the given type with part as the source.
|
||||
/// </summary>
|
||||
bool has_relationship(const path &source, relationship_type type) const;
|
||||
std::vector<path> parts() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the manifest contains a relationship with the given type with part as the source.
|
||||
/// </summary>
|
||||
bool has_relationship(const path &source, const std::string &rel_id) const;
|
||||
// Relationships
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the manifest contains a relationship with the given type with part as the source.
|
||||
/// </summary>
|
||||
bool has_relationship(const path &source, relationship_type type) const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the manifest contains a relationship with the given type with part as the source.
|
||||
/// </summary>
|
||||
bool has_relationship(const path &source, const std::string &rel_id) const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the relationship with "source" as the source and with a type of "type".
|
||||
/// Throws a key_not_found exception if no such relationship is found.
|
||||
/// </summary>
|
||||
class relationship relationship(const path &source, relationship_type type) const;
|
||||
class relationship relationship(const path &source, relationship_type type) const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the relationship with "source" as the source and with an ID of "rel_id".
|
||||
/// Throws a key_not_found exception if no such relationship is found.
|
||||
/// </summary>
|
||||
class relationship relationship(const path &source, const std::string &rel_id) const;
|
||||
class relationship relationship(const path &source, const std::string &rel_id) const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns all relationship with "source" as the source.
|
||||
/// </summary>
|
||||
std::vector<xlnt::relationship> relationships(const path &source) const;
|
||||
std::vector<xlnt::relationship> relationships(const path &source) const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns all relationships with "source" as the source and with a type of "type".
|
||||
/// </summary>
|
||||
std::vector<xlnt::relationship> relationships(const path &source, relationship_type type) const;
|
||||
|
||||
std::vector<xlnt::relationship> relationships(const path &source, relationship_type type) const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the canonical path of the chain of relationships by traversing through rels
|
||||
/// and forming the absolute combined path.
|
||||
/// </summary>
|
||||
path canonicalize(const std::vector<xlnt::relationship> &rels) const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string register_relationship(const uri &source, relationship_type type, const uri &target, target_mode mode);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string register_relationship(const uri &source, relationship_type type, const uri &target, target_mode mode);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string register_relationship(const uri &source, relationship_type type, const uri &target, target_mode mode, const std::string &rel_id);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string register_relationship(const class relationship &rel);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void unregister_relationship(const uri &source, const std::string &rel_id);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void unregister_relationship(const uri &source, const std::string &rel_id);
|
||||
|
||||
// Content Types
|
||||
|
||||
/// <summary>
|
||||
/// Given the path to a part, returns the content type of the part as a string.
|
||||
/// </summary>
|
||||
std::string content_type(const path &part) const;
|
||||
/// <summary>
|
||||
/// Given the path to a part, returns the content type of the part as a string.
|
||||
/// </summary>
|
||||
std::string content_type(const path &part) const;
|
||||
|
||||
// Default Content Types
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if a default content type for the extension has been registered.
|
||||
/// </summary>
|
||||
bool has_default_type(const std::string &extension) const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns a vector of all extensions with registered default content types.
|
||||
/// </summary>
|
||||
std::vector<std::string> extensions_with_default_types() const;
|
||||
/// <summary>
|
||||
/// Returns true if a default content type for the extension has been registered.
|
||||
/// </summary>
|
||||
bool has_default_type(const std::string &extension) const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the registered default content type for parts of the given extension.
|
||||
/// </summary>
|
||||
std::string default_type(const std::string &extension) const;
|
||||
/// <summary>
|
||||
/// Returns a vector of all extensions with registered default content types.
|
||||
/// </summary>
|
||||
std::vector<std::string> extensions_with_default_types() const;
|
||||
|
||||
/// <summary>
|
||||
/// Associates the given extension with the given content type.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Returns the registered default content type for parts of the given extension.
|
||||
/// </summary>
|
||||
std::string default_type(const std::string &extension) const;
|
||||
|
||||
/// <summary>
|
||||
/// Associates the given extension with the given content type.
|
||||
/// </summary>
|
||||
void register_default_type(const std::string &extension, const std::string &type);
|
||||
|
||||
/// <summary>
|
||||
/// Unregisters the default content type for the given extension.
|
||||
/// </summary>
|
||||
void unregister_default_type(const std::string &extension);
|
||||
|
||||
/// <summary>
|
||||
/// Unregisters the default content type for the given extension.
|
||||
/// </summary>
|
||||
void unregister_default_type(const std::string &extension);
|
||||
|
||||
// Override Content Types
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if a content type overriding the default content type has been registered
|
||||
/// <summary>
|
||||
/// Returns true if a content type overriding the default content type has been registered
|
||||
/// for the given part.
|
||||
/// </summary>
|
||||
bool has_override_type(const path &part) const;
|
||||
/// </summary>
|
||||
bool has_override_type(const path &part) const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the override content type registered for the given part.
|
||||
/// Throws key_not_found exception if no override type was found.
|
||||
/// </summary>
|
||||
std::string override_type(const path &part) const;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the path of every part in this manifest with an overriden content type.
|
||||
/// </summary>
|
||||
std::vector<path> parts_with_overriden_types() const;
|
||||
std::vector<path> parts_with_overriden_types() const;
|
||||
|
||||
/// <summary>
|
||||
/// Overrides any default type registered for the part's extension with the given content type.
|
||||
/// </summary>
|
||||
void register_override_type(const path &part, const std::string &type);
|
||||
void register_override_type(const path &part, const std::string &type);
|
||||
|
||||
/// <summary>
|
||||
/// Unregisters the overriding content type of the given part.
|
||||
/// </summary>
|
||||
void unregister_override_type(const path &part);
|
||||
/// <summary>
|
||||
/// Unregisters the overriding content type of the given part.
|
||||
/// </summary>
|
||||
void unregister_override_type(const path &part);
|
||||
|
||||
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>
|
||||
///
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
@ -36,10 +37,10 @@ namespace xlnt {
|
|||
/// </summary>
|
||||
enum class XLNT_API target_mode
|
||||
{
|
||||
/// <summary>
|
||||
/// The relationship references a resource that is external to the package.
|
||||
/// </summary>
|
||||
internal,
|
||||
/// <summary>
|
||||
/// The relationship references a resource that is external to the package.
|
||||
/// </summary>
|
||||
internal,
|
||||
/// <summary>
|
||||
/// The relationship references a part that is inside the package.
|
||||
/// </summary>
|
||||
|
@ -53,44 +54,44 @@ enum class XLNT_API relationship_type
|
|||
{
|
||||
unknown,
|
||||
|
||||
// Package
|
||||
core_properties,
|
||||
extended_properties,
|
||||
custom_properties,
|
||||
office_document,
|
||||
thumbnail,
|
||||
printer_settings,
|
||||
// Package
|
||||
core_properties,
|
||||
extended_properties,
|
||||
custom_properties,
|
||||
office_document,
|
||||
thumbnail,
|
||||
printer_settings,
|
||||
|
||||
// SpreadsheetML
|
||||
calculation_chain,
|
||||
chartsheet,
|
||||
comments,
|
||||
connections,
|
||||
custom_property,
|
||||
custom_xml_mappings,
|
||||
dialogsheet,
|
||||
drawings,
|
||||
external_workbook_references,
|
||||
metadata,
|
||||
pivot_table,
|
||||
pivot_table_cache_definition,
|
||||
pivot_table_cache_records,
|
||||
query_table,
|
||||
shared_string_table,
|
||||
shared_workbook_revision_headers,
|
||||
shared_workbook,
|
||||
theme,
|
||||
revision_log,
|
||||
shared_workbook_user_data,
|
||||
single_cell_table_definitions,
|
||||
stylesheet,
|
||||
table_definition,
|
||||
// SpreadsheetML
|
||||
calculation_chain,
|
||||
chartsheet,
|
||||
comments,
|
||||
connections,
|
||||
custom_property,
|
||||
custom_xml_mappings,
|
||||
dialogsheet,
|
||||
drawings,
|
||||
external_workbook_references,
|
||||
metadata,
|
||||
pivot_table,
|
||||
pivot_table_cache_definition,
|
||||
pivot_table_cache_records,
|
||||
query_table,
|
||||
shared_string_table,
|
||||
shared_workbook_revision_headers,
|
||||
shared_workbook,
|
||||
theme,
|
||||
revision_log,
|
||||
shared_workbook_user_data,
|
||||
single_cell_table_definitions,
|
||||
stylesheet,
|
||||
table_definition,
|
||||
vml_drawing,
|
||||
volatile_dependencies,
|
||||
worksheet,
|
||||
volatile_dependencies,
|
||||
worksheet,
|
||||
|
||||
hyperlink,
|
||||
image
|
||||
hyperlink,
|
||||
image
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
@ -108,17 +109,18 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
relationship(const std::string &id, relationship_type t, const uri &source, const uri &target, xlnt::target_mode mode);
|
||||
relationship(
|
||||
const std::string &id, relationship_type t, const uri &source, const uri &target, xlnt::target_mode mode);
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string of the form rId# that identifies the relationship.
|
||||
/// </summary>
|
||||
std::string id() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the type of this relationship.
|
||||
/// </summary>
|
||||
relationship_type type() const;
|
||||
/// <summary>
|
||||
/// Returns the type of this relationship.
|
||||
/// </summary>
|
||||
relationship_type type() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether the target of the relationship is internal or external to the package.
|
||||
|
@ -135,21 +137,21 @@ public:
|
|||
/// </summary>
|
||||
uri target() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if and only if rhs is equal to this relationship.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Returns true if and only if rhs is equal to this relationship.
|
||||
/// </summary>
|
||||
bool operator==(const relationship &rhs) const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if and only if rhs is not equal to this relationship.
|
||||
/// </summary>
|
||||
bool operator!=(const relationship &rhs) const;
|
||||
/// <summary>
|
||||
/// Returns true if and only if rhs is not equal to this relationship.
|
||||
/// </summary>
|
||||
bool operator!=(const relationship &rhs) const;
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string id_;
|
||||
std::string id_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
@ -154,7 +155,7 @@ public:
|
|||
///
|
||||
/// </summary>
|
||||
friend XLNT_API bool operator==(const uri &left, const uri &right);
|
||||
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
///
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
|
@ -39,12 +40,12 @@ 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>
|
||||
///
|
||||
|
@ -54,27 +55,27 @@ public:
|
|||
/// <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>
|
||||
///
|
||||
|
@ -84,7 +85,7 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
alignment &horizontal(horizontal_alignment horizontal);
|
||||
alignment &horizontal(horizontal_alignment horizontal);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -104,15 +105,18 @@ public:
|
|||
/// <summary>
|
||||
/// Returns true if left is not exactly equal to right.
|
||||
/// </summary>
|
||||
XLNT_API friend bool operator!=(const alignment &left, const alignment &right) { return !(left == right); }
|
||||
XLNT_API friend bool operator!=(const alignment &left, const alignment &right)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
|
||||
private:
|
||||
optional<bool> shrink_to_fit_;
|
||||
optional<bool> wrap_text_;
|
||||
optional<int> indent_;
|
||||
optional<int> text_rotation_;
|
||||
optional<horizontal_alignment> horizontal_ = horizontal_alignment::general;
|
||||
optional<vertical_alignment> vertical_ = vertical_alignment::bottom;
|
||||
optional<bool> shrink_to_fit_;
|
||||
optional<bool> wrap_text_;
|
||||
optional<int> indent_;
|
||||
optional<int> text_rotation_;
|
||||
optional<horizontal_alignment> horizontal_ = horizontal_alignment::general;
|
||||
optional<vertical_alignment> vertical_ = vertical_alignment::bottom;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
|
@ -41,13 +42,13 @@ namespace xlnt {
|
|||
/// </summary>
|
||||
enum class XLNT_API border_side
|
||||
{
|
||||
start,
|
||||
end,
|
||||
top,
|
||||
bottom,
|
||||
diagonal,
|
||||
vertical,
|
||||
horizontal
|
||||
start,
|
||||
end,
|
||||
top,
|
||||
bottom,
|
||||
diagonal,
|
||||
vertical,
|
||||
horizontal
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
||||
|
@ -63,80 +64,83 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
class XLNT_API border_property
|
||||
{
|
||||
public:
|
||||
class XLNT_API border_property
|
||||
{
|
||||
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>
|
||||
/// Returns true if left is exactly equal to right.
|
||||
/// </summary>
|
||||
friend bool operator==(const border_property &left, const border_property &right);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if left is not exactly equal to right.
|
||||
/// </summary>
|
||||
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>
|
||||
/// Returns true if left is exactly equal to right.
|
||||
|
@ -146,50 +150,53 @@ public:
|
|||
/// <summary>
|
||||
/// Returns true if left is not exactly equal to right.
|
||||
/// </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:
|
||||
/// <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_;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
|
@ -37,25 +38,25 @@ class XLNT_API indexed_color
|
|||
{
|
||||
public:
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
indexed_color(std::size_t index);
|
||||
indexed_color(std::size_t index);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
std::size_t index() const;
|
||||
std::size_t index() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
void index(std::size_t index);
|
||||
void index(std::size_t index);
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
std::size_t index_;
|
||||
std::size_t index_;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
@ -65,25 +66,25 @@ class XLNT_API theme_color
|
|||
{
|
||||
public:
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
theme_color(std::size_t index);
|
||||
theme_color(std::size_t index);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
std::size_t index() const;
|
||||
std::size_t index() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
void index(std::size_t index);
|
||||
void index(std::size_t index);
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
std::size_t index_;
|
||||
std::size_t index_;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
@ -93,60 +94,60 @@ class XLNT_API rgb_color
|
|||
{
|
||||
public:
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
rgb_color(const std::string &hex_string);
|
||||
rgb_color(const std::string &hex_string);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
rgb_color(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
|
||||
rgb_color(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
std::string hex_string() const;
|
||||
std::string hex_string() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
std::uint8_t red() const;
|
||||
std::uint8_t red() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
std::uint8_t green() const;
|
||||
std::uint8_t green() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
std::uint8_t blue() const;
|
||||
std::uint8_t blue() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
std::uint8_t alpha() const;
|
||||
std::uint8_t alpha() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
std::array<std::uint8_t, 3> rgb() const;
|
||||
std::array<std::uint8_t, 3> rgb() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
std::array<std::uint8_t, 4> rgba() const;
|
||||
std::array<std::uint8_t, 4> rgba() const;
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
static std::array<std::uint8_t, 4> decode_hex_string(const std::string &hex_string);
|
||||
static std::array<std::uint8_t, 4> decode_hex_string(const std::string &hex_string);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
std::array<std::uint8_t, 4> rgba_;
|
||||
std::array<std::uint8_t, 4> rgba_;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
@ -218,32 +219,32 @@ public:
|
|||
/// <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>
|
||||
color_type type() const;
|
||||
color_type type() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool is_auto() const;
|
||||
bool is_auto() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -253,7 +254,7 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
const rgb_color &rgb() const;
|
||||
const rgb_color &rgb() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -268,12 +269,12 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
double tint() const;
|
||||
double tint() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void tint(double tint);
|
||||
void tint(double tint);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -283,41 +284,44 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool operator!=(const color &other) const { return !(*this == other); }
|
||||
bool operator!=(const color &other) const
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void assert_type(color_type t) const;
|
||||
void assert_type(color_type t) const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
color_type type_;
|
||||
color_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_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
bool auto__;
|
||||
};
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <unordered_map>
|
||||
|
@ -36,25 +37,25 @@ namespace xlnt {
|
|||
/// </summary>
|
||||
enum class XLNT_API pattern_fill_type
|
||||
{
|
||||
none,
|
||||
solid,
|
||||
mediumgray,
|
||||
darkgray,
|
||||
lightgray,
|
||||
darkhorizontal,
|
||||
darkvertical,
|
||||
darkdown,
|
||||
darkup,
|
||||
darkgrid,
|
||||
darktrellis,
|
||||
lighthorizontal,
|
||||
lightvertical,
|
||||
lightdown,
|
||||
lightup,
|
||||
lightgrid,
|
||||
lighttrellis,
|
||||
gray125,
|
||||
gray0625
|
||||
none,
|
||||
solid,
|
||||
mediumgray,
|
||||
darkgray,
|
||||
lightgray,
|
||||
darkhorizontal,
|
||||
darkvertical,
|
||||
darkdown,
|
||||
darkup,
|
||||
darkgrid,
|
||||
darktrellis,
|
||||
lighthorizontal,
|
||||
lightvertical,
|
||||
lightdown,
|
||||
lightup,
|
||||
lightgrid,
|
||||
lighttrellis,
|
||||
gray125,
|
||||
gray0625
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
@ -71,22 +72,22 @@ public:
|
|||
/// <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>
|
||||
///
|
||||
|
@ -96,7 +97,7 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
pattern_fill &background(const color &background);
|
||||
pattern_fill &background(const color &background);
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if left is exactly equal to right.
|
||||
|
@ -106,13 +107,16 @@ public:
|
|||
/// <summary>
|
||||
/// Returns true if left is not exactly equal to right.
|
||||
/// </summary>
|
||||
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:
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
pattern_fill_type type_ = pattern_fill_type::none;
|
||||
pattern_fill_type type_ = pattern_fill_type::none;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -130,8 +134,8 @@ private:
|
|||
/// </summary>
|
||||
enum class XLNT_API gradient_fill_type
|
||||
{
|
||||
linear,
|
||||
path
|
||||
linear,
|
||||
path
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
@ -150,14 +154,14 @@ public:
|
|||
/// </summary>
|
||||
gradient_fill_type type() const;
|
||||
|
||||
// Type
|
||||
// Type
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
gradient_fill &type(gradient_fill_type new_type);
|
||||
|
||||
// Degree
|
||||
// Degree
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -169,7 +173,7 @@ public:
|
|||
/// </summary>
|
||||
double degree() const;
|
||||
|
||||
// Left
|
||||
// Left
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -179,9 +183,9 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
gradient_fill &left(double value);
|
||||
gradient_fill &left(double value);
|
||||
|
||||
// Right
|
||||
// Right
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -191,9 +195,9 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
gradient_fill &right(double value);
|
||||
gradient_fill &right(double value);
|
||||
|
||||
// Top
|
||||
// Top
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -203,9 +207,9 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
gradient_fill &top(double value);
|
||||
gradient_fill &top(double value);
|
||||
|
||||
// Bottom
|
||||
// Bottom
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -215,25 +219,25 @@ public:
|
|||
/// <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;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if left is exactly equal to right.
|
||||
/// </summary>
|
||||
|
@ -242,7 +246,10 @@ public:
|
|||
/// <summary>
|
||||
/// Returns true if left is not exactly equal to right.
|
||||
/// </summary>
|
||||
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:
|
||||
/// <summary>
|
||||
|
@ -278,7 +285,7 @@ private:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::unordered_map<double, color> stops_;
|
||||
std::unordered_map<double, color> stops_;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
@ -286,8 +293,8 @@ private:
|
|||
/// </summary>
|
||||
enum class XLNT_API fill_type
|
||||
{
|
||||
pattern,
|
||||
gradient
|
||||
pattern,
|
||||
gradient
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
@ -296,47 +303,47 @@ enum class XLNT_API fill_type
|
|||
class XLNT_API fill
|
||||
{
|
||||
public:
|
||||
/// <summary>
|
||||
/// Helper method for the most common use case, setting the fill color of a cell to a single solid color.
|
||||
/// The foreground and background colors of a fill are not the same as the foreground and background colors
|
||||
/// of a cell. When setting a fill color in Excel, a new fill is created with the given color as the fill's
|
||||
/// fgColor and index color number 64 as the bgColor. This method creates a fill in the same way.
|
||||
/// </summary>
|
||||
static fill solid(const color &fill_color);
|
||||
/// <summary>
|
||||
/// Helper method for the most common use case, setting the fill color of a cell to a single solid color.
|
||||
/// The foreground and background colors of a fill are not the same as the foreground and background colors
|
||||
/// of a cell. When setting a fill color in Excel, a new fill is created with the given color as the fill's
|
||||
/// fgColor and index color number 64 as the bgColor. This method creates a fill in the same way.
|
||||
/// </summary>
|
||||
static fill solid(const color &fill_color);
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a fill initialized as a none-type pattern fill with no
|
||||
/// foreground or background colors.
|
||||
/// </summary>
|
||||
fill();
|
||||
/// <summary>
|
||||
/// Constructs a fill initialized as a none-type pattern fill with no
|
||||
/// foreground or background colors.
|
||||
/// </summary>
|
||||
fill();
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a fill initialized as a pattern fill based on the given pattern.
|
||||
/// </summary>
|
||||
fill(const pattern_fill &pattern);
|
||||
/// <summary>
|
||||
/// Constructs a fill initialized as a pattern fill based on the given pattern.
|
||||
/// </summary>
|
||||
fill(const pattern_fill &pattern);
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a fill initialized as a gradient fill based on the given gradient.
|
||||
/// </summary>
|
||||
fill(const gradient_fill &gradient);
|
||||
/// <summary>
|
||||
/// Constructs a fill initialized as a gradient fill based on the given gradient.
|
||||
/// </summary>
|
||||
fill(const gradient_fill &gradient);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the fill_type of this fill depending on how it was constructed.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Returns the fill_type of this fill depending on how it was constructed.
|
||||
/// </summary>
|
||||
fill_type type() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the gradient fill represented by this fill.
|
||||
/// Throws an invalid_attribute exception if this is not a gradient fill.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Returns the gradient fill represented by this fill.
|
||||
/// Throws an invalid_attribute exception if this is not a gradient fill.
|
||||
/// </summary>
|
||||
class gradient_fill gradient_fill() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the pattern fill represented by this fill.
|
||||
/// Throws an invalid_attribute exception if this is not a pattern fill.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Returns the pattern fill represented by this fill.
|
||||
/// Throws an invalid_attribute exception if this is not a pattern fill.
|
||||
/// </summary>
|
||||
class pattern_fill pattern_fill() const;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if left is exactly equal to right.
|
||||
/// </summary>
|
||||
|
@ -345,7 +352,10 @@ public:
|
|||
/// <summary>
|
||||
/// Returns true if left is not exactly equal to right.
|
||||
/// </summary>
|
||||
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:
|
||||
/// <summary>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
@ -69,12 +70,12 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
font &superscript(bool superscript);
|
||||
font &superscript(bool superscript);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool superscript() const;
|
||||
bool superscript() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -154,7 +155,7 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
xlnt::color color() const;
|
||||
xlnt::color color() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -169,7 +170,7 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::size_t family() const;
|
||||
std::size_t family() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -185,16 +186,19 @@ public:
|
|||
///
|
||||
/// </summary>
|
||||
std::string scheme() const;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if left is exactly equal to right.
|
||||
/// </summary>
|
||||
XLNT_API friend bool operator==(const font &left, const font &right);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if left is not exactly equal to right.
|
||||
/// </summary>
|
||||
XLNT_API friend bool operator!=(const font &left, const font &right) { return !(left == right); }
|
||||
XLNT_API friend bool operator!=(const font &left, const font &right)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
|
||||
private:
|
||||
friend class style;
|
||||
|
@ -237,22 +241,22 @@ private:
|
|||
/// <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_;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
|
@ -53,24 +54,24 @@ 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>
|
||||
///
|
||||
|
@ -82,17 +83,17 @@ public:
|
|||
/// <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>
|
||||
///
|
||||
|
@ -104,17 +105,17 @@ public:
|
|||
/// <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>
|
||||
///
|
||||
|
@ -126,17 +127,17 @@ public:
|
|||
/// <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>
|
||||
///
|
||||
|
@ -148,17 +149,17 @@ public:
|
|||
/// <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>
|
||||
///
|
||||
|
@ -170,17 +171,17 @@ public:
|
|||
/// <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>
|
||||
///
|
||||
|
@ -192,7 +193,7 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool has_style() const;
|
||||
bool has_style() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -202,31 +203,31 @@ public:
|
|||
/// <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:
|
||||
friend struct detail::stylesheet;
|
||||
friend struct detail::stylesheet;
|
||||
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_;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
@ -246,7 +247,10 @@ public:
|
|||
/// <summary>
|
||||
/// Returns true if left is not exactly equal to right.
|
||||
/// </summary>
|
||||
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:
|
||||
/// <summary>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
|
@ -39,22 +40,22 @@ 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>
|
||||
///
|
||||
|
@ -80,7 +81,7 @@ public:
|
|||
///
|
||||
/// </summary>
|
||||
protection &hidden(bool hidden);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if left is exactly equal to right.
|
||||
/// </summary>
|
||||
|
@ -89,7 +90,10 @@ public:
|
|||
/// <summary>
|
||||
/// Returns true if left is not exactly equal to right.
|
||||
/// </summary>
|
||||
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:
|
||||
/// <summary>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
@ -80,17 +81,17 @@ public:
|
|||
/// <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>
|
||||
///
|
||||
|
@ -100,7 +101,7 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
style builtin_id(std::size_t builtin_id);
|
||||
style builtin_id(std::size_t builtin_id);
|
||||
|
||||
// Formatting components
|
||||
|
||||
|
@ -112,12 +113,12 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
const class alignment &alignment() const;
|
||||
const class alignment &alignment() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
style alignment(const xlnt::alignment &new_alignment, bool applied = true);
|
||||
style alignment(const xlnt::alignment &new_alignment, bool applied = true);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -127,17 +128,17 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
class border &border();
|
||||
class border &border();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
const class border &border() const;
|
||||
const class border &border() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
style border(const xlnt::border &new_border, bool applied = true);
|
||||
style border(const xlnt::border &new_border, bool applied = true);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -147,17 +148,17 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
class fill &fill();
|
||||
class fill &fill();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
const class fill &fill() const;
|
||||
const class fill &fill() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
style fill(const xlnt::fill &new_fill, bool applied = true);
|
||||
style fill(const xlnt::fill &new_fill, bool applied = true);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -167,17 +168,17 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
class font &font();
|
||||
class font &font();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
const class font &font() const;
|
||||
const class font &font() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
style font(const xlnt::font &new_font, bool applied = true);
|
||||
style font(const xlnt::font &new_font, bool applied = true);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -187,17 +188,17 @@ public:
|
|||
/// <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>
|
||||
style number_format(const xlnt::number_format &new_number_format, bool applied = true);
|
||||
style number_format(const xlnt::number_format &new_number_format, bool applied = true);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -207,17 +208,17 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
class protection &protection();
|
||||
class protection &protection();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
const class protection &protection() const;
|
||||
const class protection &protection() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
style protection(const xlnt::protection &new_protection, bool applied = true);
|
||||
style protection(const xlnt::protection &new_protection, bool applied = true);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -227,20 +228,20 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool operator==(const style &other) const;
|
||||
bool operator==(const style &other) const;
|
||||
|
||||
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_;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
@ -56,14 +57,14 @@ struct XLNT_API datetime
|
|||
static datetime from_number(long double number, calendar base_date);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
static datetime from_iso_string(const std::string &iso_string);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
datetime(const date &d, const time &t);
|
||||
datetime(const date &d, const time &t);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
|
|
@ -1,3 +1,26 @@
|
|||
// Copyright (c) 2016 Thomas Fussell
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// 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 AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
|
@ -10,136 +33,134 @@ namespace xlnt {
|
|||
/// 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
|
||||
{
|
||||
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
|
||||
{
|
||||
return is_set();
|
||||
}
|
||||
operator bool() const
|
||||
{
|
||||
return is_set();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool is_set() const
|
||||
{
|
||||
return has_value_;
|
||||
}
|
||||
bool is_set() const
|
||||
{
|
||||
return has_value_;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void set(const T &value)
|
||||
{
|
||||
has_value_ = true;
|
||||
value_ = value;
|
||||
}
|
||||
void set(const T &value)
|
||||
{
|
||||
has_value_ = true;
|
||||
value_ = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
T &operator*()
|
||||
{
|
||||
return get();
|
||||
}
|
||||
T &operator*()
|
||||
{
|
||||
return get();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
const T &operator*() const
|
||||
{
|
||||
return get();
|
||||
}
|
||||
const T &operator*() const
|
||||
{
|
||||
return get();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
T *operator->()
|
||||
{
|
||||
return &get();
|
||||
}
|
||||
T *operator->()
|
||||
{
|
||||
return &get();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
const T *operator->() const
|
||||
{
|
||||
return &get();
|
||||
}
|
||||
const T *operator->() const
|
||||
{
|
||||
return &get();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
T &get()
|
||||
{
|
||||
if (!has_value_)
|
||||
{
|
||||
throw invalid_attribute();
|
||||
}
|
||||
T &get()
|
||||
{
|
||||
if (!has_value_)
|
||||
{
|
||||
throw invalid_attribute();
|
||||
}
|
||||
|
||||
return value_;
|
||||
}
|
||||
return value_;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
const T &get() const
|
||||
{
|
||||
if (!has_value_)
|
||||
{
|
||||
throw invalid_attribute();
|
||||
}
|
||||
const T &get() const
|
||||
{
|
||||
if (!has_value_)
|
||||
{
|
||||
throw invalid_attribute();
|
||||
}
|
||||
|
||||
return value_;
|
||||
}
|
||||
return value_;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void clear()
|
||||
{
|
||||
has_value_ = false;
|
||||
value_ = T();
|
||||
}
|
||||
void clear()
|
||||
{
|
||||
has_value_ = false;
|
||||
value_ = T();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool operator==(const optional<T> &other) const
|
||||
{
|
||||
return has_value_ == other.has_value_
|
||||
&& (!has_value_
|
||||
|| (has_value_ && value_ == other.value_));
|
||||
return has_value_ == other.has_value_ && (!has_value_ || (has_value_ && value_ == other.value_));
|
||||
}
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool has_value_;
|
||||
bool has_value_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
T value_;
|
||||
T value_;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
@ -36,84 +37,84 @@ namespace xlnt {
|
|||
class XLNT_API path
|
||||
{
|
||||
public:
|
||||
/// <summary>
|
||||
/// The system-specific path separator character (e.g. '/' or '\').
|
||||
/// </summary>
|
||||
static char system_separator();
|
||||
/// <summary>
|
||||
/// The system-specific path separator character (e.g. '/' or '\').
|
||||
/// </summary>
|
||||
static char system_separator();
|
||||
|
||||
/// <summary>
|
||||
/// Construct an empty path.
|
||||
/// </summary>
|
||||
path();
|
||||
/// <summary>
|
||||
/// Construct an empty path.
|
||||
/// </summary>
|
||||
path();
|
||||
|
||||
/// <summary>
|
||||
/// Counstruct a path from a string representing the path.
|
||||
/// </summary>
|
||||
explicit path(const std::string &path_string);
|
||||
/// <summary>
|
||||
/// Counstruct a path from a string representing the path.
|
||||
/// </summary>
|
||||
explicit path(const std::string &path_string);
|
||||
|
||||
/// <summary>
|
||||
/// Construct a path from a string with an explicit directory seprator.
|
||||
/// </summary>
|
||||
path(const std::string &path_string, char sep);
|
||||
/// <summary>
|
||||
/// Construct a path from a string with an explicit directory seprator.
|
||||
/// </summary>
|
||||
path(const std::string &path_string, char sep);
|
||||
|
||||
// general attributes
|
||||
// general attributes
|
||||
|
||||
/// <summary>
|
||||
/// Return true iff this path doesn't begin with / (or a drive letter on Windows).
|
||||
/// </summary>
|
||||
bool is_relative() const;
|
||||
/// <summary>
|
||||
/// Return true iff this path doesn't begin with / (or a drive letter on Windows).
|
||||
/// </summary>
|
||||
bool is_relative() const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true iff path::is_relative() is false.
|
||||
/// </summary>
|
||||
bool is_absolute() const;
|
||||
/// <summary>
|
||||
/// Return true iff path::is_relative() is false.
|
||||
/// </summary>
|
||||
bool is_absolute() const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true iff this path is the root directory.
|
||||
/// </summary>
|
||||
bool is_root() const;
|
||||
/// <summary>
|
||||
/// Return true iff this path is the root directory.
|
||||
/// </summary>
|
||||
bool is_root() const;
|
||||
|
||||
/// <summary>
|
||||
/// Return a new path that points to the directory containing the current path
|
||||
/// Return the path unchanged if this path is the absolute or relative root.
|
||||
/// </summary>
|
||||
path parent() const;
|
||||
/// <summary>
|
||||
/// Return a new path that points to the directory containing the current path
|
||||
/// Return the path unchanged if this path is the absolute or relative root.
|
||||
/// </summary>
|
||||
path parent() const;
|
||||
|
||||
/// <summary>
|
||||
/// Return the last component of this path.
|
||||
/// </summary>
|
||||
std::string filename() const;
|
||||
/// <summary>
|
||||
/// Return the last component of this path.
|
||||
/// </summary>
|
||||
std::string filename() const;
|
||||
|
||||
/// <summary>
|
||||
/// Return the part of the path following the last dot in the filename.
|
||||
/// </summary>
|
||||
std::string extension() const;
|
||||
/// <summary>
|
||||
/// Return the part of the path following the last dot in the filename.
|
||||
/// </summary>
|
||||
std::string extension() const;
|
||||
|
||||
/// <summary>
|
||||
/// Return a pair of strings resulting from splitting the filename on the last dot.
|
||||
/// </summary>
|
||||
std::pair<std::string, std::string> split_extension() const;
|
||||
/// <summary>
|
||||
/// Return a pair of strings resulting from splitting the filename on the last dot.
|
||||
/// </summary>
|
||||
std::pair<std::string, std::string> split_extension() const;
|
||||
|
||||
// conversion
|
||||
// conversion
|
||||
|
||||
/// <summary>
|
||||
/// Create a string representing this path separated by the provided
|
||||
/// separator or the system-default separator if not provided.
|
||||
/// </summary>
|
||||
std::vector<std::string> split() const;
|
||||
/// <summary>
|
||||
/// Create a string representing this path separated by the provided
|
||||
/// separator or the system-default separator if not provided.
|
||||
/// </summary>
|
||||
std::vector<std::string> split() const;
|
||||
|
||||
/// <summary>
|
||||
/// Create a string representing this path separated by the provided
|
||||
/// separator or the system-default separator if not provided.
|
||||
/// </summary>
|
||||
std::string string() const;
|
||||
/// <summary>
|
||||
/// Create a string representing this path separated by the provided
|
||||
/// separator or the system-default separator if not provided.
|
||||
/// </summary>
|
||||
std::string string() const;
|
||||
|
||||
/// <summary>
|
||||
/// If this path is relative, append each component of this path
|
||||
/// to base_path and return the resulting absolute path. Otherwise,
|
||||
/// the the current path will be returned and base_path will be ignored.
|
||||
/// </summary>
|
||||
path resolve(const path &base_path) const;
|
||||
/// <summary>
|
||||
/// If this path is relative, append each component of this path
|
||||
/// to base_path and return the resulting absolute path. Otherwise,
|
||||
/// the the current path will be returned and base_path will be ignored.
|
||||
/// </summary>
|
||||
path resolve(const path &base_path) const;
|
||||
|
||||
/// <summary>
|
||||
/// The inverse of path::resolve. Creates a relative path from an absolute
|
||||
|
@ -122,45 +123,45 @@ public:
|
|||
/// </summary>
|
||||
path relative_to(const path &base_path) const;
|
||||
|
||||
// filesystem attributes
|
||||
// filesystem attributes
|
||||
|
||||
/// <summary>
|
||||
/// Return true iff the file or directory pointed to by this path
|
||||
/// exists on the filesystem.
|
||||
/// </summary>
|
||||
bool exists() const;
|
||||
/// <summary>
|
||||
/// Return true iff the file or directory pointed to by this path
|
||||
/// exists on the filesystem.
|
||||
/// </summary>
|
||||
bool exists() const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true if the file or directory pointed to by this path
|
||||
/// is a directory.
|
||||
/// </summary>
|
||||
bool is_directory() const;
|
||||
/// <summary>
|
||||
/// Return true if the file or directory pointed to by this path
|
||||
/// is a directory.
|
||||
/// </summary>
|
||||
bool is_directory() const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true if the file or directory pointed to by this path
|
||||
/// is a regular file.
|
||||
/// </summary>
|
||||
bool is_file() const;
|
||||
/// <summary>
|
||||
/// Return true if the file or directory pointed to by this path
|
||||
/// is a regular file.
|
||||
/// </summary>
|
||||
bool is_file() const;
|
||||
|
||||
// filesystem
|
||||
// filesystem
|
||||
|
||||
/// <summary>
|
||||
/// Open the file pointed to by this path and return a string containing
|
||||
/// the files contents.
|
||||
/// </summary>
|
||||
std::string read_contents() const;
|
||||
/// <summary>
|
||||
/// Open the file pointed to by this path and return a string containing
|
||||
/// the files contents.
|
||||
/// </summary>
|
||||
std::string read_contents() const;
|
||||
|
||||
// mutators
|
||||
// mutators
|
||||
|
||||
/// <summary>
|
||||
/// Append the provided part to this path and return the result.
|
||||
/// </summary>
|
||||
path append(const std::string &to_append) const;
|
||||
/// <summary>
|
||||
/// Append the provided part to this path and return the result.
|
||||
/// </summary>
|
||||
path append(const std::string &to_append) const;
|
||||
|
||||
/// <summary>
|
||||
/// Append the provided part to this path and return the result.
|
||||
/// </summary>
|
||||
path append(const path &to_append) const;
|
||||
/// <summary>
|
||||
/// Append the provided part to this path and return the result.
|
||||
/// </summary>
|
||||
path append(const path &to_append) const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if left path is equal to right path.
|
||||
|
@ -168,20 +169,20 @@ public:
|
|||
friend XLNT_API bool operator==(const path &left, const path &right);
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
/// Returns the character that separates directories in the path.
|
||||
/// On POSIX style filesystems, this is always '/'.
|
||||
/// On Windows, this is the character that separates the drive letter from
|
||||
/// the rest of the path for absolute paths with a drive letter, '/' if the path
|
||||
/// is absolute and starts with '/', and '/' or '\' for relative paths
|
||||
/// depending on which splits the path into more directory components.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Returns the character that separates directories in the path.
|
||||
/// On POSIX style filesystems, this is always '/'.
|
||||
/// On Windows, this is the character that separates the drive letter from
|
||||
/// the rest of the path for absolute paths with a drive letter, '/' if the path
|
||||
/// is absolute and starts with '/', and '/' or '\' for relative paths
|
||||
/// depending on which splits the path into more directory components.
|
||||
/// </summary>
|
||||
char guess_separator() const;
|
||||
|
||||
/// <summary>
|
||||
/// A string that represents this path.
|
||||
/// </summary>
|
||||
std::string internal_;
|
||||
/// <summary>
|
||||
/// A string that represents this path.
|
||||
/// </summary>
|
||||
std::string internal_;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
||||
|
@ -195,11 +196,11 @@ template <>
|
|||
struct hash<xlnt::path>
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
size_t operator()(const xlnt::path &p) const
|
||||
{
|
||||
static hash<string> hasher;
|
||||
static hash<string> hasher;
|
||||
return hasher(p.string());
|
||||
}
|
||||
};
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
@ -30,7 +32,7 @@
|
|||
namespace xlnt {
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
class XLNT_API utf8string
|
||||
{
|
||||
|
|
|
@ -34,10 +34,13 @@ namespace xlnt {
|
|||
class workbook;
|
||||
class worksheet;
|
||||
|
||||
using c_ws_iter_type = std::iterator<std::bidirectional_iterator_tag,
|
||||
const worksheet, std::ptrdiff_t, const worksheet *, const 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 c_ws_iter_type
|
||||
{
|
||||
public:
|
||||
/// <summary>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
@ -33,9 +34,6 @@ namespace xlnt {
|
|||
class range_reference;
|
||||
class worksheet;
|
||||
|
||||
// TODO: why is this not in a class?
|
||||
std::vector<std::pair<std::string, std::string>> XLNT_API split_named_range(const std::string &named_range_string);
|
||||
|
||||
/// <summary>
|
||||
/// A 2D range of cells in a worksheet that is referred to by name.
|
||||
/// ws->range("A1:B2") could be replaced by ws->range("range1")
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
|
@ -111,22 +112,22 @@ public:
|
|||
/// <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
|
||||
|
||||
|
@ -152,29 +153,29 @@ public:
|
|||
|
||||
// add worksheets
|
||||
|
||||
/// <summary>
|
||||
/// Create a sheet after the last sheet in this workbook and return it.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Create a sheet after the last sheet in this workbook and return it.
|
||||
/// </summary>
|
||||
worksheet create_sheet();
|
||||
|
||||
/// <summary>
|
||||
/// Create a sheet at the specified index and return it.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Create a sheet at the specified index and return it.
|
||||
/// </summary>
|
||||
worksheet create_sheet(std::size_t index);
|
||||
|
||||
/// <summary>
|
||||
/// This should be private...
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// This should be private...
|
||||
/// </summary>
|
||||
worksheet create_sheet_with_rel(const std::string &title, const relationship &rel);
|
||||
|
||||
/// <summary>
|
||||
/// Create a new sheet initializing it with all of the data from the provided worksheet.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Create a new sheet initializing it with all of the data from the provided worksheet.
|
||||
/// </summary>
|
||||
void copy_sheet(worksheet worksheet);
|
||||
|
||||
/// <summary>
|
||||
/// Create a new sheet at the specified index initializing it with all of the data
|
||||
/// from the provided worksheet.
|
||||
/// <summary>
|
||||
/// Create a new sheet at the specified index initializing it with all of the data
|
||||
/// from the provided worksheet.
|
||||
void copy_sheet(worksheet worksheet, std::size_t index);
|
||||
|
||||
// get worksheets
|
||||
|
@ -192,7 +193,7 @@ public:
|
|||
/// Use workbook::contains(const std::string &) to make sure the sheet exists.
|
||||
/// </summary>
|
||||
worksheet sheet_by_title(const std::string &sheet_name);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Return the const worksheet with the given name.
|
||||
/// This may throw an exception if the sheet isn't found.
|
||||
|
@ -210,15 +211,15 @@ public:
|
|||
/// </summary>
|
||||
const worksheet sheet_by_index(std::size_t index) const;
|
||||
|
||||
/// <summary>
|
||||
/// Return the worksheet with a sheetId of id.
|
||||
/// </summary>
|
||||
worksheet sheet_by_id(std::size_t id);
|
||||
/// <summary>
|
||||
/// Return the worksheet with a sheetId of id.
|
||||
/// </summary>
|
||||
worksheet sheet_by_id(std::size_t id);
|
||||
|
||||
/// <summary>
|
||||
/// Return the const worksheet with a sheetId of id.
|
||||
/// </summary>
|
||||
const worksheet sheet_by_id(std::size_t id) const;
|
||||
/// <summary>
|
||||
/// Return the const worksheet with a sheetId of id.
|
||||
/// </summary>
|
||||
const worksheet sheet_by_id(std::size_t id) const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true if this workbook contains a sheet with the given name.
|
||||
|
@ -233,71 +234,71 @@ public:
|
|||
|
||||
// remove worksheets
|
||||
|
||||
/// <summary>
|
||||
/// Remove the given worksheet from this workbook.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Remove the given worksheet from this workbook.
|
||||
/// </summary>
|
||||
void remove_sheet(worksheet worksheet);
|
||||
|
||||
/// <summary>
|
||||
/// Delete every cell in this worksheet. After this is called, the
|
||||
/// worksheet will be equivalent to a newly created sheet at the same
|
||||
/// index and with the same title.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Delete every cell in this worksheet. After this is called, the
|
||||
/// worksheet will be equivalent to a newly created sheet at the same
|
||||
/// index and with the same title.
|
||||
/// </summary>
|
||||
void clear();
|
||||
|
||||
// iterators
|
||||
|
||||
/// <summary>
|
||||
/// Returns an iterator to the first worksheet in this workbook.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Returns an iterator to the first worksheet in this workbook.
|
||||
/// </summary>
|
||||
iterator begin();
|
||||
|
||||
/// <summary>
|
||||
/// Returns an iterator to the worksheet following the last worksheet of the workbook.
|
||||
/// This worksheet acts as a placeholder; attempting to access it will cause an
|
||||
/// exception to be thrown.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Returns an iterator to the worksheet following the last worksheet of the workbook.
|
||||
/// This worksheet acts as a placeholder; attempting to access it will cause an
|
||||
/// exception to be thrown.
|
||||
/// </summary>
|
||||
iterator end();
|
||||
|
||||
/// <summary>
|
||||
/// Returns a const iterator to the first worksheet in this workbook.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Returns a const iterator to the first worksheet in this workbook.
|
||||
/// </summary>
|
||||
const_iterator begin() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns a const iterator to the worksheet following the last worksheet of the workbook.
|
||||
/// This worksheet acts as a placeholder; attempting to access it will cause an
|
||||
/// exception to be thrown.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Returns a const iterator to the worksheet following the last worksheet of the workbook.
|
||||
/// This worksheet acts as a placeholder; attempting to access it will cause an
|
||||
/// exception to be thrown.
|
||||
/// </summary>
|
||||
const_iterator end() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns an iterator to the first worksheet in this workbook.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Returns an iterator to the first worksheet in this workbook.
|
||||
/// </summary>
|
||||
const_iterator cbegin() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns a const iterator to the worksheet following the last worksheet of the workbook.
|
||||
/// This worksheet acts as a placeholder; attempting to access it will cause an
|
||||
/// exception to be thrown.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Returns a const iterator to the worksheet following the last worksheet of the workbook.
|
||||
/// This worksheet acts as a placeholder; attempting to access it will cause an
|
||||
/// exception to be thrown.
|
||||
/// </summary>
|
||||
const_iterator cend() const;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Apply the function "f" to every non-empty cell in every worksheet in this workbook.
|
||||
/// </summary>
|
||||
void apply_to_cells(std::function<void(cell)> f);
|
||||
|
||||
/// <summary>
|
||||
/// Returns a temporary vector containing the titles of each sheet in the order
|
||||
/// of the sheets in the workbook.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Returns a temporary vector containing the titles of each sheet in the order
|
||||
/// of the sheets in the workbook.
|
||||
/// </summary>
|
||||
std::vector<std::string> sheet_titles() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the number of sheets in this workbook.
|
||||
/// </summary>
|
||||
std::size_t sheet_count() const;
|
||||
/// <summary>
|
||||
/// Returns the number of sheets in this workbook.
|
||||
/// </summary>
|
||||
std::size_t sheet_count() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the workbook has the core property with the given name.
|
||||
|
@ -307,39 +308,39 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
template<typename T = std::string>
|
||||
template <typename T = std::string>
|
||||
T core_property(const std::string &property_name) const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
template<typename T = std::string>
|
||||
template <typename T = std::string>
|
||||
void core_property(const std::string &property_name, const T value);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
calendar base_date() const;
|
||||
calendar base_date() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void base_date(calendar base_date);
|
||||
void base_date(calendar base_date);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool has_title() const;
|
||||
bool has_title() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string title() const;
|
||||
std::string title() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void title(const std::string &title);
|
||||
void title(const std::string &title);
|
||||
|
||||
// named ranges
|
||||
|
||||
|
@ -378,62 +379,62 @@ public:
|
|||
/// <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>
|
||||
///
|
||||
|
@ -443,17 +444,17 @@ public:
|
|||
/// <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
|
||||
/// <summary>
|
||||
|
@ -480,27 +481,27 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool has_view() const;
|
||||
bool has_view() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
workbook_view view() const;
|
||||
workbook_view view() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void view(const workbook_view &view);
|
||||
void view(const workbook_view &view);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool has_code_name() const;
|
||||
bool has_code_name() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string code_name() const;
|
||||
std::string code_name() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -510,27 +511,27 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool has_file_version() const;
|
||||
bool has_file_version() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string app_name() const;
|
||||
std::string app_name() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::size_t last_edited() const;
|
||||
std::size_t last_edited() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::size_t lowest_edited() const;
|
||||
std::size_t lowest_edited() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::size_t rup_build() const;
|
||||
std::size_t rup_build() const;
|
||||
|
||||
// theme
|
||||
|
||||
|
@ -615,7 +616,7 @@ public:
|
|||
/// <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>
|
||||
///
|
||||
|
@ -632,8 +633,8 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void thumbnail(const std::vector<std::uint8_t> &thumbnail,
|
||||
const std::string &extension, const std::string &content_type);
|
||||
void thumbnail(
|
||||
const std::vector<std::uint8_t> &thumbnail, const std::string &extension, const std::string &content_type);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -718,8 +719,8 @@ private:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void register_comments_in_manifest(worksheet ws);
|
||||
|
||||
void register_comments_in_manifest(worksheet ws);
|
||||
|
||||
/// <summary>
|
||||
/// An opaque pointer to a structure that holds all of the data relating to this workbook.
|
||||
/// </summary>
|
||||
|
|
|
@ -38,67 +38,67 @@ 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;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
||||
|
|
|
@ -33,10 +33,13 @@ namespace xlnt {
|
|||
class workbook;
|
||||
class worksheet;
|
||||
|
||||
using ws_iter_type = std::iterator<std::bidirectional_iterator_tag,
|
||||
worksheet, std::ptrdiff_t, worksheet *, 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 ws_iter_type
|
||||
{
|
||||
public:
|
||||
/// <summary>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef> // std::ptrdiff_t
|
||||
|
@ -39,10 +40,13 @@ class cell;
|
|||
class cell_reference;
|
||||
class range_reference;
|
||||
|
||||
using c_iter_type = std::iterator<std::bidirectional_iterator_tag,
|
||||
cell, std::ptrdiff_t, cell *, cell>;
|
||||
|
||||
/// <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 c_iter_type
|
||||
{
|
||||
public:
|
||||
/// <summary>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iterator>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef> // std::ptrdiff_t
|
||||
|
@ -39,10 +40,13 @@ class cell;
|
|||
class cell_reference;
|
||||
class range_reference;
|
||||
|
||||
using cc_iter_type = std::iterator<std::bidirectional_iterator_tag,
|
||||
const cell, std::ptrdiff_t, const cell *, const cell>;
|
||||
|
||||
/// <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 cc_iter_type
|
||||
{
|
||||
public:
|
||||
/// <summary>
|
||||
|
|
|
@ -38,18 +38,20 @@ namespace detail {
|
|||
struct worksheet_impl;
|
||||
}
|
||||
|
||||
using cr_iter_type = std::iterator<std::bidirectional_iterator_tag,
|
||||
const cell_vector, std::ptrdiff_t, const cell_vector *, const cell_vector>;
|
||||
|
||||
/// <summary>
|
||||
/// A const version of range_iterator which does not allow modification
|
||||
/// to the dereferenced cell_vector.
|
||||
/// </summary>
|
||||
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 cr_iter_type
|
||||
{
|
||||
public:
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
const_range_iterator(
|
||||
const worksheet &ws, const range_reference &start_cell, major_order order = major_order::row);
|
||||
const_range_iterator(const worksheet &ws, const range_reference &start_cell, major_order order = major_order::row);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
|
|
|
@ -21,11 +21,12 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
#include <xlnt/cell/index_types.hpp>
|
||||
#include <xlnt/cell/cell_reference.hpp>
|
||||
#include <xlnt/cell/index_types.hpp>
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
|
@ -82,11 +83,8 @@ struct XLNT_API pane
|
|||
|
||||
bool operator==(const pane &rhs) const
|
||||
{
|
||||
return top_left_cell == rhs.top_left_cell
|
||||
&& state == rhs.state
|
||||
&& active_pane == rhs.active_pane
|
||||
&& y_split == rhs.y_split
|
||||
&& x_split == rhs.x_split;
|
||||
return top_left_cell == rhs.top_left_cell && state == rhs.state && active_pane == rhs.active_pane
|
||||
&& y_split == rhs.y_split && x_split == rhs.x_split;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iterator>
|
||||
|
@ -29,8 +30,8 @@
|
|||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
#include <xlnt/worksheet/cell_vector.hpp>
|
||||
#include <xlnt/worksheet/major_order.hpp>
|
||||
#include <xlnt/worksheet/const_range_iterator.hpp>
|
||||
#include <xlnt/worksheet/major_order.hpp>
|
||||
#include <xlnt/worksheet/range_iterator.hpp>
|
||||
#include <xlnt/worksheet/range_reference.hpp>
|
||||
#include <xlnt/worksheet/worksheet.hpp>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef> // std::ptrdiff_t
|
||||
|
@ -34,17 +35,21 @@ namespace xlnt {
|
|||
|
||||
class cell_vector;
|
||||
|
||||
using r_iter_type = std::iterator<std::bidirectional_iterator_tag,
|
||||
cell_vector, std::ptrdiff_t, cell_vector *, cell_vector>;
|
||||
|
||||
/// <summary>
|
||||
/// An iterator used by worksheet and range for traversing
|
||||
/// a 2D grid of cells by row/column then across that row/column.
|
||||
/// </summary>
|
||||
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 r_iter_type
|
||||
{
|
||||
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>
|
||||
///
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
|
@ -38,41 +39,56 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool has_active_cell() const { return active_cell_.is_set(); }
|
||||
bool has_active_cell() const
|
||||
{
|
||||
return active_cell_.is_set();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
cell_reference active_cell() const { return active_cell_.get(); }
|
||||
cell_reference active_cell() const
|
||||
{
|
||||
return active_cell_.get();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void active_cell(const cell_reference &ref) { active_cell_ = ref; }
|
||||
void active_cell(const cell_reference &ref)
|
||||
{
|
||||
active_cell_ = ref;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
range_reference sqref() const { return sqref_; }
|
||||
range_reference sqref() const
|
||||
{
|
||||
return sqref_;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
pane_corner pane() const { return pane_; }
|
||||
pane_corner pane() const
|
||||
{
|
||||
return pane_;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void pane(pane_corner corner) { pane_ = corner; }
|
||||
|
||||
void pane(pane_corner corner)
|
||||
{
|
||||
pane_ = corner;
|
||||
}
|
||||
|
||||
bool operator==(const selection &rhs) const
|
||||
{
|
||||
return active_cell_ == rhs.active_cell_
|
||||
&& sqref_ == rhs.sqref_
|
||||
&& pane_ == rhs.pane_;
|
||||
return active_cell_ == rhs.active_cell_ && sqref_ == rhs.sqref_ && pane_ == rhs.pane_;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
///
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
|
@ -40,92 +41,138 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void id(std::size_t new_id) { id_ = new_id; }
|
||||
void id(std::size_t new_id)
|
||||
{
|
||||
id_ = new_id;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::size_t id() const { return id_; }
|
||||
std::size_t id() const
|
||||
{
|
||||
return id_;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool has_pane() const { return pane_.is_set(); }
|
||||
bool has_pane() const
|
||||
{
|
||||
return pane_.is_set();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
struct pane &pane() { return pane_.get(); }
|
||||
struct pane &pane()
|
||||
{
|
||||
return pane_.get();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
const struct pane &pane() const { return pane_.get(); }
|
||||
const struct pane &pane() const
|
||||
{
|
||||
return pane_.get();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void clear_pane() { pane_.clear(); }
|
||||
void clear_pane()
|
||||
{
|
||||
pane_.clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void pane(const struct pane &new_pane) { pane_ = new_pane; }
|
||||
void pane(const struct pane &new_pane)
|
||||
{
|
||||
pane_ = new_pane;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool has_selections() const { return !selections_.empty(); }
|
||||
bool has_selections() const
|
||||
{
|
||||
return !selections_.empty();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void add_selection(const class selection &new_selection) { selections_.push_back(new_selection); }
|
||||
void add_selection(const class selection &new_selection)
|
||||
{
|
||||
selections_.push_back(new_selection);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void clear_selections() { selections_.clear(); }
|
||||
void clear_selections()
|
||||
{
|
||||
selections_.clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::vector<xlnt::selection> selections() const { return selections_; }
|
||||
std::vector<xlnt::selection> selections() const
|
||||
{
|
||||
return selections_;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
class xlnt::selection &selection(std::size_t index) { return selections_.at(index); }
|
||||
class xlnt::selection &selection(std::size_t index)
|
||||
{
|
||||
return selections_.at(index);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void show_grid_lines(bool show) { show_grid_lines_ = show; }
|
||||
void show_grid_lines(bool show)
|
||||
{
|
||||
show_grid_lines_ = show;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool show_grid_lines() const { return show_grid_lines_; }
|
||||
bool show_grid_lines() const
|
||||
{
|
||||
return show_grid_lines_;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void default_grid_color(bool is_default) { default_grid_color_ = is_default; }
|
||||
void default_grid_color(bool is_default)
|
||||
{
|
||||
default_grid_color_ = is_default;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool default_grid_color() const { return default_grid_color_; }
|
||||
bool default_grid_color() const
|
||||
{
|
||||
return default_grid_color_;
|
||||
}
|
||||
|
||||
bool operator==(const sheet_view &rhs) const
|
||||
{
|
||||
return id_ == rhs.id_
|
||||
&& show_grid_lines_ == rhs.show_grid_lines_
|
||||
return id_ == rhs.id_ && show_grid_lines_ == rhs.show_grid_lines_
|
||||
&& default_grid_color_ == rhs.default_grid_color_
|
||||
&& pane_ == rhs.pane_
|
||||
&& selections_ == rhs.selections_;
|
||||
&& pane_ == rhs.pane_ && selections_ == rhs.selections_;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
///
|
||||
|
|
|
@ -62,7 +62,7 @@ class xlsx_producer;
|
|||
|
||||
struct worksheet_impl;
|
||||
|
||||
}
|
||||
} // namespace detail
|
||||
|
||||
/// <summary>
|
||||
/// A worksheet is a 2D array of cells starting with cell A1 in the top-left corner
|
||||
|
@ -363,7 +363,7 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool has_dimension() const;
|
||||
bool has_dimension() const;
|
||||
|
||||
// cell merge
|
||||
|
||||
|
@ -511,7 +511,7 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool has_page_setup() const;
|
||||
bool has_page_setup() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -521,12 +521,12 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void page_setup(const struct page_setup &setup);
|
||||
void page_setup(const struct page_setup &setup);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool has_page_margins() const;
|
||||
bool has_page_margins() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -541,7 +541,7 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool has_format_properties() const;
|
||||
bool has_format_properties() const;
|
||||
|
||||
// auto filter
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
|
|
|
@ -78,8 +78,8 @@
|
|||
#include <xlnt/worksheet/const_cell_iterator.hpp>
|
||||
#include <xlnt/worksheet/const_range_iterator.hpp>
|
||||
#include <xlnt/worksheet/footer.hpp>
|
||||
#include <xlnt/worksheet/header_footer.hpp>
|
||||
#include <xlnt/worksheet/header.hpp>
|
||||
#include <xlnt/worksheet/header_footer.hpp>
|
||||
#include <xlnt/worksheet/major_order.hpp>
|
||||
#include <xlnt/worksheet/orientation.hpp>
|
||||
#include <xlnt/worksheet/page_break.hpp>
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
#define XLNT_API __declspec(dllexport)
|
||||
#else
|
||||
// For clients of the library, supress warnings about DLL interfaces for standard library classes
|
||||
#pragma warning(disable: 4251)
|
||||
#pragma warning(disable: 4275)
|
||||
#pragma warning(disable : 4251)
|
||||
#pragma warning(disable : 4275)
|
||||
#define XLNT_API __declspec(dllimport)
|
||||
#endif
|
||||
#else
|
||||
|
|
|
@ -26,8 +26,6 @@
|
|||
#include <cmath>
|
||||
#include <sstream>
|
||||
|
||||
#include <detail/cell_impl.hpp>
|
||||
#include <detail/stylesheet.hpp>
|
||||
#include <xlnt/cell/cell.hpp>
|
||||
#include <xlnt/cell/cell_reference.hpp>
|
||||
#include <xlnt/cell/comment.hpp>
|
||||
|
@ -52,6 +50,9 @@
|
|||
#include <xlnt/worksheet/row_properties.hpp>
|
||||
#include <xlnt/worksheet/worksheet.hpp>
|
||||
|
||||
#include <detail/cell_impl.hpp>
|
||||
#include <detail/stylesheet.hpp>
|
||||
|
||||
namespace {
|
||||
|
||||
std::pair<bool, long double> cast_numeric(const std::string &s)
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#include <locale>
|
||||
|
||||
#include <xlnt/cell/cell_reference.hpp>
|
||||
|
|
|
@ -332,11 +332,7 @@ void xlsx_consumer::populate_workbook()
|
|||
|
||||
for (const auto &package_rel : read_relationships(root_path))
|
||||
{
|
||||
manifest().register_relationship(uri(root_path.string()),
|
||||
package_rel.type(),
|
||||
package_rel.target(),
|
||||
package_rel.target_mode(),
|
||||
package_rel.id());
|
||||
manifest().register_relationship(package_rel);
|
||||
}
|
||||
|
||||
for (auto package_rel : manifest().relationships(root_path))
|
||||
|
@ -354,11 +350,7 @@ void xlsx_consumer::populate_workbook()
|
|||
{
|
||||
for (const auto &part_rel : read_relationships(path(relationship_source_string)))
|
||||
{
|
||||
manifest().register_relationship(part_rel.source(),
|
||||
part_rel.type(),
|
||||
part_rel.target(),
|
||||
part_rel.target_mode(),
|
||||
part_rel.id());
|
||||
manifest().register_relationship(part_rel);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -216,13 +216,14 @@ std::vector<path> manifest::parts() const
|
|||
|
||||
std::string manifest::register_relationship(const uri &source, relationship_type type, const uri &target, target_mode mode)
|
||||
{
|
||||
return register_relationship(source, type, target, mode, next_relationship_id(source.path()));
|
||||
xlnt::relationship rel(next_relationship_id(source.path()), type, source, target, mode);
|
||||
return register_relationship(rel);
|
||||
}
|
||||
|
||||
std::string manifest::register_relationship(const uri &source, relationship_type type, const uri &target, target_mode mode, const std::string &rel_id)
|
||||
std::string manifest::register_relationship(const class relationship &rel)
|
||||
{
|
||||
relationships_[source.path()][rel_id] = xlnt::relationship(rel_id, type, source, target, mode);
|
||||
return rel_id;
|
||||
relationships_[rel.source().path()][rel.id()] = rel;
|
||||
return rel.id();
|
||||
}
|
||||
|
||||
void manifest::unregister_relationship(const uri &source, const std::string &rel_id)
|
||||
|
|
|
@ -34,6 +34,7 @@ namespace {
|
|||
/// <remark>
|
||||
/// This should maybe be in a utility header so it can be used elsewhere.
|
||||
/// </remarks>
|
||||
/*
|
||||
std::vector<std::string> split_string(const std::string &string, char delim)
|
||||
{
|
||||
std::vector<std::string> split;
|
||||
|
@ -53,24 +54,12 @@ std::vector<std::string> split_string(const std::string &string, char delim)
|
|||
|
||||
return split;
|
||||
}
|
||||
*/
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
std::string named_range::name() const
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
const std::vector<named_range::target> &named_range::targets() const
|
||||
{
|
||||
return targets_;
|
||||
}
|
||||
|
||||
/*
|
||||
std::vector<std::pair<std::string, std::string>> split_named_range(const std::string &named_range_string)
|
||||
{
|
||||
std::vector<std::pair<std::string, std::string>> final;
|
||||
std::vector<std::pair<std::string, std::string>> result;
|
||||
|
||||
for (auto part : split_string(named_range_string, ','))
|
||||
{
|
||||
|
@ -91,10 +80,25 @@ std::vector<std::pair<std::string, std::string>> split_named_range(const std::st
|
|||
split[1] = "";
|
||||
}
|
||||
|
||||
final.push_back({ split[0], split[1] });
|
||||
result.push_back({ split[0], split[1] });
|
||||
}
|
||||
|
||||
return final;
|
||||
return result;
|
||||
}
|
||||
*/
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
std::string named_range::name() const
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
const std::vector<named_range::target> &named_range::targets() const
|
||||
{
|
||||
return targets_;
|
||||
}
|
||||
|
||||
named_range::named_range()
|
||||
|
|
|
@ -10,6 +10,7 @@ class test_named_range : public CxxTest::TestSuite
|
|||
public:
|
||||
void test_split()
|
||||
{
|
||||
/*
|
||||
using string_pair = std::pair<std::string, std::string>;
|
||||
using string_pair_vector = std::vector<string_pair>;
|
||||
using expected_pair = std::pair<std::string, string_pair_vector>;
|
||||
|
@ -35,6 +36,7 @@ public:
|
|||
{
|
||||
TS_ASSERT_EQUALS(xlnt::split_named_range(pair.first), pair.second);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void test_split_no_quotes()
|
||||
|
|
Loading…
Reference in New Issue
Block a user