mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
restructure to match openpyxl 2.1
This commit is contained in:
parent
3c04a7b9d2
commit
89be485062
|
@ -28,7 +28,8 @@ project "xlnt.test"
|
|||
"xlnt",
|
||||
"zlib"
|
||||
}
|
||||
prebuildcommands { "cxxtestgen --runner=ErrorPrinter -o ../../tests/runner-autogen.cpp ../../tests/*.h" }
|
||||
prebuildcommands { "cxxtestgen --runner=ErrorPrinter -o ../../tests/runner-autogen.cpp ../../tests/*.hpp" }
|
||||
postbuildcommands { "../../bin/xlnt.test" }
|
||||
flags {
|
||||
"Unicode",
|
||||
"NoEditAndContinue",
|
||||
|
@ -65,11 +66,9 @@ project "xlnt"
|
|||
"../third-party/zlib/contrib/minizip"
|
||||
}
|
||||
files {
|
||||
"../source/*.cpp",
|
||||
"../source/*.h",
|
||||
"../source/detail/*.cpp",
|
||||
"../source/detail/*.h",
|
||||
"../include/xlnt/*.h"
|
||||
"../source/**.cpp",
|
||||
"../source/**.h",
|
||||
"../include/xlnt/**.h"
|
||||
}
|
||||
flags {
|
||||
"Unicode",
|
||||
|
|
|
@ -1,11 +1,34 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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 <memory>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "style.h"
|
||||
#include "types.h"
|
||||
#include "../styles/style.hpp"
|
||||
#include "../common/types.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
|
@ -1,10 +1,32 @@
|
|||
// Copyright (c) 2014 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>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "types.h"
|
||||
#include "../common/types.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
0
include/xlnt/charts/axis.hpp
Normal file
0
include/xlnt/charts/axis.hpp
Normal file
0
include/xlnt/charts/bar_chart.hpp
Normal file
0
include/xlnt/charts/bar_chart.hpp
Normal file
0
include/xlnt/charts/chart.hpp
Normal file
0
include/xlnt/charts/chart.hpp
Normal file
0
include/xlnt/charts/error_bar.hpp
Normal file
0
include/xlnt/charts/error_bar.hpp
Normal file
0
include/xlnt/charts/graph_chart.hpp
Normal file
0
include/xlnt/charts/graph_chart.hpp
Normal file
0
include/xlnt/charts/legend.hpp
Normal file
0
include/xlnt/charts/legend.hpp
Normal file
0
include/xlnt/charts/line_chart.hpp
Normal file
0
include/xlnt/charts/line_chart.hpp
Normal file
0
include/xlnt/charts/pie_chart.hpp
Normal file
0
include/xlnt/charts/pie_chart.hpp
Normal file
0
include/xlnt/charts/scatter_chart.hpp
Normal file
0
include/xlnt/charts/scatter_chart.hpp
Normal file
0
include/xlnt/charts/series.hpp
Normal file
0
include/xlnt/charts/series.hpp
Normal file
72
include/xlnt/common/datetime.hpp
Normal file
72
include/xlnt/common/datetime.hpp
Normal file
|
@ -0,0 +1,72 @@
|
|||
// Copyright (c) 2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
struct date
|
||||
{
|
||||
date(int year, int month, int day)
|
||||
: year(year), month(month), day(day)
|
||||
{
|
||||
}
|
||||
|
||||
int year;
|
||||
int month;
|
||||
int day;
|
||||
};
|
||||
|
||||
struct time
|
||||
{
|
||||
time(int hour = 0, int minute = 0, int second = 0, int microsecond = 0)
|
||||
: hour(hour), minute(minute), second(second), microsecond(microsecond)
|
||||
{
|
||||
}
|
||||
|
||||
explicit time(long double number);
|
||||
|
||||
int hour;
|
||||
int minute;
|
||||
int second;
|
||||
int microsecond;
|
||||
};
|
||||
|
||||
struct datetime
|
||||
{
|
||||
static datetime now();
|
||||
|
||||
datetime(int year, int month, int day, int hour = 0, int minute = 0, int second = 0, int microsecond = 0)
|
||||
: year(year), month(month), day(day), hour(hour), minute(minute), second(second), microsecond(microsecond)
|
||||
{
|
||||
}
|
||||
|
||||
int year;
|
||||
int month;
|
||||
int day;
|
||||
int hour;
|
||||
int minute;
|
||||
int second;
|
||||
int microsecond;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
123
include/xlnt/common/exceptions.hpp
Normal file
123
include/xlnt/common/exceptions.hpp
Normal file
|
@ -0,0 +1,123 @@
|
|||
// Copyright (c) 2014 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 <stdexcept>
|
||||
#include <string>
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
/// <summary>
|
||||
/// Error for converting between numeric and A1-style cell references.
|
||||
/// </summary>
|
||||
class cell_coordinates_exception : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
cell_coordinates_exception(int row, int column);
|
||||
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 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 column_string_index_exception : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
column_string_index_exception();
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Error for any data type inconsistencies.
|
||||
/// </summary>
|
||||
class data_type_exception : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
data_type_exception();
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Error for badly formatted named ranges.
|
||||
/// </summary>
|
||||
class named_range_exception : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
named_range_exception();
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Error for bad sheet names.
|
||||
/// </summary>
|
||||
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 invalid_file_exception : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
invalid_file_exception();
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Error for trying to modify a read-only workbook.
|
||||
/// </summary>
|
||||
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 missing_number_format : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
missing_number_format();
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Error when attempting to perform operations on a dump workbook
|
||||
/// while it has already been dumped once.
|
||||
/// </summary>
|
||||
class workbook_already_saved : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
workbook_already_saved();
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
|
@ -1,3 +1,26 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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>
|
52
include/xlnt/common/string_table.hpp
Normal file
52
include/xlnt/common/string_table.hpp
Normal file
|
@ -0,0 +1,52 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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>
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class string_table_builder;
|
||||
|
||||
class string_table
|
||||
{
|
||||
public:
|
||||
int operator[](const std::string &key) const;
|
||||
private:
|
||||
friend class string_table_builder;
|
||||
std::vector<std::string> strings_;
|
||||
};
|
||||
|
||||
class string_table_builder
|
||||
{
|
||||
public:
|
||||
void add(const std::string &string);
|
||||
string_table &get_table() { return table_; }
|
||||
const string_table &get_table() const { return table_; }
|
||||
private:
|
||||
string_table table_;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
28
include/xlnt/common/types.hpp
Normal file
28
include/xlnt/common/types.hpp
Normal file
|
@ -0,0 +1,28 @@
|
|||
// Copyright (c) 2014 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>
|
||||
|
||||
typedef uint32_t row_t;
|
||||
typedef uint32_t column_t;
|
|
@ -1,3 +1,25 @@
|
|||
// Copyright (c) 2014 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>
|
||||
|
@ -107,3 +129,4 @@ private:
|
|||
};
|
||||
|
||||
} // namespace xlnt
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
enum class limit_style
|
||||
{
|
||||
openpyxl,
|
||||
excel,
|
||||
maximum
|
||||
};
|
||||
|
||||
const limit_style LimitStyle = limit_style::openpyxl;
|
||||
|
||||
}
|
36
include/xlnt/config.hpp
Normal file
36
include/xlnt/config.hpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
// Copyright (c) 2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
enum class limit_style
|
||||
{
|
||||
openpyxl,
|
||||
excel,
|
||||
maximum
|
||||
};
|
||||
|
||||
const limit_style LimitStyle = limit_style::openpyxl;
|
||||
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class bad_sheet_title : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
bad_sheet_title(const std::string &title);
|
||||
};
|
||||
|
||||
class cell_coordinates_exception : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
cell_coordinates_exception(int row, int column);
|
||||
|
||||
cell_coordinates_exception(const std::string &coord_string);
|
||||
};
|
||||
|
||||
class workbook_already_saved : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
workbook_already_saved();
|
||||
};
|
||||
|
||||
class data_type_exception : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
data_type_exception();
|
||||
};
|
||||
|
||||
class column_string_index_exception : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
column_string_index_exception();
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
|
@ -1,50 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
struct date
|
||||
{
|
||||
date(int year, int month, int day)
|
||||
: year(year), month(month), day(day)
|
||||
{
|
||||
}
|
||||
|
||||
int year;
|
||||
int month;
|
||||
int day;
|
||||
};
|
||||
|
||||
struct time
|
||||
{
|
||||
time(int hour = 0, int minute = 0, int second = 0, int microsecond = 0)
|
||||
: hour(hour), minute(minute), second(second), microsecond(microsecond)
|
||||
{
|
||||
}
|
||||
|
||||
explicit time(long double number);
|
||||
|
||||
int hour;
|
||||
int minute;
|
||||
int second;
|
||||
int microsecond;
|
||||
};
|
||||
|
||||
struct datetime
|
||||
{
|
||||
static datetime now();
|
||||
|
||||
datetime(int year, int month, int day, int hour = 0, int minute = 0, int second = 0, int microsecond = 0)
|
||||
: year(year), month(month), day(day), hour(hour), minute(minute), second(second), microsecond(microsecond)
|
||||
{
|
||||
}
|
||||
|
||||
int year;
|
||||
int month;
|
||||
int day;
|
||||
int hour;
|
||||
int minute;
|
||||
int second;
|
||||
int microsecond;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
|
@ -1,19 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class worksheet;
|
||||
struct drawing_struct;
|
||||
|
||||
class drawing
|
||||
{
|
||||
public:
|
||||
drawing();
|
||||
|
||||
private:
|
||||
friend class worksheet;
|
||||
drawing(drawing_struct *root);
|
||||
drawing_struct *root_;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
42
include/xlnt/drawing/drawing.hpp
Normal file
42
include/xlnt/drawing/drawing.hpp
Normal file
|
@ -0,0 +1,42 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class worksheet;
|
||||
struct drawing_struct;
|
||||
|
||||
class drawing
|
||||
{
|
||||
public:
|
||||
drawing();
|
||||
|
||||
private:
|
||||
friend class worksheet;
|
||||
drawing(drawing_struct *root);
|
||||
drawing_struct *root_;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
|
@ -1,25 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class workbook;
|
||||
class worksheet;
|
||||
|
||||
class reader
|
||||
{
|
||||
public:
|
||||
static std::unordered_map<std::string, std::pair<std::string, std::string>> read_relationships(const std::string &content);
|
||||
static std::pair<std::unordered_map<std::string, std::string>, std::unordered_map<std::string, std::string>> read_content_types(const std::string &content);
|
||||
static std::string determine_document_type(const std::unordered_map<std::string, std::pair<std::string, std::string>> &root_relationships,
|
||||
const std::unordered_map<std::string, std::string> &override_types);
|
||||
static worksheet read_worksheet(std::istream &handle, workbook &wb, const std::string &title, const std::vector<std::string> &string_table);
|
||||
static void read_worksheet(worksheet ws, const std::string &xml_string, const std::vector<std::string> &string_table);
|
||||
static std::vector<std::string> read_shared_string(const std::string &xml_string);
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
65
include/xlnt/reader/chart_reader.hpp
Normal file
65
include/xlnt/reader/chart_reader.hpp
Normal file
|
@ -0,0 +1,65 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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 <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "charts/chart.h"
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class chart_reader
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
class pie_chart_reader : public chart_reader
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
class pie_chart_reader : public chart_reader
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
class pie_chart_reader : public chart_reader
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
class pie_chart_reader : public chart_reader
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
class chart_reader_factory
|
||||
{
|
||||
public:
|
||||
static std::unique_ptr<chart_reader> create_reader(chart c);
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
33
include/xlnt/reader/comment_reader.hpp
Normal file
33
include/xlnt/reader/comment_reader.hpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class comment_reader
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
33
include/xlnt/reader/drawing_reader.hpp
Normal file
33
include/xlnt/reader/drawing_reader.hpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class drawing_reader
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
33
include/xlnt/reader/excel_reader.hpp
Normal file
33
include/xlnt/reader/excel_reader.hpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class excel_reader
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
48
include/xlnt/reader/reader.hpp
Normal file
48
include/xlnt/reader/reader.hpp
Normal file
|
@ -0,0 +1,48 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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 <iostream>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class workbook;
|
||||
class worksheet;
|
||||
|
||||
class reader
|
||||
{
|
||||
public:
|
||||
static std::unordered_map<std::string, std::pair<std::string, std::string>> read_relationships(const std::string &content);
|
||||
static std::pair<std::unordered_map<std::string, std::string>, std::unordered_map<std::string, std::string>> read_content_types(const std::string &content);
|
||||
static std::string determine_document_type(const std::unordered_map<std::string, std::pair<std::string, std::string>> &root_relationships,
|
||||
const std::unordered_map<std::string, std::string> &override_types);
|
||||
static worksheet read_worksheet(std::istream &handle, workbook &wb, const std::string &title, const std::vector<std::string> &string_table);
|
||||
static void read_worksheet(worksheet ws, const std::string &xml_string, const std::vector<std::string> &string_table);
|
||||
static std::vector<std::string> read_shared_string(const std::string &xml_string);
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
33
include/xlnt/reader/string_reader.hpp
Normal file
33
include/xlnt/reader/string_reader.hpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class string_reader
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
42
include/xlnt/reader/style_reader.hpp
Normal file
42
include/xlnt/reader/style_reader.hpp
Normal file
|
@ -0,0 +1,42 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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 <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "style.h"
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class workbook;
|
||||
|
||||
class style_reader
|
||||
{
|
||||
public:
|
||||
style_reader(workbook &wb);
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
33
include/xlnt/reader/theme_reader.hpp
Normal file
33
include/xlnt/reader/theme_reader.hpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class theme_reader
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
33
include/xlnt/reader/workbook_reader.hpp
Normal file
33
include/xlnt/reader/workbook_reader.hpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class workbook_reader
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
33
include/xlnt/reader/worksheet_reader.hpp
Normal file
33
include/xlnt/reader/worksheet_reader.hpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class worksheet_reader
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
|
@ -1,29 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class string_table_builder;
|
||||
|
||||
class string_table
|
||||
{
|
||||
public:
|
||||
int operator[](const std::string &key) const;
|
||||
private:
|
||||
friend class string_table_builder;
|
||||
std::vector<std::string> strings_;
|
||||
};
|
||||
|
||||
class string_table_builder
|
||||
{
|
||||
public:
|
||||
void add(const std::string &string);
|
||||
string_table &get_table() { return table_; }
|
||||
const string_table &get_table() const { return table_; }
|
||||
private:
|
||||
string_table table_;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
|
@ -1,270 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
/// <summary>
|
||||
/// Alignment options for use in styles.
|
||||
/// </summary>
|
||||
struct alignment
|
||||
{
|
||||
enum class horizontal_alignment
|
||||
{
|
||||
general,
|
||||
left,
|
||||
right,
|
||||
center,
|
||||
center_continuous,
|
||||
justify
|
||||
};
|
||||
|
||||
enum class vertical_alignment
|
||||
{
|
||||
bottom,
|
||||
top,
|
||||
center,
|
||||
justify
|
||||
};
|
||||
|
||||
horizontal_alignment horizontal = horizontal_alignment::general;
|
||||
vertical_alignment vertical = vertical_alignment::bottom;
|
||||
int text_rotation = 0;
|
||||
bool wrap_text = false;
|
||||
bool shrink_to_fit = false;
|
||||
int indent = 0;
|
||||
};
|
||||
|
||||
class number_format
|
||||
{
|
||||
public:
|
||||
enum class format
|
||||
{
|
||||
general,
|
||||
text,
|
||||
number,
|
||||
number00,
|
||||
number_comma_separated1,
|
||||
number_comma_separated2,
|
||||
percentage,
|
||||
percentage00,
|
||||
date_yyyymmdd2,
|
||||
date_yyyymmdd,
|
||||
date_ddmmyyyy,
|
||||
date_dmyslash,
|
||||
date_dmyminus,
|
||||
date_dmminus,
|
||||
date_myminus,
|
||||
date_xlsx14,
|
||||
date_xlsx15,
|
||||
date_xlsx16,
|
||||
date_xlsx17,
|
||||
date_xlsx22,
|
||||
date_datetime,
|
||||
date_time1,
|
||||
date_time2,
|
||||
date_time3,
|
||||
date_time4,
|
||||
date_time5,
|
||||
date_time6,
|
||||
date_time7,
|
||||
date_time8,
|
||||
date_timedelta,
|
||||
date_yyyymmddslash,
|
||||
currency_usd_simple,
|
||||
currency_usd,
|
||||
currency_eur_simple
|
||||
};
|
||||
|
||||
static const std::unordered_map<int, std::string> builtin_formats;
|
||||
|
||||
static std::string builtin_format_code(int index);
|
||||
|
||||
static bool is_date_format(const std::string &format);
|
||||
static bool is_builtin(const std::string &format);
|
||||
|
||||
format get_format_code() const { return format_code_; }
|
||||
void set_format_code(format format_code) { format_code_ = format_code; }
|
||||
void set_format_code(const std::string &format_code) { custom_format_code_ = format_code; }
|
||||
|
||||
private:
|
||||
std::string custom_format_code_ = "";
|
||||
format format_code_ = format::general;
|
||||
int format_index_ = 0;
|
||||
};
|
||||
|
||||
struct color
|
||||
{
|
||||
static const color black;
|
||||
static const color white;
|
||||
static const color red;
|
||||
static const color darkred;
|
||||
static const color blue;
|
||||
static const color darkblue;
|
||||
static const color green;
|
||||
static const color darkgreen;
|
||||
static const color yellow;
|
||||
static const color darkyellow;
|
||||
|
||||
color(int index)
|
||||
{
|
||||
this->index = index;
|
||||
}
|
||||
|
||||
int index;
|
||||
};
|
||||
|
||||
class font
|
||||
{
|
||||
enum class underline
|
||||
{
|
||||
none,
|
||||
double_,
|
||||
double_accounting,
|
||||
single,
|
||||
single_accounting
|
||||
};
|
||||
|
||||
/* std::string name = "Calibri";
|
||||
int size = 11;
|
||||
bool bold = false;
|
||||
bool italic = false;
|
||||
bool superscript = false;
|
||||
bool subscript = false;
|
||||
underline underline = underline::none;
|
||||
bool strikethrough = false;
|
||||
color color = color::black;*/
|
||||
};
|
||||
|
||||
class fill
|
||||
{
|
||||
public:
|
||||
enum class type
|
||||
{
|
||||
none,
|
||||
solid,
|
||||
gradient_linear,
|
||||
gradient_path,
|
||||
pattern_darkdown,
|
||||
pattern_darkgray,
|
||||
pattern_darkgrid,
|
||||
pattern_darkhorizontal,
|
||||
pattern_darktrellis,
|
||||
pattern_darkup,
|
||||
pattern_darkvertical,
|
||||
pattern_gray0625,
|
||||
pattern_gray125,
|
||||
pattern_lightdown,
|
||||
pattern_lightgray,
|
||||
pattern_lightgrid,
|
||||
pattern_lighthorizontal,
|
||||
pattern_lighttrellis,
|
||||
pattern_lightup,
|
||||
pattern_lightvertical,
|
||||
pattern_mediumgray,
|
||||
};
|
||||
|
||||
type type_ = type::none;
|
||||
int rotation = 0;
|
||||
color start_color = color::white;
|
||||
color end_color = color::black;
|
||||
};
|
||||
|
||||
class borders
|
||||
{
|
||||
struct border
|
||||
{
|
||||
enum class style
|
||||
{
|
||||
none,
|
||||
dashdot,
|
||||
dashdotdot,
|
||||
dashed,
|
||||
dotted,
|
||||
double_,
|
||||
hair,
|
||||
medium,
|
||||
mediumdashdot,
|
||||
mediumdashdotdot,
|
||||
mediumdashed,
|
||||
slantdashdot,
|
||||
thick,
|
||||
thin
|
||||
};
|
||||
|
||||
style style_ = style::none;
|
||||
color color_ = color::black;
|
||||
};
|
||||
|
||||
enum class diagonal_direction
|
||||
{
|
||||
none,
|
||||
up,
|
||||
down,
|
||||
both
|
||||
};
|
||||
|
||||
border left;
|
||||
border right;
|
||||
border top;
|
||||
border bottom;
|
||||
border diagonal;
|
||||
// diagonal_direction diagonal_direction = diagonal_direction::none;
|
||||
border all_borders;
|
||||
border outline;
|
||||
border inside;
|
||||
border vertical;
|
||||
border horizontal;
|
||||
};
|
||||
|
||||
class protection
|
||||
{
|
||||
public:
|
||||
enum class type
|
||||
{
|
||||
inherit,
|
||||
protected_,
|
||||
unprotected
|
||||
};
|
||||
|
||||
type locked;
|
||||
type hidden;
|
||||
};
|
||||
|
||||
class style
|
||||
{
|
||||
public:
|
||||
style(bool static_ = false) : static_(static_) {}
|
||||
|
||||
style copy() const;
|
||||
|
||||
font get_font() const;
|
||||
void set_font(font font);
|
||||
|
||||
fill get_fill() const;
|
||||
void set_fill(fill fill);
|
||||
|
||||
borders get_borders() const;
|
||||
void set_borders(borders borders);
|
||||
|
||||
alignment get_alignment() const;
|
||||
void set_alignment(alignment alignment);
|
||||
|
||||
number_format &get_number_format() { return number_format_; }
|
||||
const number_format &get_number_format() const { return number_format_; }
|
||||
void set_number_format(number_format number_format);
|
||||
|
||||
protection get_protection() const;
|
||||
void set_protection(protection protection);
|
||||
|
||||
private:
|
||||
style(const style &rhs);
|
||||
|
||||
bool static_ = false;
|
||||
font font_;
|
||||
fill fill_;
|
||||
borders borders_;
|
||||
alignment alignment_;
|
||||
number_format number_format_;
|
||||
protection protection_;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
|
@ -1,36 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "style.h"
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class workbook;
|
||||
|
||||
class style_writer
|
||||
{
|
||||
public:
|
||||
style_writer(workbook &wb);
|
||||
std::unordered_map<std::size_t, std::string> get_style_by_hash() const;
|
||||
std::string write_table() const;
|
||||
|
||||
private:
|
||||
std::vector<style> get_style_list(const workbook &wb) const;
|
||||
std::unordered_map<int, std::string> write_fonts() const;
|
||||
std::unordered_map<int, std::string> write_fills() const;
|
||||
std::unordered_map<int, std::string> write_borders() const;
|
||||
void write_cell_style_xfs();
|
||||
void write_cell_xfs();
|
||||
void write_cell_style();
|
||||
void write_dxfs();
|
||||
void write_table_styles();
|
||||
void write_number_formats();
|
||||
|
||||
std::vector<style> style_list_;
|
||||
workbook &wb_;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
59
include/xlnt/styles/alignment.hpp
Normal file
59
include/xlnt/styles/alignment.hpp
Normal file
|
@ -0,0 +1,59 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
/// <summary>
|
||||
/// Alignment options for use in styles.
|
||||
/// </summary>
|
||||
struct alignment
|
||||
{
|
||||
enum class horizontal_alignment
|
||||
{
|
||||
general,
|
||||
left,
|
||||
right,
|
||||
center,
|
||||
center_continuous,
|
||||
justify
|
||||
};
|
||||
|
||||
enum class vertical_alignment
|
||||
{
|
||||
bottom,
|
||||
top,
|
||||
center,
|
||||
justify
|
||||
};
|
||||
|
||||
horizontal_alignment horizontal = horizontal_alignment::general;
|
||||
vertical_alignment vertical = vertical_alignment::bottom;
|
||||
int text_rotation = 0;
|
||||
bool wrap_text = false;
|
||||
bool shrink_to_fit = false;
|
||||
int indent = 0;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
75
include/xlnt/styles/borders.hpp
Normal file
75
include/xlnt/styles/borders.hpp
Normal file
|
@ -0,0 +1,75 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class borders
|
||||
{
|
||||
struct border
|
||||
{
|
||||
enum class style
|
||||
{
|
||||
none,
|
||||
dashdot,
|
||||
dashdotdot,
|
||||
dashed,
|
||||
dotted,
|
||||
double_,
|
||||
hair,
|
||||
medium,
|
||||
mediumdashdot,
|
||||
mediumdashdotdot,
|
||||
mediumdashed,
|
||||
slantdashdot,
|
||||
thick,
|
||||
thin
|
||||
};
|
||||
|
||||
style style_ = style::none;
|
||||
color color_ = color::black;
|
||||
};
|
||||
|
||||
enum class diagonal_direction
|
||||
{
|
||||
none,
|
||||
up,
|
||||
down,
|
||||
both
|
||||
};
|
||||
|
||||
border left;
|
||||
border right;
|
||||
border top;
|
||||
border bottom;
|
||||
border diagonal;
|
||||
// diagonal_direction diagonal_direction = diagonal_direction::none;
|
||||
border all_borders;
|
||||
border outline;
|
||||
border inside;
|
||||
border vertical;
|
||||
border horizontal;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
49
include/xlnt/styles/color.hpp
Normal file
49
include/xlnt/styles/color.hpp
Normal file
|
@ -0,0 +1,49 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
struct color
|
||||
{
|
||||
static const color black;
|
||||
static const color white;
|
||||
static const color red;
|
||||
static const color darkred;
|
||||
static const color blue;
|
||||
static const color darkblue;
|
||||
static const color green;
|
||||
static const color darkgreen;
|
||||
static const color yellow;
|
||||
static const color darkyellow;
|
||||
|
||||
color(int index)
|
||||
{
|
||||
this->index = index;
|
||||
}
|
||||
|
||||
int index;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
64
include/xlnt/styles/fill.hpp
Normal file
64
include/xlnt/styles/fill.hpp
Normal file
|
@ -0,0 +1,64 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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 "color.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class fill
|
||||
{
|
||||
public:
|
||||
enum class type
|
||||
{
|
||||
none,
|
||||
solid,
|
||||
gradient_linear,
|
||||
gradient_path,
|
||||
pattern_darkdown,
|
||||
pattern_darkgray,
|
||||
pattern_darkgrid,
|
||||
pattern_darkhorizontal,
|
||||
pattern_darktrellis,
|
||||
pattern_darkup,
|
||||
pattern_darkvertical,
|
||||
pattern_gray0625,
|
||||
pattern_gray125,
|
||||
pattern_lightdown,
|
||||
pattern_lightgray,
|
||||
pattern_lightgrid,
|
||||
pattern_lighthorizontal,
|
||||
pattern_lighttrellis,
|
||||
pattern_lightup,
|
||||
pattern_lightvertical,
|
||||
pattern_mediumgray,
|
||||
};
|
||||
|
||||
type type_ = type::none;
|
||||
int rotation = 0;
|
||||
color start_color = color::white;
|
||||
color end_color = color::black;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
50
include/xlnt/styles/font.hpp
Normal file
50
include/xlnt/styles/font.hpp
Normal file
|
@ -0,0 +1,50 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class font
|
||||
{
|
||||
enum class underline
|
||||
{
|
||||
none,
|
||||
double_,
|
||||
double_accounting,
|
||||
single,
|
||||
single_accounting
|
||||
};
|
||||
|
||||
/* std::string name = "Calibri";
|
||||
int size = 11;
|
||||
bool bold = false;
|
||||
bool italic = false;
|
||||
bool superscript = false;
|
||||
bool subscript = false;
|
||||
underline underline = underline::none;
|
||||
bool strikethrough = false;
|
||||
color color = color::black;*/
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
86
include/xlnt/styles/number_format.hpp
Normal file
86
include/xlnt/styles/number_format.hpp
Normal file
|
@ -0,0 +1,86 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class number_format
|
||||
{
|
||||
public:
|
||||
enum class format
|
||||
{
|
||||
general,
|
||||
text,
|
||||
number,
|
||||
number00,
|
||||
number_comma_separated1,
|
||||
number_comma_separated2,
|
||||
percentage,
|
||||
percentage00,
|
||||
date_yyyymmdd2,
|
||||
date_yyyymmdd,
|
||||
date_ddmmyyyy,
|
||||
date_dmyslash,
|
||||
date_dmyminus,
|
||||
date_dmminus,
|
||||
date_myminus,
|
||||
date_xlsx14,
|
||||
date_xlsx15,
|
||||
date_xlsx16,
|
||||
date_xlsx17,
|
||||
date_xlsx22,
|
||||
date_datetime,
|
||||
date_time1,
|
||||
date_time2,
|
||||
date_time3,
|
||||
date_time4,
|
||||
date_time5,
|
||||
date_time6,
|
||||
date_time7,
|
||||
date_time8,
|
||||
date_timedelta,
|
||||
date_yyyymmddslash,
|
||||
currency_usd_simple,
|
||||
currency_usd,
|
||||
currency_eur_simple
|
||||
};
|
||||
|
||||
static const std::unordered_map<int, std::string> builtin_formats;
|
||||
|
||||
static std::string builtin_format_code(int index);
|
||||
|
||||
static bool is_date_format(const std::string &format);
|
||||
static bool is_builtin(const std::string &format);
|
||||
|
||||
format get_format_code() const { return format_code_; }
|
||||
void set_format_code(format format_code) { format_code_ = format_code; }
|
||||
void set_format_code(const std::string &format_code) { custom_format_code_ = format_code; }
|
||||
|
||||
private:
|
||||
std::string custom_format_code_ = "";
|
||||
format format_code_ = format::general;
|
||||
int format_index_ = 0;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
42
include/xlnt/styles/protection.hpp
Normal file
42
include/xlnt/styles/protection.hpp
Normal file
|
@ -0,0 +1,42 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class protection
|
||||
{
|
||||
public:
|
||||
enum class type
|
||||
{
|
||||
inherit,
|
||||
protected_,
|
||||
unprotected
|
||||
};
|
||||
|
||||
type locked;
|
||||
type hidden;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
74
include/xlnt/styles/style.hpp
Normal file
74
include/xlnt/styles/style.hpp
Normal file
|
@ -0,0 +1,74 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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 "font.hpp"
|
||||
#include "fill.hpp"
|
||||
#include "borders.hpp"
|
||||
#include "alignment.hpp"
|
||||
#include "color.hpp"
|
||||
#include "number_format.hpp"
|
||||
#include "protection.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class style
|
||||
{
|
||||
public:
|
||||
style(bool static_ = false) : static_(static_) {}
|
||||
|
||||
style copy() const;
|
||||
|
||||
font get_font() const;
|
||||
void set_font(font font);
|
||||
|
||||
fill get_fill() const;
|
||||
void set_fill(fill fill);
|
||||
|
||||
borders get_borders() const;
|
||||
void set_borders(borders borders);
|
||||
|
||||
alignment get_alignment() const;
|
||||
void set_alignment(alignment alignment);
|
||||
|
||||
number_format &get_number_format() { return number_format_; }
|
||||
const number_format &get_number_format() const { return number_format_; }
|
||||
void set_number_format(number_format number_format);
|
||||
|
||||
protection get_protection() const;
|
||||
void set_protection(protection protection);
|
||||
|
||||
private:
|
||||
style(const style &rhs);
|
||||
|
||||
bool static_ = false;
|
||||
font font_;
|
||||
fill fill_;
|
||||
borders borders_;
|
||||
alignment alignment_;
|
||||
number_format number_format_;
|
||||
protection protection_;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
|
@ -1,6 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
typedef uint32_t row_t;
|
||||
typedef uint32_t column_t;
|
0
include/xlnt/workbook/document_properties.hpp
Normal file
0
include/xlnt/workbook/document_properties.hpp
Normal file
0
include/xlnt/workbook/document_security.hpp
Normal file
0
include/xlnt/workbook/document_security.hpp
Normal file
|
@ -1,3 +1,26 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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>
|
40
include/xlnt/worksheet/column_properties.hpp
Normal file
40
include/xlnt/worksheet/column_properties.hpp
Normal file
|
@ -0,0 +1,40 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class column_properties
|
||||
{
|
||||
public:
|
||||
void set_height(int height) { this->height = height; }
|
||||
int row_index;
|
||||
int height;
|
||||
bool visible;
|
||||
int outline_level;
|
||||
bool collapsed;
|
||||
int style_index;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
57
include/xlnt/worksheet/page_margins.hpp
Normal file
57
include/xlnt/worksheet/page_margins.hpp
Normal file
|
@ -0,0 +1,57 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class page_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_;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
95
include/xlnt/worksheet/page_setup.hpp
Normal file
95
include/xlnt/worksheet/page_setup.hpp
Normal file
|
@ -0,0 +1,95 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
struct 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) {}
|
||||
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) { default_ = false; 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; }
|
||||
|
||||
private:
|
||||
bool default_;
|
||||
page_break break_;
|
||||
sheet_state sheet_state_;
|
||||
paper_size paper_size_;
|
||||
orientation orientation_;
|
||||
bool fit_to_page_;
|
||||
bool fit_to_height_;
|
||||
bool fit_to_width_;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
|
@ -1,11 +1,33 @@
|
|||
// Copyright (c) 2014 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 "range_reference.h"
|
||||
#include "worksheet.h"
|
||||
#include "range_reference.hpp"
|
||||
#include "worksheet.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
|
@ -1,6 +1,28 @@
|
|||
// Copyright (c) 2014 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 "cell_reference.h"
|
||||
#include "../cell/cell_reference.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
40
include/xlnt/worksheet/row_properties.hpp
Normal file
40
include/xlnt/worksheet/row_properties.hpp
Normal file
|
@ -0,0 +1,40 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class row_properties
|
||||
{
|
||||
public:
|
||||
void set_height(int height) { this->height = height; }
|
||||
int row_index;
|
||||
int height;
|
||||
bool visible;
|
||||
int outline_level;
|
||||
bool collapsed;
|
||||
int style_index;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
|
@ -1,3 +1,26 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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 <list>
|
||||
|
@ -6,7 +29,7 @@
|
|||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "types.h"
|
||||
#include "../common/types.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class workbook;
|
||||
class worksheet;
|
||||
|
||||
class writer
|
||||
{
|
||||
public:
|
||||
static std::string write_workbook(const workbook &wb);
|
||||
static std::string write_worksheet(worksheet ws);
|
||||
static std::string write_worksheet(worksheet ws, const std::vector<std::string> &string_table);
|
||||
static std::string write_worksheet(worksheet ws, const std::vector<std::string> &string_table, const std::unordered_map<std::size_t, std::string> &style_table);
|
||||
static std::string write_theme();
|
||||
static std::string write_content_types(const std::pair<std::unordered_map<std::string, std::string>, std::unordered_map<std::string, std::string>> &content_types);
|
||||
static std::string write_relationships(const std::unordered_map<std::string, std::pair<std::string, std::string>> &relationships);
|
||||
static std::string write_workbook_rels(const workbook &wb);
|
||||
static std::string write_worksheet_rels(worksheet ws, int n);
|
||||
static std::string write_string_table(const std::unordered_map<std::string, int> &string_table);
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
65
include/xlnt/writer/chart_writer.hpp
Normal file
65
include/xlnt/writer/chart_writer.hpp
Normal file
|
@ -0,0 +1,65 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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 <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "charts/chart.h"
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class chart_writer
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
class pie_chart_writer : public chart_writer
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
class pie_chart_writer : public chart_writer
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
class pie_chart_writer : public chart_writer
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
class pie_chart_writer : public chart_writer
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
class chart_writer_factory
|
||||
{
|
||||
public:
|
||||
static std::unique_ptr<chart_writer> create_writer(chart c);
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
33
include/xlnt/writer/comment_writer.hpp
Normal file
33
include/xlnt/writer/comment_writer.hpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class comment_writer
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
33
include/xlnt/writer/drawing_writer.hpp
Normal file
33
include/xlnt/writer/drawing_writer.hpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class drawing_writer
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
33
include/xlnt/writer/excel_writer.hpp
Normal file
33
include/xlnt/writer/excel_writer.hpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class excel_writer
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
33
include/xlnt/writer/string_writer.hpp
Normal file
33
include/xlnt/writer/string_writer.hpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class string_writer
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
59
include/xlnt/writer/style_writer.hpp
Normal file
59
include/xlnt/writer/style_writer.hpp
Normal file
|
@ -0,0 +1,59 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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 <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "../styles/style.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class workbook;
|
||||
|
||||
class style_writer
|
||||
{
|
||||
public:
|
||||
style_writer(workbook &wb);
|
||||
std::unordered_map<std::size_t, std::string> get_style_by_hash() const;
|
||||
std::string write_table() const;
|
||||
|
||||
private:
|
||||
std::vector<style> get_style_list(const workbook &wb) const;
|
||||
std::unordered_map<int, std::string> write_fonts() const;
|
||||
std::unordered_map<int, std::string> write_fills() const;
|
||||
std::unordered_map<int, std::string> write_borders() const;
|
||||
void write_cell_style_xfs();
|
||||
void write_cell_xfs();
|
||||
void write_cell_style();
|
||||
void write_dxfs();
|
||||
void write_table_styles();
|
||||
void write_number_formats();
|
||||
|
||||
std::vector<style> style_list_;
|
||||
workbook &wb_;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
33
include/xlnt/writer/theme_writer.hpp
Normal file
33
include/xlnt/writer/theme_writer.hpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class theme_writer
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
33
include/xlnt/writer/workbook_writer.hpp
Normal file
33
include/xlnt/writer/workbook_writer.hpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class workbook_writer
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
33
include/xlnt/writer/worksheet_writer.hpp
Normal file
33
include/xlnt/writer/worksheet_writer.hpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class worksheet_writer
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
49
include/xlnt/writer/writer.hpp
Normal file
49
include/xlnt/writer/writer.hpp
Normal file
|
@ -0,0 +1,49 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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>
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class workbook;
|
||||
class worksheet;
|
||||
|
||||
class writer
|
||||
{
|
||||
public:
|
||||
static std::string write_workbook(const workbook &wb);
|
||||
static std::string write_worksheet(worksheet ws);
|
||||
static std::string write_worksheet(worksheet ws, const std::vector<std::string> &string_table);
|
||||
static std::string write_worksheet(worksheet ws, const std::vector<std::string> &string_table, const std::unordered_map<std::size_t, std::string> &style_table);
|
||||
static std::string write_theme();
|
||||
static std::string write_content_types(const std::pair<std::unordered_map<std::string, std::string>, std::unordered_map<std::string, std::string>> &content_types);
|
||||
static std::string write_relationships(const std::unordered_map<std::string, std::pair<std::string, std::string>> &relationships);
|
||||
static std::string write_workbook_rels(const workbook &wb);
|
||||
static std::string write_worksheet_rels(worksheet ws, int n);
|
||||
static std::string write_string_table(const std::unordered_map<std::string, int> &string_table);
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
|
@ -1,22 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <list>
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "cell.h"
|
||||
#include "cell_reference.h"
|
||||
#include "custom_exceptions.h"
|
||||
#include "datetime.h"
|
||||
#include "drawing.h"
|
||||
#include "range.h"
|
||||
#include "reader.h"
|
||||
#include "range_reference.h"
|
||||
#include "relationship.h"
|
||||
#include "string_table.h"
|
||||
#include "style_writer.h"
|
||||
#include "workbook.h"
|
||||
#include "worksheet.h"
|
||||
#include "writer.h"
|
46
include/xlnt/xlnt.hpp
Normal file
46
include/xlnt/xlnt.hpp
Normal file
|
@ -0,0 +1,46 @@
|
|||
// Copyright (c) 2014 Thomas Fussell
|
||||
// Copyright (c) 2010-2014 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
|
||||
|
||||
const std::string version = "0.1.0";
|
||||
|
||||
const std::string author = "Thomas Fussell";
|
||||
const std::string license = "MIT";
|
||||
const std::string author_email = "thomas.fussell@gmail.com";
|
||||
const std::string url = "https://github.com/tfussell/xlnt";
|
||||
const std::string download_url = "https://github.com/tfussell/xlnt/archive/master.zip";
|
||||
|
||||
#include "workbook/workbook.hpp"
|
||||
#include "worksheet/worksheet.hpp"
|
||||
#include "cell/cell_reference.hpp"
|
||||
#include "cell/cell.hpp"
|
||||
#include "common/relationship.hpp"
|
||||
#include "common/datetime.hpp"
|
||||
#include "writer/writer.hpp"
|
||||
#include "writer/style_writer.hpp"
|
||||
#include "worksheet/range_reference.hpp"
|
||||
#include "worksheet/range.hpp"
|
||||
#include "common/exceptions.hpp"
|
||||
#include "reader/reader.hpp"
|
||||
#include "common/string_table.hpp"
|
|
@ -2,12 +2,12 @@
|
|||
#include <locale>
|
||||
#include <sstream>
|
||||
|
||||
#include "cell.h"
|
||||
#include "cell_reference.h"
|
||||
#include "datetime.h"
|
||||
#include "relationship.h"
|
||||
#include "worksheet.h"
|
||||
#include "detail/cell_impl.h"
|
||||
#include "cell/cell.hpp"
|
||||
#include "cell/cell_reference.hpp"
|
||||
#include "common/datetime.hpp"
|
||||
#include "common/relationship.hpp"
|
||||
#include "worksheet/worksheet.hpp"
|
||||
#include "detail/cell_impl.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#include <locale>
|
||||
|
||||
#include "cell_reference.h"
|
||||
#include "constants.h"
|
||||
#include "custom_exceptions.h"
|
||||
#include "range_reference.h"
|
||||
#include "cell/cell_reference.hpp"
|
||||
#include "constants.hpp"
|
||||
#include "common/exceptions.hpp"
|
||||
#include "worksheet/range_reference.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <limits>
|
||||
|
||||
#include "constants.h"
|
||||
#include "config.h"
|
||||
#include "constants.hpp"
|
||||
#include "config.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "types.h"
|
||||
#include "common/types.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
#include <cmath>
|
||||
#include <ctime>
|
||||
|
||||
#include "datetime.h"
|
||||
#include "common/datetime.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "cell_impl.h"
|
||||
#include "cell_impl.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
namespace detail {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
#include "cell.h"
|
||||
#include "types.h"
|
||||
#include "relationship.h"
|
||||
#include "cell/cell.hpp"
|
||||
#include "common/types.hpp"
|
||||
#include "common/relationship.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "cell_impl.h"
|
||||
#include "cell_impl.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
#include "drawing.h"
|
||||
#include "drawing/drawing.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#include "custom_exceptions.h"
|
||||
#include "common/exceptions.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
bad_sheet_title::bad_sheet_title(const std::string &title)
|
||||
sheet_title_exception::sheet_title_exception(const std::string &title)
|
||||
: std::runtime_error(std::string("bad worksheet title: ") + title)
|
||||
{
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
#include "range.h"
|
||||
#include "cell.h"
|
||||
#include "range_reference.h"
|
||||
#include "worksheet.h"
|
||||
#include "worksheet/range.hpp"
|
||||
#include "cell/cell.hpp"
|
||||
#include "worksheet/range_reference.hpp"
|
||||
#include "worksheet/worksheet.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include <locale>
|
||||
|
||||
#include "range_reference.h"
|
||||
#include "worksheet/range_reference.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#include <algorithm>
|
||||
#include <pugixml.hpp>
|
||||
|
||||
#include "reader.h"
|
||||
#include "cell.h"
|
||||
#include "datetime.h"
|
||||
#include "range_reference.h"
|
||||
#include "workbook.h"
|
||||
#include "worksheet.h"
|
||||
#include "reader/reader.hpp"
|
||||
#include "cell/cell.hpp"
|
||||
#include "common/datetime.hpp"
|
||||
#include "worksheet/range_reference.hpp"
|
||||
#include "workbook/workbook.hpp"
|
||||
#include "worksheet/worksheet.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "relationship.h"
|
||||
#include "common/relationship.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include <locale>
|
||||
#include <sstream>
|
||||
|
||||
#include "protection.h"
|
||||
#include "worksheet/sheet_protection.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#include <stdexcept>
|
||||
|
||||
#include "string_table.h"
|
||||
#include "common/string_table.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "style_writer.h"
|
||||
#include "writer/style_writer.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
|
|
|
@ -3,18 +3,18 @@
|
|||
#include <sstream>
|
||||
#include <pugixml.hpp>
|
||||
|
||||
#include "workbook.h"
|
||||
#include "custom_exceptions.h"
|
||||
#include "drawing.h"
|
||||
#include "range.h"
|
||||
#include "reader.h"
|
||||
#include "relationship.h"
|
||||
#include "worksheet.h"
|
||||
#include "writer.h"
|
||||
#include "zip_file.h"
|
||||
#include "detail/cell_impl.h"
|
||||
#include "detail/workbook_impl.h"
|
||||
#include "detail/worksheet_impl.h"
|
||||
#include "workbook/workbook.hpp"
|
||||
#include "common/exceptions.hpp"
|
||||
#include "drawing/drawing.hpp"
|
||||
#include "worksheet/range.hpp"
|
||||
#include "reader/reader.hpp"
|
||||
#include "common/relationship.hpp"
|
||||
#include "worksheet/worksheet.hpp"
|
||||
#include "writer/writer.hpp"
|
||||
#include "common/zip_file.hpp"
|
||||
#include "detail/cell_impl.hpp"
|
||||
#include "detail/workbook_impl.hpp"
|
||||
#include "detail/worksheet_impl.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
namespace detail {
|
||||
|
@ -320,13 +320,13 @@ worksheet workbook::create_sheet(const std::string &title)
|
|||
{
|
||||
if(title.length() > 31)
|
||||
{
|
||||
throw bad_sheet_title(title);
|
||||
throw sheet_title_exception(title);
|
||||
}
|
||||
|
||||
if(std::find_if(title.begin(), title.end(),
|
||||
[](char c) { return c == '*' || c == ':' || c == '/' || c == '\\' || c == '?' || c == '[' || c == ']'; }) != title.end())
|
||||
{
|
||||
throw bad_sheet_title(title);
|
||||
throw sheet_title_exception(title);
|
||||
}
|
||||
|
||||
if(std::find_if(d_->worksheets_.begin(), d_->worksheets_.end(), [&](detail::worksheet_impl &ws) { return worksheet(&ws).get_title() == title; }) != d_->worksheets_.end())
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
#include <algorithm>
|
||||
|
||||
#include "worksheet.h"
|
||||
#include "cell.h"
|
||||
#include "datetime.h"
|
||||
#include "range.h"
|
||||
#include "range_reference.h"
|
||||
#include "relationship.h"
|
||||
#include "workbook.h"
|
||||
#include "detail/worksheet_impl.h"
|
||||
#include "worksheet/worksheet.hpp"
|
||||
#include "cell/cell.hpp"
|
||||
#include "common/datetime.hpp"
|
||||
#include "worksheet/range.hpp"
|
||||
#include "worksheet/range_reference.hpp"
|
||||
#include "common/relationship.hpp"
|
||||
#include "workbook/workbook.hpp"
|
||||
#include "detail/worksheet_impl.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
|
||||
#include <pugixml.hpp>
|
||||
|
||||
#include "writer.h"
|
||||
#include "cell.h"
|
||||
#include "constants.h"
|
||||
#include "range.h"
|
||||
#include "range_reference.h"
|
||||
#include "worksheet.h"
|
||||
#include "writer/writer.hpp"
|
||||
#include "cell/cell.hpp"
|
||||
#include "constants.hpp"
|
||||
#include "worksheet/range.hpp"
|
||||
#include "worksheet/range_reference.hpp"
|
||||
#include "worksheet/worksheet.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <array>
|
||||
#include <fstream>
|
||||
|
||||
#include "zip_file.h"
|
||||
#include "common/zip_file.hpp"
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <sstream>
|
||||
#include <pugixml.hpp>
|
||||
|
||||
#include "PathHelper.h"
|
||||
#include "path_helper.hpp"
|
||||
|
||||
class Helper
|
||||
{
|
|
@ -9,7 +9,7 @@
|
|||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
#include "PathHelper.h"
|
||||
#include "path_helper.hpp"
|
||||
|
||||
class TemporaryFile
|
||||
{
|
File diff suppressed because it is too large
Load Diff
1499
tests/schemas/dml-chart.xsd
Executable file
1499
tests/schemas/dml-chart.xsd
Executable file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user