-
Notifications
You must be signed in to change notification settings - Fork 429
Expand file tree
/
Copy pathconstants.hpp
More file actions
146 lines (120 loc) · 4.8 KB
/
constants.hpp
File metadata and controls
146 lines (120 loc) · 4.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
// Copyright (c) 2014-2021 Thomas Fussell
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE
//
// @license: http://www.opensource.org/licenses/mit-license.php
// @author: see AUTHORS file
#pragma once
#include <string>
#include <unordered_map>
#include <xlnt/xlnt_config.hpp>
#include <xlnt/cell/index_types.hpp>
#include <xlnt/utils/path.hpp>
namespace xlnt {
struct XLNT_API constants
{
/// <summary>
/// Returns the lowest allowable row index in a worksheet.
/// </summary>
static row_t min_row();
/// <summary>
/// Returns the largest allowable row index in a worksheet.
/// </summary>
static row_t max_row();
/// <summary>
/// Returns the lowest allowable column index in a worksheet.
/// </summary>
static const column_t min_column();
/// <summary>
/// Returns the largest allowable column index in a worksheet.
/// </summary>
static const column_t max_column();
/// <summary>
/// Returns the maximum amount of elements that functions like std::vector::reserve (or other containers) are allowed to allocate.
/// Information like a "count" is often saved in XLSX files and can be used by std::vector::reserve (or other containers)
/// to allocate the memory right away and thus improve performance. However, malicious or broken files
/// might then cause XLNT to allocate extreme amounts of memory. This function sets a limit to protect against such issues.
/// </summary>
static const size_t max_elements_for_reserve();
/// <summary>
/// Returns the URI of the directory containing package properties.
/// </summary>
static const path package_properties();
/// <summary>
/// Returns the URI of the directory containing SpreatsheetML package parts.
/// </summary>
static const path package_xl();
/// <summary>
/// Returns the URI of the directory containing root relationships package part.
/// </summary>
static const path package_root_rels();
/// <summary>
/// Returns the URI of the directory containing package themes.
/// </summary>
static const path package_theme();
/// <summary>
/// Returns the URI of the directory containing package worksheets.
/// </summary>
static const path package_worksheets();
/// <summary>
/// Returns the URI of the directory containing package worksheets.
/// </summary>
static const path package_drawings();
/// <summary>
/// Returns the URI of the content types package part.
/// </summary>
static const path part_content_types();
/// <summary>
/// Returns the URI of the core properties package part.
/// </summary>
static const path part_core();
/// <summary>
/// Returns the URI of the app properties package part.
/// </summary>
static const path part_app();
/// <summary>
/// Returns the URI of the workbook package part.
/// </summary>
static const path part_workbook();
/// <summary>
/// Returns the URI of the root relationships package part.
/// </summary>
static const path part_root_relationships();
/// <summary>
/// Returns the URI of the styles package part.
/// </summary>
static const path part_styles();
/// <summary>
/// Returns the URI of the theme package part.
/// </summary>
static const path part_theme();
/// <summary>
/// Returns the URI of the shared strings package part.
/// </summary>
static const path part_shared_strings();
/// <summary>
/// Returns an unordered_map mapping namespace names to namespaces.
/// </summary>
static const std::unordered_map<std::string, std::string> &namespaces();
/// <summary>
/// Returns the namespace URI from a namespace name.
/// </summary>
static const std::string &ns(const std::string &id);
};
} // namespace xlnt