File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -208,6 +208,7 @@ set(LCF_HEADERS
208208 src/lcf/reader_xml.h
209209 src/lcf/saveopt.h
210210 src/lcf/scope_guard.h
211+ src/lcf/span.h
211212 src/lcf/string_view.h
212213 src/lcf/writer_lcf.h
213214 src/lcf/writer_xml.h
@@ -282,6 +283,7 @@ set(LCF_HEADERS
282283 src/generated/lcf/rpg/trooppage.h
283284 src/generated/lcf/rpg/trooppagecondition.h
284285 src/generated/lcf/rpg/variable.h
286+ src/lcf/third_party/span.h
285287 src/lcf/third_party/string_view.h
286288)
287289
Original file line number Diff line number Diff line change @@ -211,6 +211,7 @@ lcfinclude_HEADERS = \
211211 src/lcf/reader_xml.h \
212212 src/lcf/saveopt.h \
213213 src/lcf/scope_guard.h \
214+ src/lcf/span.h \
214215 src/lcf/string_view.h \
215216 src/lcf/writer_lcf.h \
216217 src/lcf/writer_xml.h
@@ -301,6 +302,7 @@ lcfrpginclude_HEADERS = \
301302 src/generated/lcf/rpg/variable.h
302303
303304lcfthirdpartyinclude_HEADERS = \
305+ src/lcf/third_party/span.h \
304306 src/lcf/third_party/string_view.h
305307
306308nodist_lcfinclude_HEADERS = autogen/lcf/config.h
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ See the file [COPYING] for copying conditions.
110110### 3rd party software
111111
112112liblcf code includes a copy of [ inih] under New BSD license.
113- liblcf code includes a copy of [ string-view-lite] under Boost Software License, Version 1.0.
113+ liblcf code includes a copy of [ string-view-lite] and [ span-lite ] under Boost Software License, Version 1.0.
114114See the source code comment headers for license details.
115115
116116
@@ -121,3 +121,4 @@ See the source code comment headers for license details.
121121[ COPYING ] : COPYING
122122[ inih ] : https://github.com/benhoyt/inih
123123[ string-view-lite ] : https://github.com/martinmoene/string-view-lite
124+ [ span-lite ] : https://github.com/martinmoene/span-lite
Original file line number Diff line number Diff line change 1+ /*
2+ * This file is part of liblcf. Copyright (c) 2020 liblcf authors.
3+ * https://github.com/EasyRPG/liblcf - https://easyrpg.org
4+ *
5+ * liblcf is Free/Libre Open Source Software, released under the MIT License.
6+ * For the full copyright and license information, please view the COPYING
7+ * file that was distributed with this source code.
8+ */
9+
10+ #ifndef LCF_SPAN_H
11+ #define LCF_SPAN_H
12+ #include < cstring>
13+ #include < string>
14+ #include < cassert>
15+ #include < iterator>
16+ #include < ostream>
17+ #include < algorithm>
18+
19+ #define span_CONFIG_NO_EXCEPTIONS 1
20+ #define span_FEATURE_WITH_CONTAINER 1
21+ #define span_FEATURE_CONSTRUCTION_FROM_STDARRAY_ELEMENT_TYPE 1
22+ #define span_FEATURE_MAKE_SPAN 1
23+ #include < lcf/third_party/span.h>
24+
25+ namespace lcf {
26+
27+ using ExtentT = nonstd::span_lite::extent_t ;
28+ using nonstd::dynamic_extent;
29+
30+ template <typename T, ExtentT Extent= dynamic_extent>
31+ using Span = nonstd::span<T,Extent>;
32+
33+ template <typename ... Args>
34+ constexpr inline auto MakeSpan (Args&&... args) noexcept -> decltype(nonstd::make_span(std::forward<Args>(args)...)) {
35+ return nonstd::make_span (std::forward<Args>(args)...);
36+ }
37+
38+
39+ } // namespace lcf
40+
41+ #endif
You can’t perform that action at this time.
0 commit comments