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
|
||||
|
|
|
@ -20,6 +20,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 <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>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <algorithm>
|
||||
|
|
|
@ -20,6 +20,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 <string>
|
||||
|
@ -98,7 +99,7 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string register_relationship(const uri &source, relationship_type type, const uri &target, target_mode mode, const std::string &rel_id);
|
||||
std::string register_relationship(const class relationship &rel);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
@ -108,7 +109,8 @@ 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.
|
||||
|
|
|
@ -20,6 +20,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>
|
||||
|
@ -104,7 +105,10 @@ 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_;
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
|
@ -94,7 +95,10 @@ public:
|
|||
/// <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:
|
||||
/// <summary>
|
||||
|
@ -146,7 +150,10 @@ 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>
|
||||
|
|
|
@ -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>
|
||||
|
@ -283,7 +284,10 @@ public:
|
|||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool operator!=(const color &other) const { return !(*this == other); }
|
||||
bool operator!=(const color &other) const
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
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>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <unordered_map>
|
||||
|
@ -106,7 +107,10 @@ 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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -194,7 +195,10 @@ public:
|
|||
/// <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;
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
|
|
|
@ -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>
|
||||
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
@ -125,9 +148,7 @@ public:
|
|||
/// </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:
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
@ -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>
|
||||
///
|
||||
|
|
|
@ -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,39 +39,54 @@ 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:
|
||||
|
|
|
@ -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,90 +41,136 @@ 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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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