-
Notifications
You must be signed in to change notification settings - Fork 208
/
Copy pathembedded_files.cxx.in
59 lines (44 loc) · 1.63 KB
/
embedded_files.cxx.in
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
/***********************************************************************************************************************
* OpenStudio(R), Copyright (c) Alliance for Sustainable Energy, LLC.
* See also https://openstudio.net/license
***********************************************************************************************************************/
#include "embedded_files.hxx"
@BEGIN_NAMESPACE@
namespace embedded_files {
static const size_t embedded_file_count = @NUMFILES@;
@EMBEDDED_FILE_INCLUDES@
static const char *embedded_file_names[] = {
@EMBEDDED_FILE_NAMES@
};
static const size_t embedded_file_lens[] = {
@EMBEDDED_FILE_LENS@
};
static const uint8_t *embedded_files[] = {
@EMBEDDED_FILES@
};
const std::vector<std::string> &fileNames() {
static const std::vector<std::string> result = [](){
std::vector<std::string> val;
val.reserve(embedded_file_count);
for (size_t i = 0; i < embedded_file_count; ++i) {
val.push_back(std::string(embedded_file_names[i]));
}
return val;
}();
return result;
}
const std::map<std::string, std::pair<size_t, const uint8_t *>> &files()
{
static const std::map<std::string, std::pair<size_t, const uint8_t *>> fs = [](){
std::map<std::string, std::pair<size_t, const uint8_t *>> val;
for (size_t i = 0; i < embedded_file_count; ++i) {
val.insert(std::make_pair(std::string(embedded_file_names[i]),
std::make_pair(embedded_file_lens[i],
embedded_files[i])));
}
return val;
}();
return fs;
}
}
@END_NAMESPACE@