1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-18 00:54:19 +00:00

Resave all projects

This commit is contained in:
attila 2023-02-16 17:37:20 +01:00 committed by Attila Szarvas
parent 31f94c2e28
commit 85e11b6409
39 changed files with 392 additions and 3 deletions

View file

@ -8513,6 +8513,271 @@ static const unsigned char temp_binary_data_65[] =
const char* juce_runtime_arch_detection_cpp = (const char*) temp_binary_data_65;
//================== juce_LinuxSubprocessHelper.cpp ==================
static const unsigned char temp_binary_data_66[] =
"/*\r\n"
" ==============================================================================\r\n"
"\r\n"
" This file is part of the JUCE library.\r\n"
" Copyright (c) 2022 - Raw Material Software Limited\r\n"
"\r\n"
" JUCE is an open source library subject to commercial or open-source\r\n"
" licensing.\r\n"
"\r\n"
" By using JUCE, you agree to the terms of both the JUCE 7 End-User License\r\n"
" Agreement and JUCE Privacy Policy.\r\n"
"\r\n"
" End User License Agreement: www.juce.com/juce-7-licence\r\n"
" Privacy Policy: www.juce.com/juce-privacy-policy\r\n"
"\r\n"
" Or: You may also use this code under the terms of the GPL v3 (see\r\n"
" www.gnu.org/licenses).\r\n"
"\r\n"
" JUCE IS PROVIDED \"AS IS\" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER\r\n"
" EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE\r\n"
" DISCLAIMED.\r\n"
"\r\n"
" ==============================================================================\r\n"
"*/\r\n"
"\r\n"
"#include <dlfcn.h>\r\n"
"\r\n"
"int main (int argc, const char** argv)\r\n"
"{\r\n"
" if (argc >= 3)\r\n"
" if (auto* handle = dlopen (argv[1], RTLD_LAZY))\r\n"
" if (auto* function = reinterpret_cast<int (*) (int, const char**)> (dlsym (handle, argv[2])))\r\n"
" return function (argc - 3, argv + 3);\r\n"
"\r\n"
" return 1;\r\n"
"}\r\n";
const char* juce_LinuxSubprocessHelper_cpp = (const char*) temp_binary_data_66;
//================== juce_SimpleBinaryBuilder.cpp ==================
static const unsigned char temp_binary_data_67[] =
"/*\r\n"
" ==============================================================================\r\n"
"\r\n"
" This file is part of the JUCE library.\r\n"
" Copyright (c) 2022 - Raw Material Software Limited\r\n"
"\r\n"
" JUCE is an open source library subject to commercial or open-source\r\n"
" licensing.\r\n"
"\r\n"
" By using JUCE, you agree to the terms of both the JUCE 7 End-User License\r\n"
" Agreement and JUCE Privacy Policy.\r\n"
"\r\n"
" End User License Agreement: www.juce.com/juce-7-licence\r\n"
" Privacy Policy: www.juce.com/juce-privacy-policy\r\n"
"\r\n"
" Or: You may also use this code under the terms of the GPL v3 (see\r\n"
" www.gnu.org/licenses).\r\n"
"\r\n"
" JUCE IS PROVIDED \"AS IS\" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER\r\n"
" EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE\r\n"
" DISCLAIMED.\r\n"
"\r\n"
" ==============================================================================\r\n"
"*/\r\n"
"\r\n"
"#include <algorithm>\r\n"
"#include <cstdint>\r\n"
"#include <filesystem>\r\n"
"#include <fstream>\r\n"
"#include <iostream>\r\n"
"#include <vector>\r\n"
"\r\n"
"namespace fs = std::filesystem;\r\n"
"\r\n"
"//==============================================================================\r\n"
"namespace StringHelpers\r\n"
"{\r\n"
"\r\n"
"static bool isQuoteCharacter (char c)\r\n"
"{\r\n"
" return c == '\"' || c == '\\'';\r\n"
"}\r\n"
"\r\n"
"static std::string unquoted (const std::string& str)\r\n"
"{\r\n"
" if (str.length() == 0 || (! isQuoteCharacter (str[0])))\r\n"
" return str;\r\n"
"\r\n"
" return str.substr (1, str.length() - (isQuoteCharacter (str[str.length() - 1]) ? 1 : 0));\r\n"
"}\r\n"
"\r\n"
"static void ltrim (std::string& s)\r\n"
"{\r\n"
" s.erase (s.begin(), std::find_if (s.begin(), s.end(), [] (int c) { return ! std::isspace (c); }));\r\n"
"}\r\n"
"\r\n"
"static void rtrim (std::string& s)\r\n"
"{\r\n"
" s.erase (std::find_if (s.rbegin(), s.rend(), [] (int c) { return ! std::isspace (c); }).base(), s.end());\r\n"
"}\r\n"
"\r\n"
"static std::string trimmed (const std::string& str)\r\n"
"{\r\n"
" auto result = str;\r\n"
" ltrim (result);\r\n"
" rtrim (result);\r\n"
" return result;\r\n"
"}\r\n"
"\r\n"
"static std::string replaced (const std::string& str, char charToReplace, char replaceWith)\r\n"
"{\r\n"
" auto result = str;\r\n"
" std::replace( result.begin(), result.end(), charToReplace, replaceWith);\r\n"
" return result;\r\n"
"}\r\n"
"\r\n"
"}\r\n"
"\r\n"
"//==============================================================================\r\n"
"static bool addFile (const fs::path& filePath,\r\n"
" const std::string& binaryNamespace,\r\n"
" std::ofstream& headerStream,\r\n"
" std::ofstream& cppStream)\r\n"
"{\r\n"
" std::ifstream fileStream (filePath, std::ios::in | std::ios::binary | std::ios::ate);\r\n"
"\r\n"
" if (! fileStream.is_open())\r\n"
" {\r\n"
" std::cerr << \"Failed to open input file \" << filePath << std::endl;\r\n"
" return false;\r\n"
" }\r\n"
"\r\n"
" std::vector<char> buffer ((size_t) fileStream.tellg());\r\n"
" fileStream.seekg (0);\r\n"
" fileStream.read (buffer.data(), static_cast<std::streamsize> (buffer.size()));\r\n"
"\r\n"
" const auto variableName = StringHelpers::replaced (StringHelpers::replaced (filePath.filename().string(),\r\n"
" ' ',\r\n"
" '_'),\r\n"
" '.',\r\n"
" '_');\r\n"
"\r\n"
" std::cout << \"Adding \" << variableName << \": \"\r\n"
" << buffer.size() << \" bytes\" << std::endl;\r\n"
"\r\n"
" headerStream << \" extern const char* \" << variableName << \";\\r\\n\"\r\n"
" \" const int \" << variableName << \"Size = \"\r\n"
" << buffer.size() << \";\" << std::endl;\r\n"
"\r\n"
" cppStream << \"static const unsigned char temp0[] = {\";\r\n"
"\r\n"
" auto* data = (const uint8_t*) buffer.data();\r\n"
"\r\n"
" for (size_t i = 0; i < buffer.size() - 1; ++i)\r\n"
" {\r\n"
" if ((i % 40) != 39)\r\n"
" cppStream << (int) data[i] << \",\";\r\n"
" else\r\n"
" cppStream << (int) data[i] << \",\" << std::endl << \" \";\r\n"
" }\r\n"
"\r\n"
" cppStream << (int) data[buffer.size() - 1] << \",0,0};\" << std::endl;\r\n"
" cppStream << \"const char* \" << binaryNamespace << \"::\" << variableName\r\n"
" << \" = (const char*) temp0\" << \";\" << std::endl << std::endl;\r\n"
"\r\n"
" return true;\r\n"
"}\r\n"
"\r\n"
"//==============================================================================\r\n"
"int main (int argc, char* argv[])\r\n"
"{\r\n"
" if (argc != 5)\r\n"
" {\r\n"
" std::cout << \" Usage: SimpleBinaryBuilder sourcefile targetdirectory targetfilename namespace\\n\\n\"\r\n"
" \" SimpleBinaryBuilder will encode the provided source file into\\n\"\r\n"
" \" two files called (targetfilename).cpp and (targetfilename).h,\\n\"\r\n"
" \" which it will write into the specified target directory.\\n\"\r\n"
" \" The target directory will be automatically created if necessary. The binary\"\r\n"
" \" resource will be available in the given namespace.\\n\\n\";\r\n"
"\r\n"
" return 0;\r\n"
" }\r\n"
"\r\n"
" const auto sourceFile = fs::current_path() / StringHelpers::unquoted (std::string (argv[1]));\r\n"
"\r\n"
" if (! fs::exists (sourceFile))\r\n"
" {\r\n"
" std::cerr << \"Source file doesn't exist: \"\r\n"
" << sourceFile\r\n"
" << std::endl << std::endl;\r\n"
"\r\n"
" return 1;\r\n"
" }\r\n"
"\r\n"
" const auto targetDirectory = fs::current_path() / StringHelpers::unquoted (std::string (argv[2]));\r\n"
"\r\n"
" if (! fs::exists (targetDirectory))\r\n"
" {\r\n"
" try\r\n"
" {\r\n"
" fs::create_directories (targetDirectory);\r\n"
" }\r\n"
" catch (const fs::filesystem_error&)\r\n"
" {\r\n"
" std::cerr << \"Failed to create target directory: \"\r\n"
" << targetDirectory\r\n"
" << std::endl << std::endl;\r\n"
"\r\n"
" return 1;\r\n"
" }\r\n"
" }\r\n"
"\r\n"
" const auto className = StringHelpers::trimmed (argv[3]);\r\n"
" const auto binaryNamespace = StringHelpers::trimmed (argv[4]);\r\n"
"\r\n"
" const auto headerFilePath = targetDirectory / (className + \".h\");\r\n"
" const auto cppFilePath = targetDirectory / (className + \".cpp\");\r\n"
"\r\n"
" std::cout << \"Creating \" << headerFilePath\r\n"
" << \" and \" << cppFilePath\r\n"
" << \" from file \" << sourceFile\r\n"
" << \"...\" << std::endl << std::endl;\r\n"
"\r\n"
" fs::remove (headerFilePath);\r\n"
" fs::remove (cppFilePath);\r\n"
"\r\n"
" std::ofstream header (headerFilePath);\r\n"
"\r\n"
" if (! header.is_open())\r\n"
" {\r\n"
" std::cerr << \"Failed to open \" << headerFilePath << std::endl;\r\n"
"\r\n"
" return 1;\r\n"
" }\r\n"
"\r\n"
" std::ofstream cpp (cppFilePath);\r\n"
"\r\n"
" if (! cpp.is_open())\r\n"
" {\r\n"
" std::cerr << \"Failed to open \" << headerFilePath << std::endl;\r\n"
"\r\n"
" return 1;\r\n"
" }\r\n"
"\r\n"
" header << \"/* (Auto-generated binary data file). */\" << std::endl << std::endl\r\n"
" << \"#pragma once\" << std::endl << std::endl\r\n"
" << \"namespace \" << binaryNamespace << std::endl\r\n"
" << \"{\" << std::endl;\r\n"
"\r\n"
" cpp << \"/* (Auto-generated binary data file). */\" << std::endl << std::endl\r\n"
" << \"#include \" << std::quoted (className + \".h\") << std::endl << std::endl;\r\n"
"\r\n"
" if (! addFile (sourceFile, binaryNamespace, header, cpp))\r\n"
" return 1;\r\n"
"\r\n"
" header << \"}\" << std::endl << std::endl;\r\n"
"\r\n"
" return 0;\r\n"
"}\r\n";
const char* juce_SimpleBinaryBuilder_cpp = (const char*) temp_binary_data_67;
const char* getNamedResource (const char* resourceNameUTF8, int& numBytes);
const char* getNamedResource (const char* resourceNameUTF8, int& numBytes)
@ -8591,6 +8856,8 @@ const char* getNamedResource (const char* resourceNameUTF8, int& numBytes)
case 0x763d39dc: numBytes = 1050; return colourscheme_dark_xml;
case 0xe8b08520: numBytes = 1050; return colourscheme_light_xml;
case 0x7c03d519: numBytes = 3005; return juce_runtime_arch_detection_cpp;
case 0x295b6f43: numBytes = 1200; return juce_LinuxSubprocessHelper_cpp;
case 0xef269d3a: numBytes = 7162; return juce_SimpleBinaryBuilder_cpp;
default: break;
}
@ -8665,7 +8932,9 @@ const char* namedResourceList[] =
"jucer_PIPTemplate_h",
"colourscheme_dark_xml",
"colourscheme_light_xml",
"juce_runtime_arch_detection_cpp"
"juce_runtime_arch_detection_cpp",
"juce_LinuxSubprocessHelper_cpp",
"juce_SimpleBinaryBuilder_cpp"
};
const char* originalFilenames[] =
@ -8735,7 +9004,9 @@ const char* originalFilenames[] =
"jucer_PIPTemplate.h",
"colourscheme_dark.xml",
"colourscheme_light.xml",
"juce_runtime_arch_detection.cpp"
"juce_runtime_arch_detection.cpp",
"juce_LinuxSubprocessHelper.cpp",
"juce_SimpleBinaryBuilder.cpp"
};
const char* getNamedResourceOriginalFilename (const char* resourceNameUTF8);