The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
2.5KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE 6 technical preview.
  4. Copyright (c) 2017 - ROLI Ltd.
  5. You may use this code under the terms of the GPL v3
  6. (see www.gnu.org/licenses).
  7. For this technical preview, this file is not subject to commercial licensing.
  8. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  9. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  10. DISCLAIMED.
  11. ==============================================================================
  12. */
  13. #pragma once
  14. #include "../Project/jucer_Project.h"
  15. //==============================================================================
  16. class JucerResourceFile
  17. {
  18. public:
  19. //==============================================================================
  20. explicit JucerResourceFile (Project& project);
  21. ~JucerResourceFile();
  22. //==============================================================================
  23. void setClassName (const String& className) { resourceFile.setClassName (className); }
  24. String getClassName() const { return resourceFile.getClassName(); }
  25. void addFile (const File& file) { resourceFile.addFile (file); }
  26. String getDataVariableFor (const File& file) const { return resourceFile.getDataVariableFor (file); }
  27. String getSizeVariableFor (const File& file) const { return resourceFile.getSizeVariableFor (file); }
  28. int getNumFiles() const { return resourceFile.getNumFiles(); }
  29. const File& getFile (int index) const { return resourceFile.getFile (index); }
  30. int64 getTotalDataSize() const { return resourceFile.getTotalDataSize(); }
  31. build_tools::ResourceFile::WriteResult write (int maxFileSize)
  32. {
  33. return resourceFile.write (maxFileSize,
  34. project.getProjectLineFeed(),
  35. project.getBinaryDataHeaderFile(),
  36. [this] (int index) { return project.getBinaryDataCppFile (index); });
  37. }
  38. //==============================================================================
  39. private:
  40. void addResourcesFromProjectItem (const Project::Item& node);
  41. Project& project;
  42. build_tools::ResourceFile resourceFile;
  43. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (JucerResourceFile)
  44. };