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.

80 lines
2.8KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE 6 technical preview.
  4. Copyright (c) 2020 - Raw Material Software Limited
  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. namespace juce
  14. {
  15. namespace build_tools
  16. {
  17. void overwriteFileIfDifferentOrThrow (const File& file, const MemoryOutputStream& newData);
  18. void overwriteFileIfDifferentOrThrow (const File& file, const String& newData);
  19. class SaveError
  20. {
  21. public:
  22. SaveError (const String& error) : message (error)
  23. {}
  24. SaveError (const File& fileThatFailedToWrite)
  25. : message ("Can't write to the file: " + fileThatFailedToWrite.getFullPathName())
  26. {}
  27. String message;
  28. };
  29. String replacePreprocessorDefs (const StringPairArray& definitions, String sourceString);
  30. String getXcodePackageType (ProjectType::Target::Type);
  31. String getXcodeBundleSignature (ProjectType::Target::Type);
  32. inline String hexString8Digits (int value)
  33. {
  34. return String::toHexString (value).paddedLeft ('0', 8);
  35. }
  36. String makeValidIdentifier (String s,
  37. bool capitalise,
  38. bool removeColons,
  39. bool allowTemplates,
  40. bool allowAsterisks = false);
  41. String makeBinaryDataIdentifierName (const File& file);
  42. void writeDataAsCppLiteral (const MemoryBlock& mb,
  43. OutputStream& out,
  44. bool breakAtNewLines,
  45. bool allowStringBreaks);
  46. void createStringMatcher (OutputStream& out,
  47. const String& utf8PointerVariable,
  48. const StringArray& strings,
  49. const StringArray& codeToExecute,
  50. const int indentLevel);
  51. String unixStylePath (const String& path);
  52. String windowsStylePath (const String& path);
  53. String currentOSStylePath (const String& path);
  54. bool isAbsolutePath (const String& path);
  55. // A windows-aware version of File::getRelativePath()
  56. String getRelativePathFrom (const File& file, const File& sourceFolder);
  57. void writeStreamToFile (const File& file, const std::function<void (MemoryOutputStream&)>& writer);
  58. }
  59. }