MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / getDefaultResources

Method getDefaultResources

Source/Native/CtrlrWindows.cpp:160–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158}
159
160const Result CtrlrWindows::getDefaultResources(MemoryBlock& dataToWrite)
161{
162#ifdef DEBUG_INSTANCE
163 File temp("c:\\devel\\debug_small.bpanelz");
164
165 MemoryBlock data;
166 {
167 ScopedPointer <FileInputStream> fis (temp.createInputStream());
168 fis->readIntoMemoryBlock (data);
169 }
170
171 ValueTree t = ValueTree::readFromGZIPData(data.getData(), data.getSize());
172
173 if (t.isValid())
174 {
175 ValueTree r = t.getChildWithName (Ids::resourceExportList);
176 if (r.isValid())
177 {
178 MemoryOutputStream mos (dataToWrite, false);
179 {
180 GZIPCompressorOutputStream gzipOutputStream (&mos);
181 r.writeToStream(gzipOutputStream);
182 gzipOutputStream.flush();
183 }
184 return (Result::ok());
185 }
186 }
187 else
188 {
189 return (Result::fail("Windows Native: getDefaultResources got data but couldn't parse it as a compressed ValueTree"));
190 }
191#endif
192
193 return (readResource (nullptr, MAKEINTRESOURCE(CTRLR_INTERNAL_RESOURCES_RESID), RT_RCDATA, dataToWrite));
194}
195
196const Result CtrlrWindows::getSignature(MemoryBlock &dataToWrite)
197{

Callers

nothing calls this directly

Calls 7

readIntoMemoryBlockMethod · 0.80
createInputStreamMethod · 0.45
getDataMethod · 0.45
getSizeMethod · 0.45
isValidMethod · 0.45
writeToStreamMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected