1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Introjucer: extended the binary data format to include a list of the filenames of all the resources.

This commit is contained in:
jules 2013-09-30 15:39:00 +01:00
parent b9198f4f88
commit 342684a4c2
5 changed files with 69 additions and 2 deletions

View file

@ -1244,4 +1244,32 @@ const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) throw
return 0;
}
const int namedResourceListSize = 22;
const char* namedResourceList[] =
{
"AudioPluginXCodeScript_txt",
"background_tile_png",
"colourscheme_dark_xml",
"colourscheme_light_xml",
"jucer_AudioPluginEditorTemplate_cpp",
"jucer_AudioPluginEditorTemplate_h",
"jucer_AudioPluginFilterTemplate_cpp",
"jucer_AudioPluginFilterTemplate_h",
"jucer_ComponentTemplate_cpp",
"jucer_ComponentTemplate_h",
"jucer_ContentCompTemplate_cpp",
"jucer_ContentCompTemplate_h",
"jucer_InlineComponentTemplate_h",
"jucer_MainConsoleAppTemplate_cpp",
"jucer_MainTemplate_NoWindow_cpp",
"jucer_MainTemplate_Window_cpp",
"jucer_NewComponentTemplate_cpp",
"jucer_NewComponentTemplate_h",
"jucer_NewCppFileTemplate_cpp",
"jucer_NewCppFileTemplate_h",
"jucer_NewInlineComponentTemplate_h",
"RecentFilesMenuTemplate_nib"
};
}

View file

@ -72,6 +72,12 @@ namespace BinaryData
extern const char* RecentFilesMenuTemplate_nib;
const int RecentFilesMenuTemplate_nibSize = 2842;
// Points to the start of a list of resource names.
extern const char* namedResourceList[];
// Number of elements in the namedResourceList array.
extern const int namedResourceListSize;
// If you provide the name of one of the binary resource variables above, this function will
// return the corresponding data and its size (or a null pointer if the name isn't found).
const char* getNamedResource (const char* resourceNameUTF8, int& dataSizeInBytes) throw();

View file

@ -154,7 +154,13 @@ bool ResourceFile::writeHeader (MemoryOutputStream& header)
}
}
header << " // If you provide the name of one of the binary resource variables above, this function will" << newLine
header << " // Points to the start of a list of resource names." << newLine
<< " extern const char* namedResourceList[];" << newLine
<< newLine
<< " // Number of elements in the namedResourceList array." << newLine
<< " extern const int namedResourceListSize;" << newLine
<< newLine
<< " // If you provide the name of one of the binary resource variables above, this function will" << newLine
<< " // return the corresponding data and its size (or a null pointer if the name isn't found)." << newLine
<< " const char* getNamedResource (const char* resourceNameUTF8, int& dataSizeInBytes) throw();" << newLine
<< "}" << newLine;
@ -237,7 +243,17 @@ bool ResourceFile::writeCpp (MemoryOutputStream& cpp, const File& headerFile, in
cpp << " numBytes = 0;" << newLine
<< " return 0;" << newLine
<< "}" << newLine;
<< "}" << newLine
<< newLine
<< "const int namedResourceListSize = " << files.size() << ";" << newLine
<< newLine
<< "const char* namedResourceList[] =" << newLine
<< "{" << newLine;
for (int j = 0; j < files.size(); ++j)
cpp << " " << variableNames[j].quoted() << (j < files.size() - 1 ? "," : "") << newLine;
cpp << "};" << newLine;
}
cpp << newLine

View file

@ -2163,4 +2163,15 @@ const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) throw
return 0;
}
const int namedResourceListSize = 5;
const char* namedResourceList[] =
{
"cello_wav",
"demo_table_data_xml",
"icons_zip",
"juce_png",
"treedemo_xml"
};
}

View file

@ -21,6 +21,12 @@ namespace BinaryData
extern const char* treedemo_xml;
const int treedemo_xmlSize = 1126;
// Points to the start of a list of resource names.
extern const char* namedResourceList[];
// Number of elements in the namedResourceList array.
extern const int namedResourceListSize;
// If you provide the name of one of the binary resource variables above, this function will
// return the corresponding data and its size (or a null pointer if the name isn't found).
const char* getNamedResource (const char* resourceNameUTF8, int& dataSizeInBytes) throw();