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.

87 lines
3.0KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2022 - Raw Material Software Limited
  5. JUCE is an open source library subject to commercial or open-source
  6. licensing.
  7. By using JUCE, you agree to the terms of both the JUCE 7 End-User License
  8. Agreement and JUCE Privacy Policy.
  9. End User License Agreement: www.juce.com/juce-7-licence
  10. Privacy Policy: www.juce.com/juce-privacy-policy
  11. Or: You may also use this code under the terms of the GPL v3 (see
  12. www.gnu.org/licenses).
  13. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  14. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  15. DISCLAIMED.
  16. ==============================================================================
  17. */
  18. namespace juce
  19. {
  20. namespace build_tools
  21. {
  22. void overwriteFileIfDifferentOrThrow (const File& file, const MemoryOutputStream& newData);
  23. void overwriteFileIfDifferentOrThrow (const File& file, const String& newData);
  24. class SaveError
  25. {
  26. public:
  27. SaveError (const String& error) : message (error)
  28. {}
  29. SaveError (const File& fileThatFailedToWrite)
  30. : message ("Can't write to the file: " + fileThatFailedToWrite.getFullPathName())
  31. {}
  32. String message;
  33. };
  34. String replacePreprocessorDefs (const StringPairArray& definitions, String sourceString);
  35. String getXcodePackageType (ProjectType::Target::Type);
  36. String getXcodeBundleSignature (ProjectType::Target::Type);
  37. inline String hexString8Digits (int value)
  38. {
  39. return String::toHexString (value).paddedLeft ('0', 8);
  40. }
  41. String makeValidIdentifier (String s,
  42. bool makeCamelCase,
  43. bool removeColons,
  44. bool allowTemplates,
  45. bool allowAsterisks = false);
  46. String makeBinaryDataIdentifierName (const File& file);
  47. void writeDataAsCppLiteral (const MemoryBlock& mb,
  48. OutputStream& out,
  49. bool breakAtNewLines,
  50. bool allowStringBreaks);
  51. void createStringMatcher (OutputStream& out,
  52. const String& utf8PointerVariable,
  53. const StringArray& strings,
  54. const StringArray& codeToExecute,
  55. const int indentLevel);
  56. String unixStylePath (const String& path);
  57. String windowsStylePath (const String& path);
  58. String currentOSStylePath (const String& path);
  59. bool isAbsolutePath (const String& path);
  60. // A windows-aware version of File::getRelativePath()
  61. String getRelativePathFrom (const File& file, const File& sourceFolder);
  62. void writeStreamToFile (const File& file, const std::function<void (MemoryOutputStream&)>& writer);
  63. }
  64. }