diff --git a/.clang-format b/.clang-format
index a7492c1b..482ec1d2 100644
--- a/.clang-format
+++ b/.clang-format
@@ -1,6 +1,9 @@
---
BasedOnStyle: LLVM
-AccessModifierOffset: 0
+AccessModifierOffset: -4
+AlignAfterOpenBracket: DontAlign
+AlignTrailingComments: false
+AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: true
@@ -21,7 +24,7 @@ BraceWrapping:
BreakBeforeBraces: Custom
ColumnLimit: 120
ConstructorInitializerAllOnOneLineOrOnePerLine: true
-Cpp11BracedListStyle: false
+Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
IndentCaseLabels: false
@@ -30,6 +33,7 @@ KeepEmptyLinesAtTheStartOfBlocks: false
Language: Cpp
NamespaceIndentation: None
MaxEmptyLinesToKeep: 1
+PenaltyBreakComment: 1000
PointerAlignment: Right
SpaceAfterCStyleCast: false
SpaceBeforeParens: ControlStatements
diff --git a/include/xlnt/cell/cell.hpp b/include/xlnt/cell/cell.hpp
index 73adb96a..44475fd2 100644
--- a/include/xlnt/cell/cell.hpp
+++ b/include/xlnt/cell/cell.hpp
@@ -51,7 +51,9 @@ struct datetime;
struct time;
struct timedelta;
-namespace detail { struct cell_impl; }
+namespace detail {
+struct cell_impl;
+}
///
/// Describes cell associated properties.
@@ -66,7 +68,7 @@ class XLNT_CLASS cell
{
public:
using type = cell_type;
-
+
///
/// Return a map of error strings such as \#DIV/0! and their associated indices.
///
@@ -126,7 +128,7 @@ public:
/// Return the type of this cell.
///
type get_data_type() const;
-
+
///
/// Set the type of this cell.
///
@@ -146,130 +148,130 @@ public:
bool is_date() const;
// position
-
+
///
/// Return a cell_reference that points to the location of this cell.
///
cell_reference get_reference() const;
-
+
///
/// Return the column of this cell.
///
column_t get_column() const;
-
+
///
/// Return the row of this cell.
///
row_t get_row() const;
-
+
///
/// Return the location of this cell as an ordered pair.
///
std::pair get_anchor() const;
// hyperlink
-
+
///
/// Return a relationship representing this cell's hyperlink.
///
relationship get_hyperlink() const;
-
+
///
/// Add a hyperlink to this cell pointing to the URI of the given value.
///
void set_hyperlink(const std::string &value);
-
+
///
/// Return true if this cell has a hyperlink set.
///
bool has_hyperlink() const;
// style
-
+
///
/// Return true if this cell has had a style applied to it.
///
bool has_style() const;
-
+
///
/// Return the index of this cell's style in its parent workbook.
/// This is also the index of the style in the stylesheet XML, xl/styles.xml.
///
std::size_t get_style_id() const;
-
+
///
/// Set the style index of this cell. This should be an existing style in
/// the parent workbook.
///
void set_style_id(std::size_t style_id);
-
+
///
/// Return the number format of this cell.
///
const number_format &get_number_format() const;
void set_number_format(const number_format &format);
-
+
///
/// Return the font applied to the text in this cell.
///
const font &get_font() const;
-
+
void set_font(const font &font_);
-
+
///
/// Return the fill applied to this cell.
///
const fill &get_fill() const;
-
+
void set_fill(const fill &fill_);
-
+
///
/// Return the border of this cell.
///
const border &get_border() const;
-
+
void set_border(const border &border_);
-
+
///
/// Return the alignment of the text in this cell.
///
const alignment &get_alignment() const;
-
+
void set_alignment(const alignment &alignment_);
-
+
///
/// Return the protection of this cell.
///
const protection &get_protection() const;
-
+
void set_protection(const protection &protection_);
-
+
void set_pivot_button(bool b);
-
+
///
/// Return true iff pivot button?
///
bool pivot_button() const;
-
+
void set_quote_prefix(bool b);
-
+
///
/// Return true iff quote prefix?
///
bool quote_prefix() const;
// comment
-
+
///
/// Return the comment of this cell.
///
comment get_comment();
-
+
///
/// Return the comment of this cell.
///
const comment get_comment() const;
-
+
void set_comment(const comment &comment);
void clear_comment();
bool has_comment() const;
@@ -294,13 +296,13 @@ public:
std::string to_string() const;
// merging
-
+
///
/// Return true iff this cell has been merged with one or more
/// surrounding cells.
///
bool is_merged() const;
-
+
///
/// Make this a merged cell iff merged is true.
/// Generally, this shouldn't be called directly. Instead,
@@ -312,7 +314,7 @@ public:
/// Return the error string that is stored in this cell.
///
std::string get_error() const;
-
+
///
/// Directly assign the value of this cell to be the given error.
///
@@ -323,12 +325,12 @@ public:
/// a relative offset given by the parameters.
///
cell offset(int column, int row);
-
+
///
/// Return the worksheet that owns this cell.
///
worksheet get_parent();
-
+
///
/// Return the worksheet that owns this cell.
///
@@ -346,7 +348,7 @@ public:
std::string check_string(const std::string &to_check);
// operators
-
+
///
/// Make this cell point to rhs.
/// The cell originally pointed to by this cell will be unchanged.
@@ -357,30 +359,30 @@ public:
/// Return true if this cell the same cell as comparand (compare by reference).
///
bool operator==(const cell &comparand) const;
-
+
///
/// Return true if this cell is uninitialized.
///
bool operator==(std::nullptr_t) const;
// friend operators, so we can put cell on either side of comparisons with other types
-
+
///
/// Return true if this cell is uninitialized.
///
friend XLNT_FUNCTION bool operator==(std::nullptr_t, const cell &cell);
-
+
///
/// Return the result of left.get_reference() < right.get_reference().
/// What's the point of this?
///
friend XLNT_FUNCTION bool operator<(cell left, cell right);
- ///
- /// Convenience function for writing cell to an ostream.
- /// Uses cell::to_string() internally.
- ///
- friend XLNT_FUNCTION std::ostream &operator<<(std::ostream &stream, const xlnt::cell &cell);
+ ///
+ /// Convenience function for writing cell to an ostream.
+ /// Uses cell::to_string() internally.
+ ///
+ friend XLNT_FUNCTION std::ostream &operator<<(std::ostream &stream, const xlnt::cell &cell);
private:
// make these friends so they can use the private constructor
@@ -392,7 +394,7 @@ private:
/// Private constructor to create a cell from its implementation.
///
cell(detail::cell_impl *d);
-
+
///
/// A pointer to this cell's implementation.
///
diff --git a/include/xlnt/cell/cell_reference.hpp b/include/xlnt/cell/cell_reference.hpp
index 0b229554..a64661c5 100644
--- a/include/xlnt/cell/cell_reference.hpp
+++ b/include/xlnt/cell/cell_reference.hpp
@@ -52,7 +52,7 @@ struct XLNT_CLASS cell_reference_hash
///
class XLNT_CLASS cell_reference
{
- public:
+public:
///
/// Split a coordinate string like "A1" into an equivalent pair like {"A", 1}.
///
@@ -64,41 +64,41 @@ class XLNT_CLASS cell_reference
/// if column part or row part are prefixed by a dollar-sign indicating they
/// are absolute, otherwise false.
///
- static std::pair split_reference(const std::string &reference_string,
- bool &absolute_column, bool &absolute_row);
+ static std::pair split_reference(
+ const std::string &reference_string, bool &absolute_column, bool &absolute_row);
// constructors
-
+
///
/// Default constructor makes a reference to the top-left-most cell, "A1".
///
cell_reference();
-
- //TODO: should these be explicit? The implicit conversion is nice sometimes.
-
+
+ // TODO: should these be explicit? The implicit conversion is nice sometimes.
+
///
/// Constructs a cell_reference from a string reprenting a cell coordinate (e.g. $B14).
///
cell_reference(const char *reference_string);
-
+
///
/// Constructs a cell_reference from a string reprenting a cell coordinate (e.g. $B14).
///
cell_reference(const std::string &reference_string);
-
+
///
/// Constructs a cell_reference from a string reprenting a column (e.g. A) and
/// a 1-indexed row.
///
cell_reference(const std::string &column, row_t row);
-
+
///
/// Constructs a cell_reference from a 1-indexed column index and row index.
///
cell_reference(column_t column, row_t row);
// absoluateness
-
+
///
/// Convert a coordinate to an absolute coordinate string (e.g. B12 -> $B$12)
/// Defaulting to true, absolute_column and absolute_row can optionally control
@@ -113,7 +113,7 @@ class XLNT_CLASS cell_reference
/// return copy;
///
cell_reference &make_absolute(bool absolute_column = true, bool absolute_row = true);
-
+
///
/// Return true if the reference refers to an absolute column, otherwise false.
///
@@ -137,13 +137,13 @@ class XLNT_CLASS cell_reference
void row_absolute(bool absolute_row);
// getters/setters
-
+
///
/// Return a string that identifies the column of this reference
/// (e.g. second column from left is "B")
///
column_t get_column() const;
-
+
///
/// Set the column of this reference from a string that identifies a particular column.
///
@@ -153,7 +153,7 @@ class XLNT_CLASS cell_reference
/// Return a 1-indexed numeric index of the column of this reference.
///
column_t get_column_index() const;
-
+
///
/// Set the column of this reference from a 1-indexed number that identifies a particular column.
///
@@ -163,7 +163,7 @@ class XLNT_CLASS cell_reference
/// Return a 1-indexed numeric index of the row of this reference.
///
row_t get_row() const;
-
+
///
/// Set the row of this reference from a 1-indexed number that identifies a particular row.
///
@@ -188,7 +188,7 @@ class XLNT_CLASS cell_reference
range_reference to_range() const;
// operators
-
+
///
/// I've always wanted to overload the comma operator.
/// cell_reference("A", 1), cell_reference("B", 1) will return
@@ -201,44 +201,44 @@ class XLNT_CLASS cell_reference
/// in absoluteness of column and row.
///
bool operator==(const cell_reference &comparand) const;
-
+
///
/// Construct a cell_reference from reference_string and return the result
/// of their comparison.
///
bool operator==(const std::string &reference_string) const;
-
+
///
/// Construct a cell_reference from reference_string and return the result
/// of their comparison.
///
bool operator==(const char *reference_string) const;
-
+
///
/// Return true if this reference is not identical to comparand including
/// in absoluteness of column and row.
///
bool operator!=(const cell_reference &comparand) const;
-
+
///
/// Construct a cell_reference from reference_string and return the result
/// of their comparison.
///
bool operator!=(const std::string &reference_string) const;
-
+
///
/// Construct a cell_reference from reference_string and return the result
/// of their comparison.
///
bool operator!=(const char *reference_string) const;
- //TODO: are these useful? maybe get rid of them
+ // TODO: are these useful? maybe get rid of them
bool operator<(const cell_reference &other);
bool operator>(const cell_reference &other);
bool operator<=(const cell_reference &other);
bool operator>=(const cell_reference &other);
- private:
+private:
///
/// Index of the column. Important: this is one-indexed to conform
/// with Excel. Column "A", the first column, would have an index of 1.
@@ -255,7 +255,7 @@ class XLNT_CLASS cell_reference
/// True if the reference's row is absolute. This looks like "A$1" in Excel.
///
bool absolute_row_;
-
+
///
/// True if the reference's column is absolute. This looks like "$A1" in Excel.
///
diff --git a/include/xlnt/cell/comment.hpp b/include/xlnt/cell/comment.hpp
index e8532200..c6e5e534 100644
--- a/include/xlnt/cell/comment.hpp
+++ b/include/xlnt/cell/comment.hpp
@@ -30,31 +30,33 @@
namespace xlnt {
class cell;
-namespace detail { struct comment_impl; }
+namespace detail {
+struct comment_impl;
+}
///
/// A comment can be applied to a cell to provide extra information.
///
class XLNT_CLASS comment
{
- public:
+public:
///
/// The default constructor makes an invalid comment without a parent cell.
///
comment();
-
+
///
/// Constructs a comment applied to the given cell, parent, and with the comment
/// text and author set to the provided respective values.
comment(cell parent, const std::string &text, const std::string &auth);
-
+
~comment();
-
+
///
/// Return the text that will be displayed for this comment.
///
std::string get_text() const;
-
+
///
/// Return the author of this comment.
///
@@ -68,14 +70,14 @@ class XLNT_CLASS comment
///
bool operator==(const comment &other) const;
- private:
+private:
friend class cell; // cell needs access to private constructor
-
+
///
/// Construct a comment from an implementation of a comment.
///
comment(detail::comment_impl *d);
-
+
///
/// Pointer to the implementation of this comment.
/// This allows comments to be passed by value while
diff --git a/include/xlnt/cell/index_types.hpp b/include/xlnt/cell/index_types.hpp
index 39aab4ae..9af99b87 100644
--- a/include/xlnt/cell/index_types.hpp
+++ b/include/xlnt/cell/index_types.hpp
@@ -67,62 +67,62 @@ public:
/// ordinals by adding 64.
///
static std::string column_string_from_index(index_t column_index);
-
+
///
/// Default column_t is the first (left-most) column.
///
column_t();
-
+
///
/// Construct a column from a number.
///
column_t(index_t column_index);
-
+
///
/// Construct a column from a string.
///
explicit column_t(const std::string &column_string);
-
+
///
/// Construct a column from a string.
///
explicit column_t(const char *column_string);
-
+
///
/// Copy constructor
///
column_t(const column_t &other);
-
+
///
/// Move constructor
///
column_t(column_t &&other);
-
+
///
/// Return a string representation of this column index.
///
std::string column_string() const;
-
+
///
/// Set this column to be the same as rhs's and return reference to self.
///
column_t &operator=(column_t rhs);
-
+
///
/// Set this column to be equal to rhs and return reference to self.
///
column_t &operator=(const std::string &rhs);
-
+
///
/// Set this column to be equal to rhs and return reference to self.
///
column_t &operator=(const char *rhs);
-
+
///
/// Return true if this column refers to the same column as other.
///
bool operator==(const column_t &other) const;
-
+
///
/// Return true if this column doesn't refer to the same column as other.
///
@@ -132,177 +132,177 @@ public:
/// Return true if this column refers to the same column as other.
///
bool operator==(int other) const;
-
+
///
/// Return true if this column refers to the same column as other.
///
bool operator==(index_t other) const;
-
+
///
/// Return true if this column refers to the same column as other.
///
bool operator==(const std::string &other) const;
-
+
///
/// Return true if this column refers to the same column as other.
///
bool operator==(const char *other) const;
-
+
///
/// Return true if this column doesn't refer to the same column as other.
///
bool operator!=(int other) const;
-
+
///
/// Return true if this column doesn't refer to the same column as other.
///
bool operator!=(index_t other) const;
-
+
///
/// Return true if this column doesn't refer to the same column as other.
///
bool operator!=(const std::string &other) const;
-
+
///
/// Return true if this column doesn't refer to the same column as other.
///
bool operator!=(const char *other) const;
-
+
///
/// Return true if other is to the right of this column.
///
bool operator>(const column_t &other) const;
-
+
///
/// Return true if other is to the right of or equal to this column.
///
bool operator>=(const column_t &other) const;
-
+
///
/// Return true if other is to the left of this column.
///
bool operator<(const column_t &other) const;
-
+
///
/// Return true if other is to the left of or equal to this column.
///
bool operator<=(const column_t &other) const;
-
+
///
/// Return true if other is to the right of this column.
///
bool operator>(const column_t::index_t &other) const;
-
+
///
/// Return true if other is to the right of or equal to this column.
///
bool operator>=(const column_t::index_t &other) const;
-
+
///
/// Return true if other is to the left of this column.
///
bool operator<(const column_t::index_t &other) const;
-
+
///
/// Return true if other is to the left of or equal to this column.
///
bool operator<=(const column_t::index_t &other) const;
-
+
///
/// Pre-increment this column, making it point to the column one to the right.
///
column_t &operator++();
-
+
///
/// Pre-deccrement this column, making it point to the column one to the left.
///
column_t &operator--();
-
+
///
/// Post-increment this column, making it point to the column one to the right and returning the old column.
///
column_t operator++(int);
-
+
///
/// Post-decrement this column, making it point to the column one to the left and returning the old column.
///
column_t operator--(int);
-
+
///
/// Return the result of adding rhs to this column.
///
column_t operator+(const column_t &rhs);
-
+
///
/// Return the result of adding rhs to this column.
///
column_t operator-(const column_t &rhs);
-
+
///
/// Return the result of adding rhs to this column.
///
column_t operator*(const column_t &rhs);
-
+
///
/// Return the result of adding rhs to this column.
///
column_t operator/(const column_t &rhs);
-
+
///
/// Return the result of adding rhs to this column.
///
column_t operator%(const column_t &rhs);
-
+
///
/// Add rhs to this column and return a reference to this column.
///
column_t &operator+=(const column_t &rhs);
-
+
///
/// Subtrac rhs from this column and return a reference to this column.
///
column_t &operator-=(const column_t &rhs);
-
+
///
/// Multiply this column by rhs and return a reference to this column.
///
column_t &operator*=(const column_t &rhs);
-
+
///
/// Divide this column by rhs and return a reference to this column.
///
column_t &operator/=(const column_t &rhs);
-
+
///
/// Mod this column by rhs and return a reference to this column.
///
column_t &operator%=(const column_t &rhs);
-
+
///
/// Return true if other is to the right of this column.
///
friend bool operator>(const column_t::index_t &left, const column_t &right);
-
+
///
/// Return true if other is to the right of or equal to this column.
///
friend bool operator>=(const column_t::index_t &left, const column_t &right);
-
+
///
/// Return true if other is to the left of this column.
///
friend bool operator<(const column_t::index_t &left, const column_t &right);
-
+
///
/// Return true if other is to the left of or equal to this column.
///
friend bool operator<=(const column_t::index_t &left, const column_t &right);
-
+
///
/// Swap the columns that left and right refer to.
///
friend void swap(column_t &left, column_t &right);
-
+
///
/// Internal numeric value of this column index.
///
@@ -329,7 +329,7 @@ struct hash
{
return hasher(k);
}
-
+
xlnt::column_hash hasher;
};
diff --git a/include/xlnt/charts/axis.hpp b/include/xlnt/charts/axis.hpp
index 89efc65f..875c9ba9 100644
--- a/include/xlnt/charts/axis.hpp
+++ b/include/xlnt/charts/axis.hpp
@@ -27,7 +27,8 @@
namespace xlnt {
-class XLNT_CLASS axis {
+class XLNT_CLASS axis
+{
};
} // namespace xlnt
diff --git a/include/xlnt/charts/bar_chart.hpp b/include/xlnt/charts/bar_chart.hpp
index c90f2ed6..b307b4f5 100644
--- a/include/xlnt/charts/bar_chart.hpp
+++ b/include/xlnt/charts/bar_chart.hpp
@@ -27,7 +27,8 @@
namespace xlnt {
-class XLNT_CLASS bar_chart {
+class XLNT_CLASS bar_chart
+{
};
} // namespace xlnt
diff --git a/include/xlnt/charts/chart.hpp b/include/xlnt/charts/chart.hpp
index 29983b59..28a4b7b5 100644
--- a/include/xlnt/charts/chart.hpp
+++ b/include/xlnt/charts/chart.hpp
@@ -27,7 +27,8 @@
namespace xlnt {
-class XLNT_CLASS chart {
+class XLNT_CLASS chart
+{
};
} // namespace xlnt
diff --git a/include/xlnt/charts/error_bar.hpp b/include/xlnt/charts/error_bar.hpp
index b8f55680..20ef3857 100644
--- a/include/xlnt/charts/error_bar.hpp
+++ b/include/xlnt/charts/error_bar.hpp
@@ -27,7 +27,8 @@
namespace xlnt {
-class XLNT_CLASS error_bar {
+class XLNT_CLASS error_bar
+{
};
} // namespace xlnt
diff --git a/include/xlnt/charts/graph_chart.hpp b/include/xlnt/charts/graph_chart.hpp
index adcd3900..59ac84a8 100644
--- a/include/xlnt/charts/graph_chart.hpp
+++ b/include/xlnt/charts/graph_chart.hpp
@@ -27,7 +27,8 @@
namespace xlnt {
-class XLNT_CLASS graph_chart {
+class XLNT_CLASS graph_chart
+{
};
} // namespace xlnt
diff --git a/include/xlnt/charts/legend.hpp b/include/xlnt/charts/legend.hpp
index 7b50c6ab..4d4e36f7 100644
--- a/include/xlnt/charts/legend.hpp
+++ b/include/xlnt/charts/legend.hpp
@@ -27,7 +27,8 @@
namespace xlnt {
-class XLNT_CLASS legend {
+class XLNT_CLASS legend
+{
};
} // namespace xlnt
diff --git a/include/xlnt/charts/line_chart.hpp b/include/xlnt/charts/line_chart.hpp
index c079f6d4..654e99bf 100644
--- a/include/xlnt/charts/line_chart.hpp
+++ b/include/xlnt/charts/line_chart.hpp
@@ -27,7 +27,8 @@
namespace xlnt {
-class XLNT_CLASS line_chart {
+class XLNT_CLASS line_chart
+{
};
} // namespace xlnt
diff --git a/include/xlnt/charts/pie_chart.hpp b/include/xlnt/charts/pie_chart.hpp
index d60e6e54..a6d38a73 100644
--- a/include/xlnt/charts/pie_chart.hpp
+++ b/include/xlnt/charts/pie_chart.hpp
@@ -27,7 +27,8 @@
namespace xlnt {
-class XLNT_CLASS pie_chart {
+class XLNT_CLASS pie_chart
+{
};
} // namespace xlnt
diff --git a/include/xlnt/charts/scatter_chart.hpp b/include/xlnt/charts/scatter_chart.hpp
index 3421bb16..0fcf5365 100644
--- a/include/xlnt/charts/scatter_chart.hpp
+++ b/include/xlnt/charts/scatter_chart.hpp
@@ -27,7 +27,8 @@
namespace xlnt {
-class XLNT_CLASS scatter_chart {
+class XLNT_CLASS scatter_chart
+{
};
} // namespace xlnt
diff --git a/include/xlnt/charts/series.hpp b/include/xlnt/charts/series.hpp
index 13cb734a..e2b7e953 100644
--- a/include/xlnt/charts/series.hpp
+++ b/include/xlnt/charts/series.hpp
@@ -27,7 +27,8 @@
namespace xlnt {
-class XLNT_CLASS series {
+class XLNT_CLASS series
+{
};
} // namespace xlnt
diff --git a/include/xlnt/drawing/drawing.hpp b/include/xlnt/drawing/drawing.hpp
index 466e0816..44a14410 100644
--- a/include/xlnt/drawing/drawing.hpp
+++ b/include/xlnt/drawing/drawing.hpp
@@ -32,10 +32,10 @@ struct drawing_struct;
class XLNT_CLASS drawing
{
- public:
+public:
drawing();
- private:
+private:
friend class worksheet;
drawing(drawing_struct *root);
drawing_struct *root_;
diff --git a/include/xlnt/formula/known_formulae.hpp b/include/xlnt/formula/known_formulae.hpp
index ca9128ae..25ae8ace 100644
--- a/include/xlnt/formula/known_formulae.hpp
+++ b/include/xlnt/formula/known_formulae.hpp
@@ -27,7 +27,8 @@
namespace xlnt {
-class XLNT_CLASS known_formulae {
+class XLNT_CLASS known_formulae
+{
};
} // namespace xlnt
diff --git a/include/xlnt/formula/tokenizer.hpp b/include/xlnt/formula/tokenizer.hpp
index 6abad73e..ac4d8579 100644
--- a/include/xlnt/formula/tokenizer.hpp
+++ b/include/xlnt/formula/tokenizer.hpp
@@ -27,7 +27,8 @@
namespace xlnt {
-class XLNT_CLASS tokenizer {
+class XLNT_CLASS tokenizer
+{
};
} // namespace xlnt
diff --git a/include/xlnt/formula/translator.hpp b/include/xlnt/formula/translator.hpp
index aa1faa84..f209dc0f 100644
--- a/include/xlnt/formula/translator.hpp
+++ b/include/xlnt/formula/translator.hpp
@@ -47,7 +47,7 @@ class XLNT_CLASS translator
void translate_range(const range_reference &range_ref);
void translate_formula(const cell_reference &dest);
- private:
+private:
const std::string ROW_RANGE_RE;
const std::string COL_RANGE_RE;
const std::string CELL_REF_RE;
diff --git a/include/xlnt/packaging/default_type.hpp b/include/xlnt/packaging/default_type.hpp
index a03e27b5..654425ea 100644
--- a/include/xlnt/packaging/default_type.hpp
+++ b/include/xlnt/packaging/default_type.hpp
@@ -36,7 +36,7 @@ namespace xlnt {
///
class XLNT_CLASS default_type
{
- public:
+public:
default_type();
default_type(const std::string &extension, const std::string &content_type);
default_type(const default_type &other);
@@ -45,7 +45,7 @@ class XLNT_CLASS default_type
std::string get_extension() const;
std::string get_content_type() const;
- private:
+private:
std::string extension_;
std::string content_type_;
};
diff --git a/include/xlnt/packaging/manifest.hpp b/include/xlnt/packaging/manifest.hpp
index 7ca1b542..bf4be407 100644
--- a/include/xlnt/packaging/manifest.hpp
+++ b/include/xlnt/packaging/manifest.hpp
@@ -38,18 +38,18 @@ namespace xlnt {
///
class XLNT_CLASS manifest
{
- public:
+public:
bool has_default_type(const std::string &extension) const;
std::string get_default_type(const std::string &extension) const;
const std::vector &get_default_types() const;
void add_default_type(const std::string &extension, const std::string &content_type);
-
+
bool has_override_type(const std::string &part_name) const;
std::string get_override_type(const std::string &part_name) const;
const std::vector &get_override_types() const;
void add_override_type(const std::string &part_name, const std::string &content_type);
- private:
+private:
std::vector default_types_;
std::vector override_types_;
};
diff --git a/include/xlnt/packaging/override_type.hpp b/include/xlnt/packaging/override_type.hpp
index d11375fd..902be80f 100644
--- a/include/xlnt/packaging/override_type.hpp
+++ b/include/xlnt/packaging/override_type.hpp
@@ -35,7 +35,7 @@ namespace xlnt {
///
class XLNT_CLASS override_type
{
- public:
+public:
override_type();
override_type(const std::string &extension, const std::string &content_type);
override_type(const override_type &other);
@@ -44,7 +44,7 @@ class XLNT_CLASS override_type
std::string get_part_name() const;
std::string get_content_type() const;
- private:
+private:
std::string part_name_;
std::string content_type_;
};
diff --git a/include/xlnt/packaging/relationship.hpp b/include/xlnt/packaging/relationship.hpp
index 6093917a..e763bde8 100644
--- a/include/xlnt/packaging/relationship.hpp
+++ b/include/xlnt/packaging/relationship.hpp
@@ -50,7 +50,7 @@ enum class XLNT_CLASS target_mode
///
class XLNT_CLASS relationship
{
- public:
+public:
enum class type
{
invalid,
@@ -70,11 +70,11 @@ class XLNT_CLASS relationship
static type type_from_string(const std::string &type_string);
static std::string type_to_string(type t);
-
+
relationship();
-
+
relationship(const std::string &t, const std::string &r_id = "", const std::string &target_uri = "");
-
+
relationship(type t, const std::string &r_id = "", const std::string &target_uri = "");
///
@@ -98,12 +98,12 @@ class XLNT_CLASS relationship
std::string get_target_uri() const;
type get_type() const;
-
+
std::string get_type_string() const;
-
+
bool operator==(const relationship &rhs) const;
- private:
+private:
type type_;
std::string id_;
std::string source_uri_;
diff --git a/include/xlnt/packaging/zip_file.hpp b/include/xlnt/packaging/zip_file.hpp
index e8cd40b6..329de102 100644
--- a/include/xlnt/packaging/zip_file.hpp
+++ b/include/xlnt/packaging/zip_file.hpp
@@ -83,7 +83,7 @@ struct XLNT_CLASS zip_info
///
class XLNT_CLASS zip_file
{
- public:
+public:
zip_file();
zip_file(const std::string &filename);
zip_file(const std::vector &bytes);
@@ -143,7 +143,7 @@ class XLNT_CLASS zip_file
std::string comment;
- private:
+private:
void start_read();
void start_write();
diff --git a/include/xlnt/serialization/comment_serializer.hpp b/include/xlnt/serialization/comment_serializer.hpp
index 022d73c0..43e4a672 100644
--- a/include/xlnt/serialization/comment_serializer.hpp
+++ b/include/xlnt/serialization/comment_serializer.hpp
@@ -46,7 +46,7 @@ class XLNT_CLASS comment_serializer
xml_document write_comments() const;
xml_document write_comments_vml() const;
- private:
+private:
worksheet sheet_;
};
diff --git a/include/xlnt/serialization/excel_serializer.hpp b/include/xlnt/serialization/excel_serializer.hpp
index 4c4345b4..96ca27bf 100644
--- a/include/xlnt/serialization/excel_serializer.hpp
+++ b/include/xlnt/serialization/excel_serializer.hpp
@@ -41,7 +41,7 @@ class workbook;
///
class XLNT_CLASS excel_serializer
{
- public:
+public:
///
///
///
@@ -73,8 +73,8 @@ class XLNT_CLASS excel_serializer
/// Create a ZIP file in memory, load archive from bytes, then populate workbook
/// with data from archive.
///
- bool load_virtual_workbook(const std::vector &bytes, bool guess_types = false,
- bool data_only = false);
+ bool load_virtual_workbook(
+ const std::vector &bytes, bool guess_types = false, bool data_only = false);
///
/// Create a ZIP file in memory, save workbook to this archive, then save archive
@@ -94,7 +94,7 @@ class XLNT_CLASS excel_serializer
///
bool save_stream_workbook(std::ostream &stream, bool as_template = false);
- private:
+private:
///
/// Reads all files in archive and populates workbook with associated data
/// using other appropriate serializers such as workbook_serializer.
diff --git a/include/xlnt/serialization/manifest_serializer.hpp b/include/xlnt/serialization/manifest_serializer.hpp
index 37bf7b51..be280853 100644
--- a/include/xlnt/serialization/manifest_serializer.hpp
+++ b/include/xlnt/serialization/manifest_serializer.hpp
@@ -37,7 +37,7 @@ class xml_document;
///
class XLNT_CLASS manifest_serializer
{
- public:
+public:
manifest_serializer(manifest &m);
void read_manifest(const xml_document &xml);
@@ -45,7 +45,7 @@ class XLNT_CLASS manifest_serializer
std::string determine_document_type() const;
- private:
+private:
manifest &manifest_;
};
diff --git a/include/xlnt/serialization/relationship_serializer.hpp b/include/xlnt/serialization/relationship_serializer.hpp
index faa33013..016fa748 100644
--- a/include/xlnt/serialization/relationship_serializer.hpp
+++ b/include/xlnt/serialization/relationship_serializer.hpp
@@ -43,17 +43,17 @@ public:
/// Construct a serializer which operates on archive.
///
relationship_serializer(zip_file &archive);
-
+
///
/// Return a vector of relationships corresponding to target.
///
std::vector read_relationships(const std::string &target);
-
+
///
/// Write relationships to archive for the given target.
///
bool write_relationships(const std::vector &relationships, const std::string &target);
-
+
private:
///
/// Internal archive which is used for reading and writing.
diff --git a/include/xlnt/serialization/shared_strings_serializer.hpp b/include/xlnt/serialization/shared_strings_serializer.hpp
index 493d38d9..2a405c69 100644
--- a/include/xlnt/serialization/shared_strings_serializer.hpp
+++ b/include/xlnt/serialization/shared_strings_serializer.hpp
@@ -37,7 +37,7 @@ class xml_document;
///
class XLNT_CLASS shared_strings_serializer
{
- public:
+public:
static bool read_shared_strings(const xml_document &xml, std::vector &strings);
static xml_document write_shared_strings(const std::vector &strings);
};
diff --git a/include/xlnt/serialization/style_serializer.hpp b/include/xlnt/serialization/style_serializer.hpp
index 14846c9f..7f5ff8dd 100644
--- a/include/xlnt/serialization/style_serializer.hpp
+++ b/include/xlnt/serialization/style_serializer.hpp
@@ -51,7 +51,7 @@ class xml_node;
///
class XLNT_CLASS style_serializer
{
- public:
+public:
///
/// Construct a style_serializer which can write styles.xml based on wb or populate wb
/// with styles from an existing styles.xml.
@@ -269,7 +269,7 @@ class XLNT_CLASS style_serializer
///
bool write_style(const style &style_, xml_node &style_node) const;
- private:
+private:
///
/// Set in the constructor, this workbook is used as the source or target for all writing or reading, respectively.
///
diff --git a/include/xlnt/serialization/theme_serializer.hpp b/include/xlnt/serialization/theme_serializer.hpp
index c02fd003..410cdec9 100644
--- a/include/xlnt/serialization/theme_serializer.hpp
+++ b/include/xlnt/serialization/theme_serializer.hpp
@@ -37,11 +37,11 @@ class xml_document;
///
class XLNT_CLASS theme_serializer
{
- public:
+public:
bool read_theme(const xml_document &xml, theme &t);
xml_document write_theme(const theme &t) const;
- private:
+private:
};
} // namespace xlnt
diff --git a/include/xlnt/serialization/workbook_serializer.hpp b/include/xlnt/serialization/workbook_serializer.hpp
index eb253a4e..cd704845 100644
--- a/include/xlnt/serialization/workbook_serializer.hpp
+++ b/include/xlnt/serialization/workbook_serializer.hpp
@@ -44,7 +44,7 @@ class xml_node;
///
class XLNT_CLASS workbook_serializer
{
- public:
+public:
using string_pair = std::pair;
workbook_serializer(workbook &wb);
@@ -59,7 +59,7 @@ class XLNT_CLASS workbook_serializer
xml_node write_named_ranges() const;
- private:
+private:
workbook &workbook_;
};
diff --git a/include/xlnt/serialization/worksheet_serializer.hpp b/include/xlnt/serialization/worksheet_serializer.hpp
index 91b93a2a..4f619d47 100644
--- a/include/xlnt/serialization/worksheet_serializer.hpp
+++ b/include/xlnt/serialization/worksheet_serializer.hpp
@@ -41,13 +41,13 @@ class xml_document;
///
class XLNT_CLASS worksheet_serializer
{
- public:
+public:
worksheet_serializer(worksheet sheet);
bool read_worksheet(const xml_document &xml);
xml_document write_worksheet() const;
- private:
+private:
worksheet sheet_;
};
diff --git a/include/xlnt/serialization/xml_document.hpp b/include/xlnt/serialization/xml_document.hpp
index 17738d16..9a950b99 100644
--- a/include/xlnt/serialization/xml_document.hpp
+++ b/include/xlnt/serialization/xml_document.hpp
@@ -29,7 +29,9 @@
#include
namespace xlnt {
-namespace detail { struct xml_document_impl; }
+namespace detail {
+struct xml_document_impl;
+}
class xml_node;
class xml_serializer;
@@ -39,7 +41,7 @@ class xml_serializer;
///
class XLNT_CLASS xml_document
{
- public:
+public:
using string_pair = std::pair;
xml_document();
@@ -65,7 +67,7 @@ class XLNT_CLASS xml_document
std::string to_string() const;
xml_document &from_string(const std::string &xml_string);
- private:
+private:
friend class xml_serializer;
std::unique_ptr d_;
};
diff --git a/include/xlnt/serialization/xml_node.hpp b/include/xlnt/serialization/xml_node.hpp
index 9bc839b0..ad6aa0cb 100644
--- a/include/xlnt/serialization/xml_node.hpp
+++ b/include/xlnt/serialization/xml_node.hpp
@@ -29,7 +29,9 @@
#include
namespace xlnt {
-namespace detail { struct xml_node_impl; }
+namespace detail {
+struct xml_node_impl;
+}
class xml_document;
@@ -38,7 +40,7 @@ class xml_document;
///
class XLNT_CLASS xml_node
{
- public:
+public:
using string_pair = std::pair;
xml_node();
@@ -68,7 +70,7 @@ class XLNT_CLASS xml_node
std::string to_string() const;
- private:
+private:
friend class xml_document;
friend class xml_serializer;
xml_node(const detail::xml_node_impl &d);
diff --git a/include/xlnt/serialization/xml_serializer.hpp b/include/xlnt/serialization/xml_serializer.hpp
index 3718fc9a..e70404a9 100644
--- a/include/xlnt/serialization/xml_serializer.hpp
+++ b/include/xlnt/serialization/xml_serializer.hpp
@@ -36,7 +36,7 @@ class xml_node;
///
class XLNT_CLASS xml_serializer
{
- public:
+public:
static std::string serialize(const xml_document &xml);
static xml_document deserialize(const std::string &xml_string);
diff --git a/include/xlnt/styles/alignment.hpp b/include/xlnt/styles/alignment.hpp
index dd8e6270..3bb4b372 100644
--- a/include/xlnt/styles/alignment.hpp
+++ b/include/xlnt/styles/alignment.hpp
@@ -52,7 +52,7 @@ public:
vertical_alignment get_vertical() const;
void set_vertical(vertical_alignment vertical);
-
+
protected:
std::string to_hash_string() const override;
diff --git a/include/xlnt/styles/border.hpp b/include/xlnt/styles/border.hpp
index 4d5c870d..d8679c7f 100644
--- a/include/xlnt/styles/border.hpp
+++ b/include/xlnt/styles/border.hpp
@@ -41,7 +41,7 @@ class XLNT_CLASS border : public hashable
{
public:
static border default_border();
-
+
std::experimental::optional &get_start();
const std::experimental::optional &get_start() const;
std::experimental::optional &get_end();
@@ -63,7 +63,7 @@ public:
protected:
std::string to_hash_string() const override;
-
+
private:
std::experimental::optional start_;
std::experimental::optional end_;
diff --git a/include/xlnt/styles/color.hpp b/include/xlnt/styles/color.hpp
index c4830fe7..64744d5a 100644
--- a/include/xlnt/styles/color.hpp
+++ b/include/xlnt/styles/color.hpp
@@ -61,7 +61,7 @@ public:
color();
color(type t, std::size_t v);
-
+
color(type t, const std::string &v);
void set_auto(std::size_t auto_index);
@@ -79,7 +79,7 @@ public:
std::size_t get_theme() const;
std::string get_rgb_string() const;
-
+
protected:
std::string to_hash_string() const override;
diff --git a/include/xlnt/styles/fill.hpp b/include/xlnt/styles/fill.hpp
index bb8cb65d..e35a3307 100644
--- a/include/xlnt/styles/fill.hpp
+++ b/include/xlnt/styles/fill.hpp
@@ -34,7 +34,7 @@ namespace xlnt {
///
class XLNT_CLASS fill : public hashable
{
- public:
+public:
enum class type
{
none,
@@ -73,11 +73,11 @@ class XLNT_CLASS fill : public hashable
};
type get_type() const;
-
+
void set_type(type t);
std::string get_pattern_type_string() const;
-
+
std::string get_gradient_type_string() const;
pattern_type get_pattern_type() const;
@@ -87,17 +87,17 @@ class XLNT_CLASS fill : public hashable
void set_gradient_type(gradient_type t);
std::experimental::optional &get_foreground_color();
-
+
const std::experimental::optional &get_foreground_color() const;
-
+
std::experimental::optional &get_background_color();
const std::experimental::optional &get_background_color() const;
-
+
std::experimental::optional &get_start_color();
-
+
const std::experimental::optional &get_start_color() const;
-
+
std::experimental::optional &get_end_color();
const std::experimental::optional &get_end_color() const;
@@ -105,15 +105,15 @@ class XLNT_CLASS fill : public hashable
void set_rotation(double rotation);
double get_rotation() const;
-
+
double get_gradient_left() const;
double get_gradient_right() const;
-
+
double get_gradient_top() const;
-
+
double get_gradient_bottom() const;
-
+
protected:
std::string to_hash_string() const override;
diff --git a/include/xlnt/styles/font.hpp b/include/xlnt/styles/font.hpp
index 6befc24d..d0658894 100644
--- a/include/xlnt/styles/font.hpp
+++ b/include/xlnt/styles/font.hpp
@@ -38,7 +38,7 @@ class style;
///
class XLNT_CLASS font : public hashable
{
- public:
+public:
enum class underline_style
{
none,
@@ -49,49 +49,49 @@ class XLNT_CLASS font : public hashable
};
void set_bold(bool bold);
-
+
bool is_bold() const;
void set_italic(bool italic);
-
+
bool is_italic() const;
void set_strikethrough(bool strikethrough);
-
+
bool is_strikethrough() const;
void set_underline(underline_style new_underline);
-
+
bool is_underline() const;
-
+
underline_style get_underline() const;
void set_size(std::size_t size);
-
+
std::size_t get_size() const;
void set_name(const std::string &name);
-
+
std::string get_name() const;
void set_color(color c);
-
+
void set_family(std::size_t family);
-
+
void set_scheme(const std::string &scheme);
color get_color() const;
bool has_family() const;
-
+
std::size_t get_family() const;
bool has_scheme() const;
-
+
protected:
std::string to_hash_string() const override;
- private:
+private:
friend class style;
std::string name_ = "Calibri";
diff --git a/include/xlnt/styles/number_format.hpp b/include/xlnt/styles/number_format.hpp
index f66c3bfd..66272964 100644
--- a/include/xlnt/styles/number_format.hpp
+++ b/include/xlnt/styles/number_format.hpp
@@ -82,19 +82,19 @@ public:
void set_format_string(const std::string &format_code);
void set_format_string(const std::string &format_code, std::size_t custom_id);
-
+
std::string get_format_string() const;
bool has_id() const;
void set_id(std::size_t id);
-
+
std::size_t get_id() const;
-
+
std::string format(const std::string &text) const;
std::string format(long double number, calendar base_date) const;
-
+
bool is_date_format() const;
-
+
protected:
std::string to_hash_string() const override;
diff --git a/include/xlnt/styles/protection.hpp b/include/xlnt/styles/protection.hpp
index fd6267ff..c89f4193 100644
--- a/include/xlnt/styles/protection.hpp
+++ b/include/xlnt/styles/protection.hpp
@@ -35,7 +35,7 @@ namespace xlnt {
///
class XLNT_CLASS protection : public hashable
{
- public:
+public:
enum class type
{
inherit,
@@ -48,7 +48,7 @@ class XLNT_CLASS protection : public hashable
void set_locked(type locked_type);
void set_hidden(type hidden_type);
-
+
protected:
std::string to_hash_string() const override;
diff --git a/include/xlnt/styles/side.hpp b/include/xlnt/styles/side.hpp
index 19741e95..7a06f090 100644
--- a/include/xlnt/styles/side.hpp
+++ b/include/xlnt/styles/side.hpp
@@ -38,20 +38,20 @@ namespace xlnt {
///
class XLNT_CLASS side : public hashable
{
- public:
+public:
side();
std::experimental::optional &get_border_style();
-
+
const std::experimental::optional &get_border_style() const;
std::experimental::optional &get_color();
-
+
const std::experimental::optional &get_color() const;
protected:
std::string to_hash_string() const override;
-
+
private:
std::experimental::optional border_style_;
std::experimental::optional color_;
diff --git a/include/xlnt/styles/style.hpp b/include/xlnt/styles/style.hpp
index 03322fba..004f6f28 100644
--- a/include/xlnt/styles/style.hpp
+++ b/include/xlnt/styles/style.hpp
@@ -68,7 +68,7 @@ public:
void apply_font(bool apply);
void apply_number_format(bool apply);
void apply_protection(bool apply);
-
+
protected:
std::string to_hash_string() const override;
diff --git a/include/xlnt/utils/cell_coordinates_exception.hpp b/include/xlnt/utils/cell_coordinates_exception.hpp
index d324984e..24fc9d86 100644
--- a/include/xlnt/utils/cell_coordinates_exception.hpp
+++ b/include/xlnt/utils/cell_coordinates_exception.hpp
@@ -36,7 +36,7 @@ namespace xlnt {
///
class XLNT_CLASS cell_coordinates_exception : public std::runtime_error
{
- public:
+public:
cell_coordinates_exception(column_t column, row_t row);
cell_coordinates_exception(const std::string &coord_string);
};
diff --git a/include/xlnt/utils/column_string_index_exception.hpp b/include/xlnt/utils/column_string_index_exception.hpp
index b00f6dda..6026901c 100644
--- a/include/xlnt/utils/column_string_index_exception.hpp
+++ b/include/xlnt/utils/column_string_index_exception.hpp
@@ -34,7 +34,7 @@ namespace xlnt {
///
class XLNT_CLASS column_string_index_exception : public std::runtime_error
{
- public:
+public:
column_string_index_exception();
};
diff --git a/include/xlnt/utils/hashable.hpp b/include/xlnt/utils/hashable.hpp
index a431fc3d..0558763d 100644
--- a/include/xlnt/utils/hashable.hpp
+++ b/include/xlnt/utils/hashable.hpp
@@ -34,7 +34,7 @@ class XLNT_CLASS hashable
public:
std::size_t hash() const;
bool operator==(const hashable &other) const;
-
+
protected:
virtual std::string to_hash_string() const = 0;
};
diff --git a/include/xlnt/utils/invalid_file_exception.hpp b/include/xlnt/utils/invalid_file_exception.hpp
index 0b6944a2..c0012f08 100644
--- a/include/xlnt/utils/invalid_file_exception.hpp
+++ b/include/xlnt/utils/invalid_file_exception.hpp
@@ -35,7 +35,7 @@ namespace xlnt {
///
class XLNT_CLASS invalid_file_exception : public std::runtime_error
{
- public:
+public:
invalid_file_exception(const std::string &filename);
};
diff --git a/include/xlnt/utils/named_range_exception.hpp b/include/xlnt/utils/named_range_exception.hpp
index 3852ddcc..4a9473e0 100644
--- a/include/xlnt/utils/named_range_exception.hpp
+++ b/include/xlnt/utils/named_range_exception.hpp
@@ -34,7 +34,7 @@ namespace xlnt {
///
class XLNT_CLASS named_range_exception : public std::runtime_error
{
- public:
+public:
named_range_exception();
};
diff --git a/include/xlnt/utils/read_only_workbook_exception.hpp b/include/xlnt/utils/read_only_workbook_exception.hpp
index 7e91921e..cc757e6e 100644
--- a/include/xlnt/utils/read_only_workbook_exception.hpp
+++ b/include/xlnt/utils/read_only_workbook_exception.hpp
@@ -34,7 +34,7 @@ namespace xlnt {
///
class XLNT_CLASS read_only_workbook_exception : public std::runtime_error
{
- public:
+public:
read_only_workbook_exception();
};
diff --git a/include/xlnt/utils/sheet_title_exception.hpp b/include/xlnt/utils/sheet_title_exception.hpp
index b65a1446..60301d7a 100644
--- a/include/xlnt/utils/sheet_title_exception.hpp
+++ b/include/xlnt/utils/sheet_title_exception.hpp
@@ -35,7 +35,7 @@ namespace xlnt {
///
class XLNT_CLASS sheet_title_exception : public std::runtime_error
{
- public:
+public:
sheet_title_exception(const std::string &title);
};
diff --git a/include/xlnt/utils/unicode_decode_error.hpp b/include/xlnt/utils/unicode_decode_error.hpp
index d15660ec..c8bcedc4 100644
--- a/include/xlnt/utils/unicode_decode_error.hpp
+++ b/include/xlnt/utils/unicode_decode_error.hpp
@@ -35,7 +35,7 @@ namespace xlnt {
///
class XLNT_CLASS unicode_decode_error : public std::runtime_error
{
- public:
+public:
unicode_decode_error();
unicode_decode_error(char c);
unicode_decode_error(std::uint8_t b);
diff --git a/include/xlnt/workbook/document_security.hpp b/include/xlnt/workbook/document_security.hpp
index de8ffb4f..5694437a 100644
--- a/include/xlnt/workbook/document_security.hpp
+++ b/include/xlnt/workbook/document_security.hpp
@@ -34,13 +34,13 @@ namespace xlnt {
///
class XLNT_CLASS document_security
{
- public:
+public:
document_security();
bool lock_revision;
bool lock_structure;
bool lock_windows;
-
+
std::string revision_password;
std::string workbook_password;
};
diff --git a/include/xlnt/workbook/named_range.hpp b/include/xlnt/workbook/named_range.hpp
index d3fd200d..459817bf 100644
--- a/include/xlnt/workbook/named_range.hpp
+++ b/include/xlnt/workbook/named_range.hpp
@@ -33,7 +33,7 @@ namespace xlnt {
class range_reference;
class worksheet;
-//TODO: why is this not in a class?
+// TODO: why is this not in a class?
std::vector> XLNT_FUNCTION split_named_range(const std::string &named_range_string);
///
@@ -42,7 +42,7 @@ std::vector> XLNT_FUNCTION split_named_range
///
class XLNT_CLASS named_range
{
- public:
+public:
using target = std::pair;
named_range();
@@ -54,7 +54,7 @@ class XLNT_CLASS named_range
named_range &operator=(const named_range &other);
- private:
+private:
std::string name_;
std::vector targets_;
};
diff --git a/include/xlnt/workbook/workbook.hpp b/include/xlnt/workbook/workbook.hpp
index 7aa77f0e..5d2fcbce 100644
--- a/include/xlnt/workbook/workbook.hpp
+++ b/include/xlnt/workbook/workbook.hpp
@@ -56,17 +56,19 @@ class zip_file;
enum class encoding;
-namespace detail { struct workbook_impl; } // namespace detail
+namespace detail {
+struct workbook_impl;
+} // namespace detail
///
/// workbook is the container for all other parts of the document.
///
class XLNT_CLASS workbook
{
- public:
+public:
class XLNT_CLASS iterator
{
- public:
+ public:
iterator(workbook &wb, std::size_t index);
iterator(const iterator &);
iterator &operator=(const iterator &);
@@ -79,14 +81,14 @@ class XLNT_CLASS workbook
iterator operator++(int);
iterator &operator++();
- private:
+ private:
workbook &wb_;
std::size_t index_;
};
class XLNT_CLASS const_iterator
{
- public:
+ public:
const_iterator(const workbook &wb, std::size_t index);
const_iterator(const const_iterator &);
const_iterator &operator=(const const_iterator &);
@@ -99,7 +101,7 @@ class XLNT_CLASS workbook
const_iterator operator++(int);
const_iterator &operator++();
- private:
+ private:
const workbook &wb_;
std::size_t index_;
};
@@ -251,7 +253,7 @@ class XLNT_CLASS workbook
std::vector &get_shared_strings();
const std::vector &get_shared_strings() const;
- private:
+private:
friend class worksheet;
std::shared_ptr d_;
};
diff --git a/include/xlnt/worksheet/cell_vector.hpp b/include/xlnt/worksheet/cell_vector.hpp
index f8fa2e96..a73d4852 100644
--- a/include/xlnt/worksheet/cell_vector.hpp
+++ b/include/xlnt/worksheet/cell_vector.hpp
@@ -41,10 +41,10 @@ class range_reference;
///
class XLNT_CLASS cell_vector
{
- public:
+public:
class XLNT_CLASS iterator : public std::iterator
{
- public:
+ public:
iterator(worksheet ws, const cell_reference &start_cell, major_order order = major_order::row);
iterator(const iterator &other);
@@ -56,23 +56,23 @@ class XLNT_CLASS cell_vector
bool operator!=(const iterator &other) const;
iterator &operator--();
-
+
iterator operator--(int);
iterator &operator++();
iterator operator++(int);
- private:
+ private:
worksheet ws_;
cell_reference current_cell_;
range_reference range_;
major_order order_;
};
-
+
class XLNT_CLASS const_iterator : public std::iterator
{
- public:
+ public:
const_iterator(worksheet ws, const cell_reference &start_cell, major_order order = major_order::row);
const_iterator(const const_iterator &other);
@@ -88,10 +88,10 @@ class XLNT_CLASS cell_vector
const_iterator operator--(int);
const_iterator &operator++();
-
+
const_iterator operator++(int);
- private:
+ private:
worksheet ws_;
cell_reference current_cell_;
range_reference range_;
@@ -125,11 +125,11 @@ class XLNT_CLASS cell_vector
const_iterator begin() const;
const_iterator cbegin() const;
-
+
const_iterator end() const;
const_iterator cend() const;
- private:
+private:
worksheet ws_;
range_reference ref_;
major_order order_;
diff --git a/include/xlnt/worksheet/footer.hpp b/include/xlnt/worksheet/footer.hpp
index 900fb10e..fa6767d7 100644
--- a/include/xlnt/worksheet/footer.hpp
+++ b/include/xlnt/worksheet/footer.hpp
@@ -35,20 +35,20 @@ namespace xlnt {
///
class XLNT_CLASS footer
{
- public:
+public:
footer();
-
+
void set_text(const std::string &text);
-
+
void set_font_name(const std::string &font_name);
-
+
void set_font_size(std::size_t font_size);
-
+
void set_font_color(const std::string &font_color);
-
+
bool is_default() const;
- private:
+private:
bool default_;
std::string text_;
std::string font_name_;
diff --git a/include/xlnt/worksheet/header.hpp b/include/xlnt/worksheet/header.hpp
index 69093757..48e4f920 100644
--- a/include/xlnt/worksheet/header.hpp
+++ b/include/xlnt/worksheet/header.hpp
@@ -35,20 +35,20 @@ namespace xlnt {
///
class XLNT_CLASS header
{
- public:
+public:
header();
-
+
void set_text(const std::string &text);
-
+
void set_font_name(const std::string &font_name);
-
+
void set_font_size(std::size_t font_size);
-
+
void set_font_color(const std::string &font_color);
-
+
bool is_default() const;
- private:
+private:
bool default_;
std::string text_;
std::string font_name_;
diff --git a/include/xlnt/worksheet/header_footer.hpp b/include/xlnt/worksheet/header_footer.hpp
index dfcf5547..d7c50764 100644
--- a/include/xlnt/worksheet/header_footer.hpp
+++ b/include/xlnt/worksheet/header_footer.hpp
@@ -37,13 +37,13 @@ namespace xlnt {
///
class XLNT_CLASS header_footer
{
- public:
+public:
header_footer();
header &get_left_header();
header &get_center_header();
header &get_right_header();
-
+
footer &get_left_footer();
footer &get_center_footer();
footer &get_right_footer();
@@ -52,7 +52,7 @@ class XLNT_CLASS header_footer
bool is_default_footer() const;
bool is_default() const;
- private:
+private:
header left_header_, right_header_, center_header_;
footer left_footer_, right_footer_, center_footer_;
};
diff --git a/include/xlnt/worksheet/page_margins.hpp b/include/xlnt/worksheet/page_margins.hpp
index 14836ea4..fddba423 100644
--- a/include/xlnt/worksheet/page_margins.hpp
+++ b/include/xlnt/worksheet/page_margins.hpp
@@ -32,30 +32,30 @@ namespace xlnt {
///
class XLNT_CLASS page_margins
{
- public:
+public:
page_margins();
bool is_default() const;
-
+
double get_top() const;
void set_top(double top);
-
+
double get_left() const;
void set_left(double left);
-
+
double get_bottom() const;
void set_bottom(double bottom);
-
+
double get_right() const;
void set_right(double right);
-
+
double get_header() const;
void set_header(double header);
-
+
double get_footer() const;
void set_footer(double footer);
- private:
+private:
bool default_;
double top_;
double left_;
diff --git a/include/xlnt/worksheet/page_setup.hpp b/include/xlnt/worksheet/page_setup.hpp
index 6f339818..fa8cea23 100644
--- a/include/xlnt/worksheet/page_setup.hpp
+++ b/include/xlnt/worksheet/page_setup.hpp
@@ -36,9 +36,9 @@ namespace xlnt {
///
struct XLNT_CLASS page_setup
{
- public:
+public:
page_setup();
-
+
bool is_default() const;
page_break get_break() const;
@@ -78,10 +78,10 @@ struct XLNT_CLASS page_setup
bool get_vertical_centered() const;
void set_scale(double scale);
-
+
double get_scale() const;
- private:
+private:
bool default_;
page_break break_;
sheet_state sheet_state_;
diff --git a/include/xlnt/worksheet/range.hpp b/include/xlnt/worksheet/range.hpp
index c0e3dcda..11ab34e3 100644
--- a/include/xlnt/worksheet/range.hpp
+++ b/include/xlnt/worksheet/range.hpp
@@ -41,10 +41,10 @@ namespace xlnt {
///
class XLNT_CLASS range
{
- public:
+public:
using iterator = range_iterator_2d;
using const_iterator = const_range_iterator_2d;
-
+
range(worksheet ws, const range_reference &reference, major_order order = major_order::row, bool skip_null = false);
~range();
@@ -80,7 +80,7 @@ class XLNT_CLASS range
const_iterator cbegin() const;
const_iterator cend() const;
- private:
+private:
worksheet ws_;
range_reference ref_;
major_order order_;
diff --git a/include/xlnt/worksheet/range_iterator_2d.hpp b/include/xlnt/worksheet/range_iterator_2d.hpp
index b972c27a..cbfc7315 100644
--- a/include/xlnt/worksheet/range_iterator_2d.hpp
+++ b/include/xlnt/worksheet/range_iterator_2d.hpp
@@ -32,7 +32,9 @@ namespace xlnt {
class cell_vector;
class worksheet;
-namespace detail { struct worksheet_impl; }
+namespace detail {
+struct worksheet_impl;
+}
///
/// An iterator used by worksheet and range for traversing
@@ -40,7 +42,7 @@ namespace detail { struct worksheet_impl; }
///
class XLNT_CLASS range_iterator_2d : public std::iterator
{
- public:
+public:
range_iterator_2d(worksheet &ws, const range_reference &start_cell, major_order order = major_order::row);
range_iterator_2d(const range_iterator_2d &other);
@@ -59,22 +61,22 @@ class XLNT_CLASS range_iterator_2d : public std::iterator
/// A const version of range_iterator_2d which does not allow modification
/// to the dereferenced cell_vector.
///
class XLNT_CLASS const_range_iterator_2d : public std::iterator
{
- public:
- const_range_iterator_2d(const worksheet &ws, const range_reference &start_cell, major_order order = major_order::row);
+public:
+ const_range_iterator_2d(
+ const worksheet &ws, const range_reference &start_cell, major_order order = major_order::row);
const_range_iterator_2d(const const_range_iterator_2d &other);
@@ -92,7 +94,7 @@ class XLNT_CLASS const_range_iterator_2d : public std::iterator
class XLNT_CLASS range_reference
{
- public:
+public:
///
/// Convert a coordinate to an absolute coordinate string (B12 -> $B$12)
///
@@ -47,17 +47,17 @@ class XLNT_CLASS range_reference
range_reference(column_t column_index_start, row_t row_index_start, column_t column_index_end, row_t row_index_end);
bool is_single_cell() const;
-
+
std::size_t get_width() const;
-
+
std::size_t get_height() const;
-
+
cell_reference get_top_left() const;
-
+
cell_reference get_bottom_right() const;
-
+
cell_reference &get_top_left();
-
+
cell_reference &get_bottom_right();
range_reference make_offset(int column_offset, int row_offset) const;
@@ -65,17 +65,17 @@ class XLNT_CLASS range_reference
std::string to_string() const;
bool operator==(const range_reference &comparand) const;
-
+
bool operator==(const std::string &reference_string) const;
-
+
bool operator==(const char *reference_string) const;
-
+
bool operator!=(const range_reference &comparand) const;
-
+
bool operator!=(const std::string &reference_string) const;
-
+
bool operator!=(const char *reference_string) const;
-
+
XLNT_FUNCTION friend bool operator==(const std::string &reference_string, const range_reference &ref);
XLNT_FUNCTION friend bool operator==(const char *reference_string, const range_reference &ref);
@@ -84,11 +84,9 @@ class XLNT_CLASS range_reference
XLNT_FUNCTION friend bool operator!=(const char *reference_string, const range_reference &ref);
- private:
+private:
cell_reference top_left_;
cell_reference bottom_right_;
};
-
-
} // namespace xlnt
diff --git a/include/xlnt/worksheet/sheet_protection.hpp b/include/xlnt/worksheet/sheet_protection.hpp
index e7d1a6e6..7384c3a0 100644
--- a/include/xlnt/worksheet/sheet_protection.hpp
+++ b/include/xlnt/worksheet/sheet_protection.hpp
@@ -34,13 +34,13 @@ namespace xlnt {
///
class XLNT_CLASS sheet_protection
{
- public:
+public:
static std::string hash_password(const std::string &password);
void set_password(const std::string &password);
std::string get_hashed_password() const;
- private:
+private:
std::string hashed_password_;
};
diff --git a/include/xlnt/worksheet/worksheet.hpp b/include/xlnt/worksheet/worksheet.hpp
index 741aee3c..1a3ab48d 100644
--- a/include/xlnt/worksheet/worksheet.hpp
+++ b/include/xlnt/worksheet/worksheet.hpp
@@ -51,7 +51,9 @@ class workbook;
struct date;
-namespace detail { struct worksheet_impl; }
+namespace detail {
+struct worksheet_impl;
+}
///
/// A worksheet is a 2D array of cells starting with cell A1 in the top-left corner
@@ -62,7 +64,7 @@ class XLNT_CLASS worksheet
public:
using iterator = range_iterator_2d;
using const_iterator = const_range_iterator_2d;
-
+
worksheet();
worksheet(const worksheet &rhs);
worksheet(workbook &parent_workbook, const std::string &title = std::string());
@@ -211,15 +213,15 @@ public:
const_iterator cbegin() const;
const_iterator cend() const;
-
+
range iter_cells(bool skip_null);
- private:
+private:
friend class workbook;
friend class cell;
friend class range_iterator_2d;
friend class const_range_iterator_2d;
-
+
worksheet(detail::worksheet_impl *d);
detail::worksheet_impl *d_;
};