Skip to content

Commit dccd574

Browse files
committed
feat: REX::JSON array types
1 parent 39ebcd1 commit dccd574

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

include/REX/REX/JSON.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,39 @@ namespace REX::JSON
8383

8484
template <class Store = SettingStore>
8585
using Str = Setting<std::string, Store>;
86+
87+
template <class T, class Store = SettingStore>
88+
using SettingA = Setting<std::vector<T>, Store>;
89+
90+
template <class Store = SettingStore>
91+
using BoolA = SettingA<bool, Store>;
92+
93+
template <class Store = SettingStore>
94+
using F32A = SettingA<float, Store>;
95+
96+
template <class Store = SettingStore>
97+
using F64A = SettingA<double, Store>;
98+
99+
template <class Store = SettingStore>
100+
using I8A = SettingA<std::int8_t, Store>;
101+
102+
template <class Store = SettingStore>
103+
using I16A = SettingA<std::int16_t, Store>;
104+
105+
template <class Store = SettingStore>
106+
using I32A = SettingA<std::int32_t, Store>;
107+
108+
template <class Store = SettingStore>
109+
using U8A = SettingA<std::uint8_t, Store>;
110+
111+
template <class Store = SettingStore>
112+
using U16A = SettingA<std::uint16_t, Store>;
113+
114+
template <class Store = SettingStore>
115+
using U32A = SettingA<std::uint32_t, Store>;
116+
117+
template <class Store = SettingStore>
118+
using StrA = SettingA<std::string, Store>;
86119
}
87120

88121
template <class T, class S, class CharT>

src/REX/REX/JSON.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ namespace REX::JSON
3333
template void SettingLoad<std::int16_t>(void*, path_t, std::int16_t&, std::int16_t&);
3434
template void SettingLoad<std::int32_t>(void*, path_t, std::int32_t&, std::int32_t&);
3535
template void SettingLoad<std::string>(void*, path_t, std::string&, std::string&);
36+
template void SettingLoad<std::vector<bool>>(void*, path_t, std::vector<bool>&, std::vector<bool>&);
37+
template void SettingLoad<std::vector<float>>(void*, path_t, std::vector<float>&, std::vector<float>&);
38+
template void SettingLoad<std::vector<double>>(void*, path_t, std::vector<double>&, std::vector<double>&);
39+
template void SettingLoad<std::vector<std::uint8_t>>(void*, path_t, std::vector<std::uint8_t>&, std::vector<std::uint8_t>&);
40+
template void SettingLoad<std::vector<std::uint16_t>>(void*, path_t, std::vector<std::uint16_t>&, std::vector<std::uint16_t>&);
41+
template void SettingLoad<std::vector<std::uint32_t>>(void*, path_t, std::vector<std::uint32_t>&, std::vector<std::uint32_t>&);
42+
template void SettingLoad<std::vector<std::int8_t>>(void*, path_t, std::vector<std::int8_t>&, std::vector<std::int8_t>&);
43+
template void SettingLoad<std::vector<std::int16_t>>(void*, path_t, std::vector<std::int16_t>&, std::vector<std::int16_t>&);
44+
template void SettingLoad<std::vector<std::int32_t>>(void*, path_t, std::vector<std::int32_t>&, std::vector<std::int32_t>&);
45+
template void SettingLoad<std::vector<std::string>>(void*, path_t, std::vector<std::string>&, std::vector<std::string>&);
3646

3747
template <class T>
3848
void SettingSave<T>(
@@ -59,6 +69,16 @@ namespace REX::JSON
5969
template void SettingSave<std::int16_t>(void*, path_t, std::int16_t&);
6070
template void SettingSave<std::int32_t>(void*, path_t, std::int32_t&);
6171
template void SettingSave<std::string>(void*, path_t, std::string&);
72+
template void SettingSave<std::vector<bool>>(void*, path_t, std::vector<bool>&);
73+
template void SettingSave<std::vector<float>>(void*, path_t, std::vector<float>&);
74+
template void SettingSave<std::vector<double>>(void*, path_t, std::vector<double>&);
75+
template void SettingSave<std::vector<std::uint8_t>>(void*, path_t, std::vector<std::uint8_t>&);
76+
template void SettingSave<std::vector<std::uint16_t>>(void*, path_t, std::vector<std::uint16_t>&);
77+
template void SettingSave<std::vector<std::uint32_t>>(void*, path_t, std::vector<std::uint32_t>&);
78+
template void SettingSave<std::vector<std::int8_t>>(void*, path_t, std::vector<std::int8_t>&);
79+
template void SettingSave<std::vector<std::int16_t>>(void*, path_t, std::vector<std::int16_t>&);
80+
template void SettingSave<std::vector<std::int32_t>>(void*, path_t, std::vector<std::int32_t>&);
81+
template void SettingSave<std::vector<std::string>>(void*, path_t, std::vector<std::string>&);
6282
}
6383

6484
void SettingStore::Load()

0 commit comments

Comments
 (0)