start moving all implementations to source files

This commit is contained in:
Thomas Fussell 2015-11-19 22:54:54 -05:00
parent 8f7f52f2b8
commit 47b81a83de
125 changed files with 3321 additions and 1288 deletions

9
AUTHORS.md Normal file
View File

@ -0,0 +1,9 @@
This project was started by Thomas Fussell.
It was initially inspired by the openpyxl library: https://openpyxl.readthedocs.org
Thanks to everyone who has contributed to this project (in alphabetical order):
* Malvineous
Project logo designed by Thomas Fussell.

23
LICENCE.md Normal file
View File

@ -0,0 +1,23 @@
This software is under the MIT Licence
======================================
Copyright (c) 2014-2015 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, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

23
TODO.md Normal file
View File

@ -0,0 +1,23 @@
For release:
Move all method definitions out of headers.
Clean up iterators in workbook, worksheet, cell_vector, range.
One class per header.
Set up Coveralls.
Synchronize tests for workbook, worksheet, cell, core_properties, manifest, relationship, stylesheet, number_format, format_rule, tokenizer.
Synchronize samples.
Summarize what works and what doesn't.
Finish documenting all header files.
Port benchmarks.
Clean up CMake scripts.
Release 0.9.0 for Windows (static 32-bit, dll 32-bit, static 64-bit, dll 32-bit), Ubuntu 14.04 64-bit (static, shared), OSX 10.11 (static, dylib, framework).
XML wrappers aren't very pretty, improve them?
100% test coverage.
Then:
Implement conditional formatting.
Implement charts.
Implement chartsheets.
Implement drawing.
Implement formula evaluation?
Implement pivot tables.
Implement XML validation.

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -27,10 +27,10 @@
#include <string>
#include <unordered_map>
#include <xlnt/xlnt_config.hpp>
#include <xlnt/cell/cell_type.hpp>
#include <xlnt/cell/types.hpp>
#include "xlnt_config.hpp"
namespace xlnt {
enum class calendar;
@ -65,24 +65,7 @@ namespace detail { struct cell_impl; }
class XLNT_CLASS cell
{
public:
/// <summary>
/// Enumerates the possible types a cell can be determined by it's current value.
/// </summary>
enum class type
{
/// no value. note: this is different from an empty string value or 0 numeric value
null,
/// number
numeric,
/// string
string,
/// value is a formula
formula,
/// value is a known error code such as \#VALUE!
error,
/// value is TRUE or FALSE
boolean
};
using type = cell_type;
/// <summary>
/// Return a map of error strings such as \#DIV/0! and their associated indices.
@ -392,16 +375,13 @@ public:
/// Convenience function for writing cell to an ostream.
/// Uses cell::to_string() internally.
/// </summary>
friend XLNT_FUNCTION std::ostream &operator<<(std::ostream &stream, const xlnt::cell &cell)
{
return stream << cell.to_string();
}
friend XLNT_FUNCTION std::ostream &operator<<(std::ostream &stream, const xlnt::cell &cell);
private:
// make these friends so they can use the private constructor
friend class style;
friend class worksheet;
friend struct detail::cell_impl;
friend class style;
/// <summary>
/// Private constructor to create a cell from its implementation.

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 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
@ -26,10 +26,9 @@
#include <string>
#include <utility>
#include <xlnt/xlnt_config.hpp>
#include <xlnt/cell/types.hpp>
#include "xlnt_config.hpp"
namespace xlnt {
class cell_reference;
@ -65,8 +64,8 @@ class XLNT_CLASS cell_reference
/// if column part or row part are prefixed by a dollar-sign indicating they
/// are absolute, otherwise false.
/// </summary>
static std::pair<std::string, row_t> split_reference(const std::string &reference_string, bool &absolute_column,
bool &absolute_row);
static std::pair<std::string, row_t> split_reference(const std::string &reference_string,
bool &absolute_column, bool &absolute_row);
// constructors
@ -118,36 +117,24 @@ class XLNT_CLASS cell_reference
/// <summary>
/// Return true if the reference refers to an absolute column, otherwise false.
/// </summary>
bool column_absolute() const
{
return absolute_column_;
}
bool column_absolute() const;
/// <summary>
/// Make this reference have an absolute column if absolute_column is true,
/// otherwise not absolute.
/// </summary>
void column_absolute(bool absolute_column)
{
absolute_column_ = absolute_column;
}
void column_absolute(bool absolute_column);
/// <summary>
/// Return true if the reference refers to an absolute row, otherwise false.
/// </summary>
bool row_absolute() const
{
return absolute_row_;
}
bool row_absolute() const;
/// <summary>
/// Make this reference have an absolute row if absolute_row is true,
/// otherwise not absolute.
/// </summary>
void row_absolute(bool absolute_row)
{
absolute_row_ = absolute_row;
}
void row_absolute(bool absolute_row);
// getters/setters
@ -155,50 +142,32 @@ class XLNT_CLASS cell_reference
/// Return a string that identifies the column of this reference
/// (e.g. second column from left is "B")
/// </summary>
column_t get_column() const
{
return column_;
}
column_t get_column() const;
/// <summary>
/// Set the column of this reference from a string that identifies a particular column.
/// </summary>
void set_column(const std::string &column_string)
{
column_ = column_t(column_string);
}
void set_column(const std::string &column_string);
/// <summary>
/// Return a 1-indexed numeric index of the column of this reference.
/// </summary>
column_t get_column_index() const
{
return column_;
}
column_t get_column_index() const;
/// <summary>
/// Set the column of this reference from a 1-indexed number that identifies a particular column.
/// </summary>
void set_column_index(column_t column)
{
column_ = column;
}
void set_column_index(column_t column);
/// <summary>
/// Return a 1-indexed numeric index of the row of this reference.
/// </summary>
row_t get_row() const
{
return row_;
}
row_t get_row() const;
/// <summary>
/// Set the row of this reference from a 1-indexed number that identifies a particular row.
/// </summary>
void set_row(row_t row)
{
row_ = row;
}
void set_row(row_t row);
/// <summary>
/// Return a cell_reference offset from this cell_reference by
@ -237,46 +206,31 @@ class XLNT_CLASS cell_reference
/// Construct a cell_reference from reference_string and return the result
/// of their comparison.
/// </summary>
bool operator==(const std::string &reference_string) const
{
return *this == cell_reference(reference_string);
}
bool operator==(const std::string &reference_string) const;
/// <summary>
/// Construct a cell_reference from reference_string and return the result
/// of their comparison.
/// </summary>
bool operator==(const char *reference_string) const
{
return *this == std::string(reference_string);
}
bool operator==(const char *reference_string) const;
/// <summary>
/// Return true if this reference is not identical to comparand including
/// in absoluteness of column and row.
/// </summary>
bool operator!=(const cell_reference &comparand) const
{
return !(*this == comparand);
}
bool operator!=(const cell_reference &comparand) const;
/// <summary>
/// Construct a cell_reference from reference_string and return the result
/// of their comparison.
/// </summary>
bool operator!=(const std::string &reference_string) const
{
return *this != cell_reference(reference_string);
}
bool operator!=(const std::string &reference_string) const;
/// <summary>
/// Construct a cell_reference from reference_string and return the result
/// of their comparison.
/// </summary>
bool operator!=(const char *reference_string) const
{
return *this != std::string(reference_string);
}
bool operator!=(const char *reference_string) const;
//TODO: are these useful? maybe get rid of them
bool operator<(const cell_reference &other);

View File

@ -0,0 +1,49 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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>
namespace xlnt {
/// <summary>
/// Enumerates the possible types a cell can be determined by it's current value.
/// </summary>
enum class XLNT_CLASS cell_type
{
/// no value. note: this is different from an empty string value or 0 numeric value
null,
/// number
numeric,
/// string
string,
/// value is a formula
formula,
/// value is a known error code such as \#VALUE!
error,
/// value is TRUE or FALSE
boolean
};
} // namespace xlnt

View File

@ -1,8 +1,31 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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 <string>
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 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
@ -26,7 +26,7 @@
#include <cstdint>
#include <string>
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
// We might want to change these types for various optimizations in the future
// so use typedefs.
@ -71,241 +71,237 @@ public:
/// <summary>
/// Default column_t is the first (left-most) column.
/// </summary>
column_t() : index(1) {}
column_t();
/// <summary>
/// Construct a column from a number.
/// </summary>
column_t(index_t column_index) : index(column_index) {}
column_t(index_t column_index);
/// <summary>
/// Construct a column from a string.
/// </summary>
explicit column_t(const std::string &column_string) : index(column_index_from_string(column_string)) {}
explicit column_t(const std::string &column_string);
/// <summary>
/// Construct a column from a string.
/// </summary>
explicit column_t(const char *column_string) : column_t(std::string(column_string)) {}
explicit column_t(const char *column_string);
/// <summary>
/// Copy constructor
/// </summary>
column_t(const column_t &other) : column_t(other.index) {}
column_t(const column_t &other);
/// <summary>
/// Move constructor
/// </summary>
column_t(column_t &&other) { swap(*this, other); }
column_t(column_t &&other);
/// <summary>
/// Return a string representation of this column index.
/// </summary>
std::string column_string() const { return column_string_from_index(index); }
std::string column_string() const;
/// <summary>
/// Set this column to be the same as rhs's and return reference to self.
/// </summary>
column_t &operator=(column_t rhs) { swap(*this, rhs); return *this; }
column_t &operator=(column_t rhs);
/// <summary>
/// Set this column to be equal to rhs and return reference to self.
/// </summary>
column_t &operator=(const std::string &rhs) { return *this = column_t(rhs); }
column_t &operator=(const std::string &rhs);
/// <summary>
/// Set this column to be equal to rhs and return reference to self.
/// </summary>
column_t &operator=(const char *rhs) { return *this = column_t(rhs); }
column_t &operator=(const char *rhs);
/// <summary>
/// Return true if this column refers to the same column as other.
/// </summary>
bool operator==(const column_t &other) const { return index == other.index; }
bool operator==(const column_t &other) const;
/// <summary>
/// Return true if this column doesn't refer to the same column as other.
/// </summary>
bool operator!=(const column_t &other) const { return !(*this == other); }
bool operator!=(const column_t &other) const;
/// <summary>
/// Return true if this column refers to the same column as other.
/// </summary>
bool operator==(int other) const { return *this == column_t(other); }
bool operator==(int other) const;
/// <summary>
/// Return true if this column refers to the same column as other.
/// </summary>
bool operator==(index_t other) const { return *this == column_t(other); }
bool operator==(index_t other) const;
/// <summary>
/// Return true if this column refers to the same column as other.
/// </summary>
bool operator==(const std::string &other) const { return *this == column_t(other); }
bool operator==(const std::string &other) const;
/// <summary>
/// Return true if this column refers to the same column as other.
/// </summary>
bool operator==(const char *other) const { return *this == column_t(other); }
bool operator==(const char *other) const;
/// <summary>
/// Return true if this column doesn't refer to the same column as other.
/// </summary>
bool operator!=(int other) const { return !(*this == other); }
bool operator!=(int other) const;
/// <summary>
/// Return true if this column doesn't refer to the same column as other.
/// </summary>
bool operator!=(index_t other) const { return !(*this == other); }
bool operator!=(index_t other) const;
/// <summary>
/// Return true if this column doesn't refer to the same column as other.
/// </summary>
bool operator!=(const std::string &other) const { return !(*this == other); }
bool operator!=(const std::string &other) const;
/// <summary>
/// Return true if this column doesn't refer to the same column as other.
/// </summary>
bool operator!=(const char *other) const { return !(*this == other); }
bool operator!=(const char *other) const;
/// <summary>
/// Return true if other is to the right of this column.
/// </summary>
bool operator>(const column_t &other) const { return index > other.index; }
bool operator>(const column_t &other) const;
/// <summary>
/// Return true if other is to the right of or equal to this column.
/// </summary>
bool operator>=(const column_t &other) const { return index >= other.index; }
bool operator>=(const column_t &other) const;
/// <summary>
/// Return true if other is to the left of this column.
/// </summary>
bool operator<(const column_t &other) const { return index < other.index; }
bool operator<(const column_t &other) const;
/// <summary>
/// Return true if other is to the left of or equal to this column.
/// </summary>
bool operator<=(const column_t &other) const { return index <= other.index; }
bool operator<=(const column_t &other) const;
/// <summary>
/// Return true if other is to the right of this column.
/// </summary>
bool operator>(const column_t::index_t &other) const { return index > other; }
bool operator>(const column_t::index_t &other) const;
/// <summary>
/// Return true if other is to the right of or equal to this column.
/// </summary>
bool operator>=(const column_t::index_t &other) const { return index >= other; }
bool operator>=(const column_t::index_t &other) const;
/// <summary>
/// Return true if other is to the left of this column.
/// </summary>
bool operator<(const column_t::index_t &other) const { return index < other; }
bool operator<(const column_t::index_t &other) const;
/// <summary>
/// Return true if other is to the left of or equal to this column.
/// </summary>
bool operator<=(const column_t::index_t &other) const { return index <= other; }
bool operator<=(const column_t::index_t &other) const;
/// <summary>
/// Pre-increment this column, making it point to the column one to the right.
/// </summary>
column_t &operator++() { index++; return *this; }
column_t &operator++();
/// <summary>
/// Pre-deccrement this column, making it point to the column one to the left.
/// </summary>
column_t &operator--() { index--; return *this; }
column_t &operator--();
/// <summary>
/// Post-increment this column, making it point to the column one to the right and returning the old column.
/// </summary>
column_t operator++(int) { column_t copy(index); ++(*this); return copy; }
column_t operator++(int);
/// <summary>
/// Post-decrement this column, making it point to the column one to the left and returning the old column.
/// </summary>
column_t operator--(int) { column_t copy(index); --(*this); return copy; }
column_t operator--(int);
/// <summary>
/// Return the result of adding rhs to this column.
/// </summary>
column_t operator+(const column_t &rhs) { column_t copy(*this); copy.index += rhs.index; return copy; }
column_t operator+(const column_t &rhs);
/// <summary>
/// Return the result of adding rhs to this column.
/// </summary>
column_t operator-(const column_t &rhs) { column_t copy(*this); copy.index -= rhs.index; return copy; }
column_t operator-(const column_t &rhs);
/// <summary>
/// Return the result of adding rhs to this column.
/// </summary>
column_t operator*(const column_t &rhs) { column_t copy(*this); copy.index *= rhs.index; return copy; }
column_t operator*(const column_t &rhs);
/// <summary>
/// Return the result of adding rhs to this column.
/// </summary>
column_t operator/(const column_t &rhs) { column_t copy(*this); copy.index /= rhs.index; return copy; }
column_t operator/(const column_t &rhs);
/// <summary>
/// Return the result of adding rhs to this column.
/// </summary>
column_t operator%(const column_t &rhs) { column_t copy(*this); copy.index %= rhs.index; return copy; }
column_t operator%(const column_t &rhs);
/// <summary>
/// Add rhs to this column and return a reference to this column.
/// </summary>
column_t &operator+=(const column_t &rhs) { return *this = (*this + rhs); }
column_t &operator+=(const column_t &rhs);
/// <summary>
/// Subtrac rhs from this column and return a reference to this column.
/// </summary>
column_t &operator-=(const column_t &rhs) { return *this = (*this - rhs); }
column_t &operator-=(const column_t &rhs);
/// <summary>
/// Multiply this column by rhs and return a reference to this column.
/// </summary>
column_t &operator*=(const column_t &rhs) { return *this = (*this * rhs); }
column_t &operator*=(const column_t &rhs);
/// <summary>
/// Divide this column by rhs and return a reference to this column.
/// </summary>
column_t &operator/=(const column_t &rhs) { return *this = (*this / rhs); }
column_t &operator/=(const column_t &rhs);
/// <summary>
/// Mod this column by rhs and return a reference to this column.
/// </summary>
column_t &operator%=(const column_t &rhs) { return *this = (*this % rhs); }
column_t &operator%=(const column_t &rhs);
/// <summary>
/// Return true if other is to the right of this column.
/// </summary>
friend bool operator>(const column_t::index_t &left, const column_t &right) { return column_t(left) > right; }
friend bool operator>(const column_t::index_t &left, const column_t &right);
/// <summary>
/// Return true if other is to the right of or equal to this column.
/// </summary>
friend bool operator>=(const column_t::index_t &left, const column_t &right) { return column_t(left) >= right; }
friend bool operator>=(const column_t::index_t &left, const column_t &right);
/// <summary>
/// Return true if other is to the left of this column.
/// </summary>
friend bool operator<(const column_t::index_t &left, const column_t &right) { return column_t(left) < right; }
friend bool operator<(const column_t::index_t &left, const column_t &right);
/// <summary>
/// Return true if other is to the left of or equal to this column.
/// </summary>
friend bool operator<=(const column_t::index_t &left, const column_t &right) { return column_t(left) <= right; }
friend bool operator<=(const column_t::index_t &left, const column_t &right);
/// <summary>
/// Swap the columns that left and right refer to.
/// </summary>
friend void swap(column_t &left, column_t &right)
{
using std::swap;
swap(left.index, right.index);
}
friend void swap(column_t &left, column_t &right);
/// <summary>
/// Internal numeric value of this column index.

View File

@ -0,0 +1,33 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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>
namespace xlnt {
class XLNT_CLASS axis {
};
} // namespace xlnt

View File

@ -0,0 +1,33 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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>
namespace xlnt {
class XLNT_CLASS bar_chart {
};
} // namespace xlnt

View File

@ -0,0 +1,33 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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>
namespace xlnt {
class XLNT_CLASS chart {
};
} // namespace xlnt

View File

@ -0,0 +1,33 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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>
namespace xlnt {
class XLNT_CLASS error_bar {
};
} // namespace xlnt

View File

@ -0,0 +1,33 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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>
namespace xlnt {
class XLNT_CLASS graph_chart {
};
} // namespace xlnt

View File

@ -0,0 +1,33 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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>
namespace xlnt {
class XLNT_CLASS legend {
};
} // namespace xlnt

View File

@ -0,0 +1,33 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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>
namespace xlnt {
class XLNT_CLASS line_chart {
};
} // namespace xlnt

View File

@ -0,0 +1,33 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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>
namespace xlnt {
class XLNT_CLASS pie_chart {
};
} // namespace xlnt

View File

@ -0,0 +1,33 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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>
namespace xlnt {
class XLNT_CLASS scatter_chart {
};
} // namespace xlnt

View File

@ -0,0 +1,33 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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>
namespace xlnt {
class XLNT_CLASS series {
};
} // namespace xlnt

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -23,7 +23,7 @@
// @author: see AUTHORS file
#pragma once
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {

View File

@ -0,0 +1,61 @@
From ewbachtal@ewbi.com Fri Apr 3 11:00:25 2015
Date: Fri, 3 Apr 2015 07:58:55 -0700
From: Eric W. Bachtal <ewbachtal@ewbi.com>
To: 'Paul Harrington' <phrrngtn@panix.com>
Subject: RE: [pycel] re-license the parser/tokenizer under a license suitable for incorporation into openpyxl (#11) (fwd)
Hi Paul,
I can't speak for Dirk's wishes regarding his Python implementation, but I'm
fine with my original JavaScript or C# Excel formula parser code being
released with a BSD/MIT license, as long as proper attribution is provided
and there's a clear indication that the software is provided "as is",
without warranty of any kind.
Good luck!
ewb
425 241 2505
-----Original Message-----
From: Paul Harrington [mailto:phrrngtn@panix.com]
Sent: Friday, April 3, 2015 7:19 AM
To: info@ewbi.com
Subject: Re: [pycel] re-license the parser/tokenizer under a license
suitable for incorporation into openpyxl (#11) (fwd)
Hi, I was wondering if you would be OK with the parser (specifically the
Python implementation) being released with an BSD/MIT license?
thanks for the implementation!
pjjH
---------- Forwarded message ----------
Date: Fri, 03 Apr 2015 06:26:39 -0700
From: Dirk Gorissen <notifications@github.com>
Reply-To: dgorissen/pycel
<reply+000100759cdf9fe5298cea83dabb029e82bc98754c9d7df892cf000000011136570f9
2a169ce03ee327f@reply.github.com>
To: dgorissen/pycel <pycel@noreply.github.com>
Cc: Paul Harrington <phrrngtn@panix.com>
Subject: Re: [pycel] re-license the parser/tokenizer under a license
suitable
for incorporation into openpyxl (#11)
I did not write the tokenizing/parser code and don't hold the copyright to
it.
Eric did and I just applied a small patch and integrated it. See the header
of tokenizer.py.
---
Reply to this email directly or view it on GitHub:
https://github.com/dgorissen/pycel/issues/11#issuecomment-89287122

View File

@ -0,0 +1,33 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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>
namespace xlnt {
class XLNT_CLASS known_formulae {
};
} // namespace xlnt

View File

@ -1,11 +1,33 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {
class XLNT_CLASS tokenizer
{
class XLNT_CLASS tokenizer {
};
} // namespace xlnt

View File

@ -1,9 +1,32 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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 <string>
#include <vector>
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {

View File

@ -0,0 +1,48 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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 <string>
#include <xlnt/xlnt_config.hpp>
namespace xlnt {
class XLNT_CLASS default_type
{
public:
default_type();
default_type(const std::string &extension, const std::string &content_type);
default_type(const default_type &other);
default_type &operator=(const default_type &other);
std::string get_extension() const;
std::string get_content_type() const;
private:
std::string extension_;
std::string content_type_;
};
} // namespace xlnt

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -25,10 +25,9 @@
#include <string>
#include <xlnt/xlnt_config.hpp>
#include <xlnt/utils/datetime.hpp>
#include "xlnt_config.hpp"
namespace xlnt {
/// <summary>

View File

@ -1,76 +1,49 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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 <string>
#include <vector>
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
#include <xlnt/packaging/default_type.hpp>
#include <xlnt/packaging/override_type.hpp>
namespace xlnt {
class XLNT_CLASS default_type
{
public:
default_type();
default_type(const std::string &extension, const std::string &content_type);
default_type(const default_type &other);
default_type &operator=(const default_type &other);
std::string get_extension() const
{
return extension_;
}
std::string get_content_type() const
{
return content_type_;
}
private:
std::string extension_;
std::string content_type_;
};
class XLNT_CLASS override_type
{
public:
override_type();
override_type(const std::string &extension, const std::string &content_type);
override_type(const override_type &other);
override_type &operator=(const override_type &other);
std::string get_part_name() const
{
return part_name_;
}
std::string get_content_type() const
{
return content_type_;
}
private:
std::string part_name_;
std::string content_type_;
};
class XLNT_CLASS manifest
{
public:
void add_default_type(const std::string &extension, const std::string &content_type);
void add_override_type(const std::string &part_name, const std::string &content_type);
const std::vector<default_type> &get_default_types() const
{
return default_types_;
}
const std::vector<override_type> &get_override_types() const
{
return override_types_;
}
bool has_default_type(const std::string &extension) const;
bool has_override_type(const std::string &part_name) const;
std::string get_default_type(const std::string &extension) const;
const std::vector<default_type> &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<override_type> &get_override_types() const;
void add_override_type(const std::string &part_name, const std::string &content_type);
private:
std::vector<default_type> default_types_;

View File

@ -0,0 +1,48 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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 <string>
#include <xlnt/xlnt_config.hpp>
namespace xlnt {
class XLNT_CLASS override_type
{
public:
override_type();
override_type(const std::string &extension, const std::string &content_type);
override_type(const override_type &other);
override_type &operator=(const override_type &other);
std::string get_part_name() const;
std::string get_content_type() const;
private:
std::string part_name_;
std::string content_type_;
};
} // namespace xlnt

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -32,7 +32,7 @@ namespace xlnt {
/// <summary>
/// Specifies whether the target of a relationship is inside or outside the Package.
/// </summary>
enum class target_mode
enum class XLNT_CLASS target_mode
{
/// <summary>
/// The relationship references a part that is inside the package.

View File

@ -1,3 +1,25 @@
// Copyright (c) 2014-2015 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 <cstdint>
@ -7,7 +29,7 @@
#include <string>
#include <vector>
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
// Note: this comes from https://github.com/tfussell/miniz-cpp

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -25,11 +25,10 @@
#include <vector>
#include <xlnt/xlnt_config.hpp>
#include <xlnt/cell/comment.hpp>
#include <xlnt/worksheet/worksheet.hpp>
#include "xlnt_config.hpp"
namespace xlnt {
class xml_document;

View File

@ -1,6 +1,28 @@
// Copyright (c) 2014-2015 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_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -28,10 +28,9 @@
#include <string>
#include <vector>
#include <xlnt/xlnt_config.hpp>
#include <xlnt/packaging/zip_file.hpp>
#include "xlnt_config.hpp"
namespace xlnt {
class workbook;

View File

@ -1,8 +1,31 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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 <string>
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {

View File

@ -1,9 +1,32 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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 <string>
#include <vector>
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -26,7 +26,7 @@
#include <string>
#include <vector>
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -27,10 +27,9 @@
#include <unordered_map>
#include <vector>
#include <xlnt/xlnt_config.hpp>
#include <xlnt/workbook/workbook.hpp>
#include "xlnt_config.hpp"
namespace xlnt {
class alignment;

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -25,7 +25,7 @@
#include <string>
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -26,7 +26,7 @@
#include <string>
#include <vector>
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -26,10 +26,9 @@
#include <string>
#include <vector>
#include <xlnt/xlnt_config.hpp>
#include <xlnt/worksheet/worksheet.hpp>
#include "xlnt_config.hpp"
namespace xlnt {
class relationship;

View File

@ -1,10 +1,32 @@
// Copyright (c) 2014-2015 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 <memory>
#include <string>
#include <vector>
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {
namespace detail { struct xml_document_impl; }

View File

@ -1,10 +1,32 @@
// Copyright (c) 2014-2015 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 <memory>
#include <string>
#include <vector>
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {
namespace detail { struct xml_node_impl; }

View File

@ -1,8 +1,30 @@
// Copyright (c) 2014-2015 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 <string>
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -23,10 +23,9 @@
// @author: see AUTHORS file
#pragma once
#include <xlnt/xlnt_config.hpp>
#include <xlnt/utils/hash_combine.hpp>
#include "xlnt_config.hpp"
namespace xlnt {
/// <summary>

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -26,10 +26,9 @@
#include <cstddef>
#include <functional>
#include <xlnt/utils/hash_combine.hpp>
#include <xlnt/xlnt_config.hpp>
#include <xlnt/styles/side.hpp>
#include "xlnt_config.hpp"
#include <xlnt/utils/hash_combine.hpp>
namespace xlnt {

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -25,10 +25,9 @@
#include <string>
#include <xlnt/xlnt_config.hpp>
#include <xlnt/utils/hash_combine.hpp>
#include "xlnt_config.hpp"
namespace xlnt {
class XLNT_CLASS color

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -23,11 +23,10 @@
// @author: see AUTHORS file
#pragma once
#include <xlnt/xlnt_config.hpp>
#include <xlnt/styles/color.hpp>
#include <xlnt/utils/hash_combine.hpp>
#include "xlnt_config.hpp"
namespace xlnt {
class XLNT_CLASS fill

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -25,10 +25,9 @@
#include <string>
#include <xlnt/utils/hash_combine.hpp>
#include <xlnt/xlnt_config.hpp>
#include <xlnt/styles/color.hpp>
#include "xlnt_config.hpp"
#include <xlnt/utils/hash_combine.hpp>
namespace xlnt {

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -23,10 +23,9 @@
// @author: see AUTHORS file
#pragma once
#include <xlnt/xlnt_config.hpp>
#include <xlnt/styles/style.hpp>
#include "xlnt_config.hpp"
namespace xlnt {
class XLNT_CLASS named_style

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -27,7 +27,7 @@
#include <unordered_map>
#include <utility>
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -25,10 +25,9 @@
#include <cstddef>
#include <xlnt/xlnt_config.hpp>
#include <xlnt/utils/hash_combine.hpp>
#include "xlnt_config.hpp"
namespace xlnt {
class XLNT_CLASS protection

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -25,10 +25,9 @@
#include <cstddef>
#include <xlnt/xlnt_config.hpp>
#include <xlnt/styles/color.hpp>
#include "xlnt_config.hpp"
namespace xlnt {
enum class XLNT_CLASS border_style

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -23,6 +23,7 @@
// @author: see AUTHORS file
#pragma once
#include <xlnt/xlnt_config.hpp>
#include <xlnt/styles/alignment.hpp>
#include <xlnt/styles/border.hpp>
#include <xlnt/styles/fill.hpp>
@ -30,8 +31,6 @@
#include <xlnt/styles/number_format.hpp>
#include <xlnt/styles/protection.hpp>
#include "xlnt_config.hpp"
namespace xlnt {
class workbook;

View File

@ -0,0 +1,41 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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 <stdexcept>
#include <xlnt/cell/types.hpp>
namespace xlnt {
/// <summary>
/// Error when an attribute value is invalid.
/// </summary>
class XLNT_CLASS attribute_error : public std::runtime_error
{
public:
attribute_error();
};
} // namespace xlnt

View File

@ -0,0 +1,39 @@
// Copyright (c) 2014-2015 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>
namespace xlnt {
/// <summary>
/// An enumeration of possible base dates.
/// Dates in Excel are stored as days since this base date.
/// </summary>
enum class XLNT_CLASS calendar
{
windows_1900,
mac_1904
};
} // namespace xlnt

View File

@ -0,0 +1,44 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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 <stdexcept>
#include <string>
#include <xlnt/xlnt_config.hpp>
#include <xlnt/cell/types.hpp>
namespace xlnt {
/// <summary>
/// Error for converting between numeric and A1-style cell references.
/// </summary>
class XLNT_CLASS cell_coordinates_exception : public std::runtime_error
{
public:
cell_coordinates_exception(column_t column, row_t row);
cell_coordinates_exception(const std::string &coord_string);
};
} // namespace xlnt

View File

@ -0,0 +1,41 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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 <stdexcept>
#include <xlnt/xlnt_config.hpp>
namespace xlnt {
/// <summary>
/// Error for bad column names in A1-style cell references.
/// </summary>
class XLNT_CLASS column_string_index_exception : public std::runtime_error
{
public:
column_string_index_exception();
};
} // namespace xlnt

View File

@ -0,0 +1,41 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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 <stdexcept>
#include <xlnt/xlnt_config.hpp>
namespace xlnt {
/// <summary>
/// Error for any data type inconsistencies.
/// </summary>
class XLNT_CLASS data_type_exception : public std::runtime_error
{
public:
data_type_exception();
};
} // namespace xlnt

View File

@ -0,0 +1,69 @@
// Copyright (c) 2014-2015 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 <string>
#include <xlnt/xlnt_config.hpp>
#include <xlnt/utils/calendar.hpp>
namespace xlnt {
/// <summary>
/// A date is a specific day specified in terms of a year, month, and day.
/// It can also be initialized as a number of days since a base date
/// using date::from_number.
/// </summary>
struct XLNT_CLASS date
{
/// <summary>
/// Return the current date according to the system time.
/// </summary>
static date today();
/// <summary>
/// Return a date by adding days_since_base_year to base_date.
/// This includes leap years.
/// </summary>
static date from_number(int days_since_base_year, calendar base_date);
date(int year_, int month_, int day_) : year(year_), month(month_), day(day_)
{
}
/// <summary>
/// Return the number of days between this date and base_date.
/// </summary>
int to_number(calendar base_date) const;
/// <summary>
/// Return true if this date is equal to comparand.
/// </summary>
bool operator==(const date &comparand) const;
int year;
int month;
int day;
};
} // namespace xlnt

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 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
@ -24,91 +24,11 @@
#include <string>
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
#include <xlnt/utils/calendar.hpp>
namespace xlnt {
/// <summary>
/// An enumeration of possible base dates.
/// Dates in Excel are stored as days since this base date.
/// </summary>
enum class XLNT_CLASS calendar
{
windows_1900,
mac_1904
};
/// <summary>
/// A date is a specific day specified in terms of a year, month, and day.
/// It can also be initialized as a number of days since a base date
/// using date::from_number.
/// </summary>
struct XLNT_CLASS date
{
/// <summary>
/// Return the current date according to the system time.
/// </summary>
static date today();
/// <summary>
/// Return a date by adding days_since_base_year to base_date.
/// This includes leap years.
/// </summary>
static date from_number(int days_since_base_year, calendar base_date);
date(int year_, int month_, int day_) : year(year_), month(month_), day(day_)
{
}
/// <summary>
/// Return the number of days between this date and base_date.
/// </summary>
int to_number(calendar base_date) const;
/// <summary>
/// Return true if this date is equal to comparand.
/// </summary>
bool operator==(const date &comparand) const;
int year;
int month;
int day;
};
/// <summary>
/// A time is a specific time of the day specified in terms of an hour,
/// minute, second, and microsecond (0-999999).
/// It can also be initialized as a fraction of a day using time::from_number.
/// </summary>
struct XLNT_CLASS time
{
/// <summary>
/// Return the current time according to the system time.
/// </summary>
static time now();
/// <summary>
/// Return a time from a number representing a fraction of a day.
/// The integer part of number will be ignored.
/// 0.5 would return time(12, 0, 0, 0) or noon, halfway through the day.
/// </summary>
static time from_number(long double number);
explicit time(int hour_ = 0, int minute_ = 0, int second_ = 0, int microsecond_ = 0)
: hour(hour_), minute(minute_), second(second_), microsecond(microsecond_)
{
}
explicit time(const std::string &time_string);
long double to_number() const;
bool operator==(const time &comparand) const;
int hour;
int minute;
int second;
int microsecond;
};
struct XLNT_CLASS datetime
{
/// <summary>
@ -156,26 +76,4 @@ struct XLNT_CLASS datetime
int microsecond;
};
/// <summary>
/// Represents a span of time between two datetimes. This is
/// not fully supported yet.
/// </summary>
struct XLNT_CLASS timedelta
{
static timedelta from_number(long double number);
timedelta(int days_, int hours_, int minutes_ = 0, int seconds_ = 0, int microseconds_ = 0)
: days(days_), hours(hours_), minutes(minutes_), seconds(seconds_), microseconds(microseconds_)
{
}
double to_number() const;
int days;
int hours;
int minutes;
int seconds;
int microseconds;
};
} // namespace xlnt

View File

@ -1,4 +1,5 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -22,113 +23,14 @@
// @author: see AUTHORS file
#pragma once
#include <stdexcept>
#include <string>
#include <xlnt/cell/types.hpp>
#include "xlnt_config.hpp"
namespace xlnt {
/// <summary>
/// Error for converting between numeric and A1-style cell references.
/// </summary>
class XLNT_CLASS cell_coordinates_exception : public std::runtime_error
{
public:
cell_coordinates_exception(column_t column, row_t row);
cell_coordinates_exception(const std::string &coord_string);
};
/// <summary>
/// The data submitted which cannot be used directly in Excel files. It
/// must be removed or escaped.
/// </summary>
class XLNT_CLASS illegal_character_error : public std::runtime_error
{
public:
illegal_character_error(char c);
};
/// <summary>
/// Error for bad column names in A1-style cell references.
/// </summary>
class XLNT_CLASS column_string_index_exception : public std::runtime_error
{
public:
column_string_index_exception();
};
/// <summary>
/// Error for any data type inconsistencies.
/// </summary>
class XLNT_CLASS data_type_exception : public std::runtime_error
{
public:
data_type_exception();
};
/// <summary>
/// Error for badly formatted named ranges.
/// </summary>
class XLNT_CLASS named_range_exception : public std::runtime_error
{
public:
named_range_exception();
};
/// <summary>
/// Error for bad sheet names.
/// </summary>
class XLNT_CLASS sheet_title_exception : public std::runtime_error
{
public:
sheet_title_exception(const std::string &title);
};
/// <summary>
/// Error for trying to open a non-ooxml file.
/// </summary>
class XLNT_CLASS invalid_file_exception : public std::runtime_error
{
public:
invalid_file_exception(const std::string &filename);
};
/// <summary>
/// Error for trying to modify a read-only workbook.
/// </summary>
class XLNT_CLASS read_only_workbook_exception : public std::runtime_error
{
public:
read_only_workbook_exception();
};
/// <summary>
/// Error when a references number format is not in the stylesheet.
/// </summary>
class XLNT_CLASS missing_number_format : public std::runtime_error
{
public:
missing_number_format();
};
/// <summary>
/// Error when an attribute value is invalid.
/// </summary>
class XLNT_CLASS attribute_error : public std::runtime_error
{
public:
attribute_error();
};
class XLNT_CLASS value_error : public std::runtime_error
{
public:
value_error() : std::runtime_error("")
{
}
};
} // namespace xlnt
#include <xlnt/utils/attribute_error.hpp>
#include <xlnt/utils/cell_coordinates_exception.hpp>
#include <xlnt/utils/column_string_index_exception.hpp>
#include <xlnt/utils/data_type_exception.hpp>
#include <xlnt/utils/illegal_character_error.hpp>
#include <xlnt/utils/invalid_file_exception.hpp>
#include <xlnt/utils/missing_number_format.hpp>
#include <xlnt/utils/named_range_exception.hpp>
#include <xlnt/utils/read_only_workbook_exception.hpp>
#include <xlnt/utils/sheet_title_exception.hpp>
#include <xlnt/utils/value_error.hpp>

View File

@ -1,8 +1,36 @@
// Copyright 2005-2014 Daniel James.
// Boost Software License - Version 1.0 - August 17th, 2003
//
// Permission is hereby granted, free of charge, to any person or organization
// obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the
// Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following:
//
// The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer,
// must be included in all copies of the Software, in whole or in part, and
// all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by
// a source language processor.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Based on Peter Dimov's proposal
// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf
// issue 6.18.
#pragma once
#include <functional>
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {

View File

@ -0,0 +1,42 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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 <stdexcept>
#include <xlnt/xlnt_config.hpp>
namespace xlnt {
/// <summary>
/// The data submitted which cannot be used directly in Excel files. It
/// must be removed or escaped.
/// </summary>
class XLNT_CLASS illegal_character_error : public std::runtime_error
{
public:
illegal_character_error(char c);
};
} // namespace xlnt

View File

@ -0,0 +1,42 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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 <stdexcept>
#include <string>
#include <xlnt/xlnt_config.hpp>
namespace xlnt {
/// <summary>
/// Error for trying to open a non-ooxml file.
/// </summary>
class XLNT_CLASS invalid_file_exception : public std::runtime_error
{
public:
invalid_file_exception(const std::string &filename);
};
} // namespace xlnt

View File

@ -0,0 +1,41 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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 <stdexcept>
#include <xlnt/xlnt_config.hpp>
namespace xlnt {
/// <summary>
/// Error when a references number format is not in the stylesheet.
/// </summary>
class XLNT_CLASS missing_number_format : public std::runtime_error
{
public:
missing_number_format();
};
} // namespace xlnt

View File

@ -0,0 +1,41 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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 <stdexcept>
#include <xlnt/xlnt_config.hpp>
namespace xlnt {
/// <summary>
/// Error for badly formatted named ranges.
/// </summary>
class XLNT_CLASS named_range_exception : public std::runtime_error
{
public:
named_range_exception();
};
} // namespace xlnt

View File

@ -0,0 +1,41 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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 <stdexcept>
#include <xlnt/xlnt_config.hpp>
namespace xlnt {
/// <summary>
/// Error for trying to modify a read-only workbook.
/// </summary>
class XLNT_CLASS read_only_workbook_exception : public std::runtime_error
{
public:
read_only_workbook_exception();
};
} // namespace xlnt

View File

@ -0,0 +1,42 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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 <stdexcept>
#include <string>
#include <xlnt/xlnt_config.hpp>
namespace xlnt {
/// <summary>
/// Error for bad sheet names.
/// </summary>
class XLNT_CLASS sheet_title_exception : public std::runtime_error
{
public:
sheet_title_exception(const std::string &title);
};
} // namespace xlnt

View File

@ -0,0 +1,65 @@
// Copyright (c) 2014-2015 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 <string>
#include <xlnt/xlnt_config.hpp>
namespace xlnt {
/// <summary>
/// A time is a specific time of the day specified in terms of an hour,
/// minute, second, and microsecond (0-999999).
/// It can also be initialized as a fraction of a day using time::from_number.
/// </summary>
struct XLNT_CLASS time
{
/// <summary>
/// Return the current time according to the system time.
/// </summary>
static time now();
/// <summary>
/// Return a time from a number representing a fraction of a day.
/// The integer part of number will be ignored.
/// 0.5 would return time(12, 0, 0, 0) or noon, halfway through the day.
/// </summary>
static time from_number(long double number);
explicit time(int hour_ = 0, int minute_ = 0, int second_ = 0, int microsecond_ = 0)
: hour(hour_), minute(minute_), second(second_), microsecond(microsecond_)
{
}
explicit time(const std::string &time_string);
long double to_number() const;
bool operator==(const time &comparand) const;
int hour;
int minute;
int second;
int microsecond;
};
} // namespace xlnt

View File

@ -0,0 +1,53 @@
// Copyright (c) 2014-2015 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 <string>
#include <xlnt/xlnt_config.hpp>
namespace xlnt {
/// <summary>
/// Represents a span of time between two datetimes. This is
/// not fully supported yet.
/// </summary>
struct XLNT_CLASS timedelta
{
static timedelta from_number(long double number);
timedelta(int days_, int hours_, int minutes_ = 0, int seconds_ = 0, int microseconds_ = 0)
: days(days_), hours(hours_), minutes(minutes_), seconds(seconds_), microseconds(microseconds_)
{
}
double to_number() const;
int days;
int hours;
int minutes;
int seconds;
int microseconds;
};
} // namespace xlnt

View File

@ -0,0 +1,39 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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 <stdexcept>
#include <string>
#include <xlnt/xlnt_config.hpp>
namespace xlnt {
class XLNT_CLASS value_error : public std::runtime_error
{
public:
value_error();
};
} // namespace xlnt

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -25,7 +25,7 @@
#include <string>
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {
@ -40,6 +40,7 @@ class XLNT_CLASS document_security
bool lock_revision;
bool lock_structure;
bool lock_windows;
std::string revision_password;
std::string workbook_password;
};

View File

@ -1,6 +1,29 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {
@ -8,4 +31,4 @@ class XLNT_CLASS external_book
{
};
}
} // namespace xlnt

View File

@ -1,9 +1,32 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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 <string>
#include <vector>
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {
@ -36,4 +59,5 @@ class XLNT_CLASS named_range
std::string name_;
std::vector<target> targets_;
};
}
} // namespace xlnt

View File

@ -1,6 +1,28 @@
// Copyright (c) 2014-2015 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_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -29,10 +29,9 @@
#include <utility>
#include <vector>
#include <xlnt/xlnt_config.hpp>
#include <xlnt/packaging/relationship.hpp>
#include "xlnt_config.hpp"
namespace xlnt {
class alignment;

View File

@ -1,14 +1,35 @@
// Copyright (c) 2014-2015 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 <iterator>
#include <xlnt/xlnt_config.hpp>
#include <xlnt/cell/cell_reference.hpp>
#include <xlnt/worksheet/range_reference.hpp>
#include <xlnt/worksheet/major_order.hpp>
#include <xlnt/worksheet/range_reference.hpp>
#include <xlnt/worksheet/worksheet.hpp>
#include "xlnt_config.hpp"
namespace xlnt {
class cell;
@ -117,24 +138,15 @@ class XLNT_CLASS cell_vector
const cell get_cell(std::size_t column_index) const;
std::size_t length() const
{
return num_cells();
}
std::size_t length() const;
iterator begin();
iterator end();
const_iterator begin() const
{
return cbegin();
}
const_iterator end() const
{
return cend();
}
const_iterator begin() const;
const_iterator cbegin() const;
const_iterator end() const;
const_iterator cend() const;
private:

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -23,7 +23,7 @@
// @author: see AUTHORS file
#pragma once
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {

View File

@ -0,0 +1,50 @@
#pragma once
#include <cstdint>
#include <string>
#include <xlnt/xlnt_config.hpp>
namespace xlnt {
/// <summary>
/// Worksheet footer
/// </summary>
class XLNT_CLASS footer
{
public:
footer();
void set_text(const std::string &text)
{
default_ = false;
text_ = text;
}
void set_font_name(const std::string &font_name)
{
default_ = false;
font_name_ = font_name;
}
void set_font_size(std::size_t font_size)
{
default_ = false;
font_size_ = font_size;
}
void set_font_color(const std::string &font_color)
{
default_ = false;
font_color_ = font_color;
}
bool is_default() const
{
return default_;
}
private:
bool default_;
std::string text_;
std::string font_name_;
std::size_t font_size_;
std::string font_color_;
};
} // namespace xlnt

View File

@ -0,0 +1,50 @@
#pragma once
#include <cstdint>
#include <string>
#include <xlnt/xlnt_config.hpp>
namespace xlnt {
/// <summary>
/// Worksheet header
/// </summary>
class XLNT_CLASS header
{
public:
header();
void set_text(const std::string &text)
{
default_ = false;
text_ = text;
}
void set_font_name(const std::string &font_name)
{
default_ = false;
font_name_ = font_name;
}
void set_font_size(std::size_t font_size)
{
default_ = false;
font_size_ = font_size;
}
void set_font_color(const std::string &font_color)
{
default_ = false;
font_color_ = font_color;
}
bool is_default() const
{
return default_;
}
private:
bool default_;
std::string text_;
std::string font_name_;
std::size_t font_size_;
std::string font_color_;
};
} // namespace xlnt

View File

@ -0,0 +1,63 @@
#pragma once
#include <cstdint>
#include <string>
#include <xlnt/xlnt_config.hpp>
#include <xlnt/worksheet/footer.hpp>
#include <xlnt/worksheet/header.hpp>
namespace xlnt {
/// <summary>
/// Worksheet header and footer
/// </summary>
class XLNT_CLASS header_footer
{
public:
header_footer();
header &get_left_header()
{
return left_header_;
}
header &get_center_header()
{
return center_header_;
}
header &get_right_header()
{
return right_header_;
}
footer &get_left_footer()
{
return left_footer_;
}
footer &get_center_footer()
{
return center_footer_;
}
footer &get_right_footer()
{
return right_footer_;
}
bool is_default_header() const
{
return left_header_.is_default() && center_header_.is_default() && right_header_.is_default();
}
bool is_default_footer() const
{
return left_footer_.is_default() && center_footer_.is_default() && right_footer_.is_default();
}
bool is_default() const
{
return is_default_header() && is_default_footer();
}
private:
header left_header_, right_header_, center_header_;
footer left_footer_, right_footer_, center_footer_;
};
} // namespace xlnt

View File

@ -1,6 +1,28 @@
// Copyright (c) 2014-2015 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_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {

View File

@ -0,0 +1,36 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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>
namespace xlnt {
enum class XLNT_CLASS orientation
{
portrait,
landscape
};
} // namepsace xlnt

View File

@ -0,0 +1,37 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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>
namespace xlnt {
enum class XLNT_CLASS page_break
{
none = 0,
row = 1,
column = 2
};
} // namepsace xlnt

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -23,75 +23,34 @@
// @author: see AUTHORS file
#pragma once
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {
class XLNT_CLASS page_margins
{
public:
page_margins() : default_(true), top_(0), left_(0), bottom_(0), right_(0), header_(0), footer_(0)
{
}
page_margins();
bool is_default() const
{
return default_;
}
double get_top() const
{
return top_;
}
void set_top(double top)
{
default_ = false;
top_ = top;
}
double get_left() const
{
return left_;
}
void set_left(double left)
{
default_ = false;
left_ = left;
}
double get_bottom() const
{
return bottom_;
}
void set_bottom(double bottom)
{
default_ = false;
bottom_ = bottom;
}
double get_right() const
{
return right_;
}
void set_right(double right)
{
default_ = false;
right_ = right;
}
double get_header() const
{
return header_;
}
void set_header(double header)
{
default_ = false;
header_ = header;
}
double get_footer() const
{
return footer_;
}
void set_footer(double footer)
{
default_ = false;
footer_ = footer;
}
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:
bool default_;

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -23,155 +23,60 @@
// @author: see AUTHORS file
#pragma once
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
#include <xlnt/worksheet/orientation.hpp>
#include <xlnt/worksheet/page_break.hpp>
#include <xlnt/worksheet/paper_size.hpp>
#include <xlnt/worksheet/sheet_state.hpp>
namespace xlnt {
struct XLNT_CLASS page_setup
{
enum class page_break
{
none = 0,
row = 1,
column = 2
};
enum class sheet_state
{
visible,
hidden,
very_hidden
};
enum class paper_size
{
letter = 1,
letter_small = 2,
tabloid = 3,
ledger = 4,
legal = 5,
statement = 6,
executive = 7,
a3 = 8,
a4 = 9,
a4_small = 10,
a5 = 11
};
enum class orientation
{
portrait,
landscape
};
public:
page_setup()
: default_(true),
break_(page_break::none),
sheet_state_(sheet_state::visible),
paper_size_(paper_size::letter),
orientation_(orientation::portrait),
fit_to_page_(false),
fit_to_height_(false),
fit_to_width_(false),
horizontal_centered_(false),
vertical_centered_(false),
scale_(1)
{
}
bool is_default() const
{
return default_;
}
page_break get_break() const
{
return break_;
}
void set_break(page_break b)
{
default_ = false;
break_ = b;
}
sheet_state get_sheet_state() const
{
return sheet_state_;
}
void set_sheet_state(sheet_state sheet_state)
{
sheet_state_ = sheet_state;
}
paper_size get_paper_size() const
{
return paper_size_;
}
void set_paper_size(paper_size paper_size)
{
default_ = false;
paper_size_ = paper_size;
}
orientation get_orientation() const
{
return orientation_;
}
void set_orientation(orientation orientation)
{
default_ = false;
orientation_ = orientation;
}
bool fit_to_page() const
{
return fit_to_page_;
}
void set_fit_to_page(bool fit_to_page)
{
default_ = false;
fit_to_page_ = fit_to_page;
}
bool fit_to_height() const
{
return fit_to_height_;
}
void set_fit_to_height(bool fit_to_height)
{
default_ = false;
fit_to_height_ = fit_to_height;
}
bool fit_to_width() const
{
return fit_to_width_;
}
void set_fit_to_width(bool fit_to_width)
{
default_ = false;
fit_to_width_ = fit_to_width;
}
void set_horizontal_centered(bool horizontal_centered)
{
default_ = false;
horizontal_centered_ = horizontal_centered;
}
bool get_horizontal_centered() const
{
return horizontal_centered_;
}
void set_vertical_centered(bool vertical_centered)
{
default_ = false;
vertical_centered_ = vertical_centered;
}
bool get_vertical_centered() const
{
return vertical_centered_;
}
void set_scale(double scale)
{
default_ = false;
scale_ = scale;
}
double get_scale() const
{
return scale_;
}
page_setup();
bool is_default() const;
page_break get_break() const;
void set_break(page_break b);
sheet_state get_sheet_state() const;
void set_sheet_state(sheet_state sheet_state);
paper_size get_paper_size() const;
void set_paper_size(paper_size paper_size);
orientation get_orientation() const;
void set_orientation(orientation orientation);
bool fit_to_page() const;
void set_fit_to_page(bool fit_to_page);
bool fit_to_height() const;
void set_fit_to_height(bool fit_to_height);
bool fit_to_width() const;
void set_fit_to_width(bool fit_to_width);
void set_horizontal_centered(bool horizontal_centered);
bool get_horizontal_centered() const;
void set_vertical_centered(bool vertical_centered);
bool get_vertical_centered() const;
void set_scale(double scale);
double get_scale() const;
private:
bool default_;

View File

@ -1,4 +1,5 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -22,7 +23,7 @@
// @author: see AUTHORS file
#pragma once
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {

View File

@ -0,0 +1,45 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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>
namespace xlnt {
enum class XLNT_CLASS paper_size
{
letter = 1,
letter_small = 2,
tabloid = 3,
ledger = 4,
legal = 5,
statement = 6,
executive = 7,
a3 = 8,
a4 = 9,
a4_small = 10,
a5 = 11
};
} // namepsace xlnt

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 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
@ -27,13 +27,12 @@
#include <string>
#include <vector>
#include <xlnt/xlnt_config.hpp>
#include <xlnt/worksheet/cell_vector.hpp>
#include <xlnt/worksheet/major_order.hpp>
#include <xlnt/worksheet/range_reference.hpp>
#include <xlnt/worksheet/worksheet.hpp>
#include "xlnt_config.hpp"
namespace xlnt {
class XLNT_CLASS range

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 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
@ -22,10 +22,9 @@
// @author: see AUTHORS file
#pragma once
#include <xlnt/xlnt_config.hpp>
#include <xlnt/cell/cell_reference.hpp>
#include "xlnt_config.hpp"
namespace xlnt {
class XLNT_CLASS range_reference

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -23,7 +23,7 @@
// @author: see AUTHORS file
#pragma once
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 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
@ -22,7 +22,7 @@
// @author: see AUTHORS file
#pragma once
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {

View File

@ -1,8 +1,31 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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 <string>
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {

View File

@ -0,0 +1,37 @@
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// 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>
namespace xlnt {
enum class XLNT_CLASS sheet_state
{
visible,
hidden,
very_hidden
};
} // namepsace xlnt

View File

@ -1,4 +1,5 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -22,7 +23,7 @@
// @author: see AUTHORS file
#pragma once
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -29,12 +29,13 @@
#include <unordered_map>
#include <vector>
#include <xlnt/xlnt_config.hpp>
#include <xlnt/cell/types.hpp>
#include <xlnt/packaging/relationship.hpp>
#include <xlnt/worksheet/header_footer.hpp>
#include <xlnt/worksheet/page_margins.hpp>
#include <xlnt/worksheet/page_setup.hpp>
#include "xlnt_config.hpp"
namespace xlnt {
class cell;
@ -51,216 +52,6 @@ struct date;
namespace detail { struct worksheet_impl; }
/// <summary>
/// Worksheet header
/// </summary>
class XLNT_CLASS header
{
public:
header();
void set_text(const std::string &text)
{
default_ = false;
text_ = text;
}
void set_font_name(const std::string &font_name)
{
default_ = false;
font_name_ = font_name;
}
void set_font_size(std::size_t font_size)
{
default_ = false;
font_size_ = font_size;
}
void set_font_color(const std::string &font_color)
{
default_ = false;
font_color_ = font_color;
}
bool is_default() const
{
return default_;
}
private:
bool default_;
std::string text_;
std::string font_name_;
std::size_t font_size_;
std::string font_color_;
};
/// <summary>
/// Worksheet footer
/// </summary>
class XLNT_CLASS footer
{
public:
footer();
void set_text(const std::string &text)
{
default_ = false;
text_ = text;
}
void set_font_name(const std::string &font_name)
{
default_ = false;
font_name_ = font_name;
}
void set_font_size(std::size_t font_size)
{
default_ = false;
font_size_ = font_size;
}
void set_font_color(const std::string &font_color)
{
default_ = false;
font_color_ = font_color;
}
bool is_default() const
{
return default_;
}
private:
bool default_;
std::string text_;
std::string font_name_;
std::size_t font_size_;
std::string font_color_;
};
/// <summary>
/// Worksheet header and footer
/// </summary>
class XLNT_CLASS header_footer
{
public:
header_footer();
header &get_left_header()
{
return left_header_;
}
header &get_center_header()
{
return center_header_;
}
header &get_right_header()
{
return right_header_;
}
footer &get_left_footer()
{
return left_footer_;
}
footer &get_center_footer()
{
return center_footer_;
}
footer &get_right_footer()
{
return right_footer_;
}
bool is_default_header() const
{
return left_header_.is_default() && center_header_.is_default() && right_header_.is_default();
}
bool is_default_footer() const
{
return left_footer_.is_default() && center_footer_.is_default() && right_footer_.is_default();
}
bool is_default() const
{
return is_default_header() && is_default_footer();
}
private:
header left_header_, right_header_, center_header_;
footer left_footer_, right_footer_, center_footer_;
};
/// <summary>
/// Worksheet margins
/// </summary>
struct XLNT_CLASS margins
{
public:
margins() : default_(true), top_(0), left_(0), bottom_(0), right_(0), header_(0), footer_(0)
{
}
bool is_default() const
{
return default_;
}
double get_top() const
{
return top_;
}
void set_top(double top)
{
default_ = false;
top_ = top;
}
double get_left() const
{
return left_;
}
void set_left(double left)
{
default_ = false;
left_ = left;
}
double get_bottom() const
{
return bottom_;
}
void set_bottom(double bottom)
{
default_ = false;
bottom_ = bottom;
}
double get_right() const
{
return right_;
}
void set_right(double right)
{
default_ = false;
right_ = right;
}
double get_header() const
{
return header_;
}
void set_header(double header)
{
default_ = false;
header_ = header;
}
double get_footer() const
{
return footer_;
}
void set_footer(double footer)
{
default_ = false;
footer_ = footer;
}
private:
bool default_;
double top_;
double left_;
double bottom_;
double right_;
double header_;
double footer_;
};
/// <summary>
/// A worksheet is a 2D array of cells.
/// </summary>
@ -380,8 +171,8 @@ class XLNT_CLASS worksheet
// page
page_setup &get_page_setup();
const page_setup &get_page_setup() const;
margins &get_page_margins();
const margins &get_page_margins() const;
page_margins &get_page_margins();
const page_margins &get_page_margins() const;
// auto filter
range_reference get_auto_filter() const;
@ -405,7 +196,7 @@ class XLNT_CLASS worksheet
std::vector<std::string> get_formula_attributes() const;
void set_sheet_state(page_setup::sheet_state state);
void set_sheet_state(sheet_state state);
private:
friend class workbook;

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@ -23,7 +23,7 @@
// @author: see AUTHORS file
#pragma once
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
namespace xlnt {

View File

@ -1,5 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
// Copyright (c) 2014-2015 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
@ -23,10 +22,7 @@
// @author: see AUTHORS file
#pragma once
#include <string>
#include "xlnt_config.hpp"
#include <xlnt/xlnt_config.hpp>
#include <xlnt/cell/cell.hpp>
#include <xlnt/cell/cell_reference.hpp>
#include <xlnt/cell/comment.hpp>

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Thomas Fussell
// Copyright (c) 2014-2015 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

3
requirements.txt Normal file
View File

@ -0,0 +1,3 @@
miniz>=1.15_r4
pugixml>=1.6
cxxtest>=4.4

View File

@ -8,7 +8,10 @@
#include <xlnt/packaging/document_properties.hpp>
#include <xlnt/packaging/relationship.hpp>
#include <xlnt/styles/color.hpp>
#include <xlnt/utils/date.hpp>
#include <xlnt/utils/datetime.hpp>
#include <xlnt/utils/time.hpp>
#include <xlnt/utils/timedelta.hpp>
#include <xlnt/utils/exceptions.hpp>
#include <xlnt/workbook/workbook.hpp>
#include <xlnt/worksheet/column_properties.hpp>
@ -1478,4 +1481,9 @@ calendar cell::get_base_date() const
return get_parent().get_parent().get_properties().excel_base_date;
}
std::ostream &operator<<(std::ostream &stream, const xlnt::cell &cell)
{
return stream << cell.to_string();
}
} // namespace xlnt

Some files were not shown because too many files have changed in this diff Show More