xlnt/source/detail/workbook_impl.hpp

77 lines
2.2 KiB
C++
Raw Normal View History

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>
namespace xlnt {
2014-05-31 06:42:25 +08:00
namespace detail {
struct workbook_impl
{
workbook_impl();
2015-10-15 06:05:13 +08:00
workbook_impl(const workbook_impl &other)
: active_sheet_index_(other.active_sheet_index_),
worksheets_(other.worksheets_),
relationships_(other.relationships_),
drawings_(other.drawings_),
properties_(other.properties_),
guess_types_(other.guess_types_),
2015-10-19 03:30:46 +08:00
data_only_(other.data_only_),
2015-10-21 01:53:47 +08:00
styles_(other.styles_),
2015-10-19 03:30:46 +08:00
alignments_(other.alignments_),
2015-10-21 01:53:47 +08:00
borders_(other.borders_),
fills_(other.fills_),
fonts_(other.fonts_),
number_formats_(other.number_formats_),
protections_(other.protections_)
2015-10-15 06:05:13 +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_));
drawings_.clear();
std::copy(other.drawings_.begin(), other.drawings_.end(), back_inserter(drawings_));
properties_ = other.properties_;
2014-07-25 05:31:46 +08:00
guess_types_ = other.guess_types_;
data_only_ = other.data_only_;
2015-10-21 01:53:47 +08:00
styles_ = other.styles_;
2015-10-19 03:30:46 +08:00
alignments_ = other.alignments_;
borders_ = other.borders_;
fills_ = other.fills_;
fonts_ = other.fonts_;
number_formats_ = other.number_formats_;
protections_ = other.protections_;
2014-07-24 08:51:28 +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_;
std::vector<worksheet_impl> worksheets_;
std::vector<relationship> relationships_;
std::vector<drawing> drawings_;
2015-10-21 01:53:47 +08:00
2014-07-20 04:59:05 +08:00
document_properties properties_;
2015-10-21 01:53:47 +08:00
2014-07-25 05:31:46 +08:00
bool guess_types_;
bool data_only_;
2015-10-19 03:30:46 +08:00
2015-10-21 01:53:47 +08:00
std::vector<style> styles_;
std::vector<alignment> alignments_;
std::vector<border> borders_;
std::vector<fill> fills_;
std::vector<font> fonts_;
std::vector<number_format> number_formats_;
std::vector<protection> protections_;
};
2014-05-31 06:42:25 +08:00
} // namespace detail
} // namespace xlnt