2015-12-25 06:10:02 +08:00
|
|
|
// Copyright (c) 2014-2016 Thomas Fussell
|
2015-12-25 04:51:11 +08:00
|
|
|
//
|
|
|
|
// 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
|
2014-05-31 06:42:25 +08:00
|
|
|
#pragma once
|
|
|
|
|
2014-07-24 08:51:28 +08:00
|
|
|
#include <iterator>
|
2014-05-31 06:42:25 +08:00
|
|
|
#include <vector>
|
|
|
|
|
2016-05-16 03:03:02 +08:00
|
|
|
#include <detail/worksheet_impl.hpp>
|
|
|
|
#include <xlnt/packaging/app_properties.hpp>
|
|
|
|
#include <xlnt/packaging/document_properties.hpp>
|
|
|
|
#include <xlnt/packaging/manifest.hpp>
|
|
|
|
#include <xlnt/workbook/theme.hpp>
|
|
|
|
#include <xlnt/worksheet/range.hpp>
|
|
|
|
#include <xlnt/worksheet/range_reference.hpp>
|
|
|
|
#include <xlnt/worksheet/sheet_view.hpp>
|
|
|
|
|
2014-05-30 08:52:14 +08:00
|
|
|
namespace xlnt {
|
2014-05-31 06:42:25 +08:00
|
|
|
namespace detail {
|
2014-05-30 08:52:14 +08:00
|
|
|
|
2016-05-16 03:03:02 +08:00
|
|
|
struct worksheet_impl;
|
|
|
|
|
2014-05-30 08:52:14 +08:00
|
|
|
struct workbook_impl
|
|
|
|
{
|
2014-06-16 01:06:47 +08:00
|
|
|
workbook_impl();
|
2015-11-01 22:43:01 +08:00
|
|
|
|
|
|
|
workbook_impl(const workbook_impl &other)
|
2015-10-15 06:05:13 +08:00
|
|
|
: active_sheet_index_(other.active_sheet_index_),
|
2015-11-01 22:43:01 +08:00
|
|
|
worksheets_(other.worksheets_),
|
|
|
|
relationships_(other.relationships_),
|
|
|
|
root_relationships_(other.root_relationships_),
|
|
|
|
shared_strings_(other.shared_strings_),
|
|
|
|
properties_(other.properties_),
|
2016-03-09 11:32:32 +08:00
|
|
|
app_properties_(other.app_properties_),
|
2015-11-01 22:43:01 +08:00
|
|
|
guess_types_(other.guess_types_),
|
|
|
|
data_only_(other.data_only_),
|
2016-03-06 10:39:50 +08:00
|
|
|
read_only_(other.read_only_),
|
2016-05-15 01:57:07 +08:00
|
|
|
formats_(other.formats_),
|
|
|
|
styles_(other.styles_),
|
2015-11-01 22:43:01 +08:00
|
|
|
manifest_(other.manifest_)
|
2015-10-15 06:05:13 +08:00
|
|
|
{
|
|
|
|
}
|
2015-11-01 22:43:01 +08:00
|
|
|
|
2014-07-24 08:51:28 +08:00
|
|
|
workbook_impl &operator=(const workbook_impl &other)
|
|
|
|
{
|
|
|
|
active_sheet_index_ = other.active_sheet_index_;
|
|
|
|
worksheets_.clear();
|
|
|
|
std::copy(other.worksheets_.begin(), other.worksheets_.end(), back_inserter(worksheets_));
|
|
|
|
relationships_.clear();
|
|
|
|
std::copy(other.relationships_.begin(), other.relationships_.end(), std::back_inserter(relationships_));
|
2015-10-30 07:37:07 +08:00
|
|
|
root_relationships_.clear();
|
2015-11-01 22:43:01 +08:00
|
|
|
std::copy(other.root_relationships_.begin(), other.root_relationships_.end(),
|
|
|
|
std::back_inserter(root_relationships_));
|
2015-10-31 06:54:04 +08:00
|
|
|
shared_strings_.clear();
|
|
|
|
std::copy(other.shared_strings_.begin(), other.shared_strings_.end(), std::back_inserter(shared_strings_));
|
2014-07-24 08:51:28 +08:00
|
|
|
properties_ = other.properties_;
|
2016-03-09 11:32:32 +08:00
|
|
|
app_properties_ = other.app_properties_;
|
2014-07-25 05:31:46 +08:00
|
|
|
guess_types_ = other.guess_types_;
|
|
|
|
data_only_ = other.data_only_;
|
2016-03-06 10:39:50 +08:00
|
|
|
read_only_ = other.read_only_;
|
2015-10-30 01:46:56 +08:00
|
|
|
manifest_ = other.manifest_;
|
2015-11-01 22:43:01 +08:00
|
|
|
|
2015-10-15 06:05:13 +08:00
|
|
|
return *this;
|
2014-07-24 08:51:28 +08:00
|
|
|
}
|
2014-07-25 05:31:46 +08:00
|
|
|
|
2015-10-15 06:05:13 +08:00
|
|
|
std::size_t active_sheet_index_;
|
2014-05-30 08:52:14 +08:00
|
|
|
std::vector<worksheet_impl> worksheets_;
|
|
|
|
std::vector<relationship> relationships_;
|
2015-10-30 07:37:07 +08:00
|
|
|
std::vector<relationship> root_relationships_;
|
2016-05-15 03:19:08 +08:00
|
|
|
std::vector<text> shared_strings_;
|
2015-11-01 22:43:01 +08:00
|
|
|
|
2014-07-20 04:59:05 +08:00
|
|
|
document_properties properties_;
|
2016-03-09 11:32:32 +08:00
|
|
|
app_properties app_properties_;
|
2015-11-01 22:43:01 +08:00
|
|
|
|
2014-07-25 05:31:46 +08:00
|
|
|
bool guess_types_;
|
|
|
|
bool data_only_;
|
2016-03-06 10:39:50 +08:00
|
|
|
bool read_only_;
|
2015-11-01 22:43:01 +08:00
|
|
|
|
2016-05-15 01:57:07 +08:00
|
|
|
std::vector<format> formats_;
|
|
|
|
std::vector<style> styles_;
|
2015-10-24 02:42:36 +08:00
|
|
|
std::size_t next_custom_format_id_;
|
2016-05-01 04:19:45 +08:00
|
|
|
|
2015-10-30 01:46:56 +08:00
|
|
|
manifest manifest_;
|
2015-10-30 07:37:07 +08:00
|
|
|
theme theme_;
|
2015-11-23 01:41:27 +08:00
|
|
|
encoding encoding_;
|
2016-03-10 17:12:51 +08:00
|
|
|
std::vector<std::uint8_t> thumbnail_;
|
2014-05-30 08:52:14 +08:00
|
|
|
};
|
|
|
|
|
2014-05-31 06:42:25 +08:00
|
|
|
} // namespace detail
|
2014-05-30 08:52:14 +08:00
|
|
|
} // namespace xlnt
|