| 64 | } |
| 65 | |
| 66 | static inline void GenOne(const TString& data, const TString& key, IOutputStream& out, bool isFile, bool useSections) { |
| 67 | const TString name = "name" + ToString(CityHash64(key.data(), key.size())); |
| 68 | |
| 69 | if (useSections) { |
| 70 | if (isFile) { |
| 71 | Formatter(out, R"__( |
| 72 | extern "C" const char {}[]; |
| 73 | extern "C" const char {}_end[]; |
| 74 | static const int REG_{} = NResource::LightRegisterI("{}", {}, {}_end); |
| 75 | )__", {data, data, name, key, data, data}); |
| 76 | } else { |
| 77 | EmitHexArray(data, name, out); |
| 78 | Formatter(out, R"__( |
| 79 | static const int REG_{} = NResource::LightRegisterS("{}", (const char*){}, sizeof({})); |
| 80 | )__", {name, key, name, name}); |
| 81 | } |
| 82 | return; |
| 83 | } |
| 84 | |
| 85 | EmitHexArray(data, name, out); |
| 86 | Formatter(out, R"__( |
| 87 | static const NResource::TRegHelper REG_{}("{}", TStringBuf((const char*){}, sizeof({}))); |
| 88 | )__", {name, key, name, name}); |
| 89 | } |
| 90 | |
| 91 | static inline void EmitHeader(IOutputStream& out, bool useSections) { |
| 92 | if (useSections) { |
no test coverage detected