From 4ab4e8063d043f1599ff11f93e60c3fc1ed8c335 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 28 Apr 2024 01:19:40 +0300 Subject: [PATCH] Continue cleanup Signed-off-by: falkTX --- source/backend/plugin/CarlaPluginJack.cpp | 22 +-- source/backend/plugin/CarlaPluginLV2.cpp | 26 +--- source/bridges-plugin/CarlaBridgePlugin.cpp | 14 +- source/modules/sfzero/sfzero/SFZSound.cpp | 6 +- source/modules/water/files/File.cpp | 127 ++++++++---------- source/modules/water/files/File.h | 30 +---- .../modules/water/streams/FileInputSource.cpp | 4 +- source/modules/water/threads/ChildProcess.cpp | 6 +- source/utils/CarlaDssiUtils.cpp | 18 +-- source/utils/CarlaJsfxUtils.hpp | 2 +- 10 files changed, 88 insertions(+), 167 deletions(-) diff --git a/source/backend/plugin/CarlaPluginJack.cpp b/source/backend/plugin/CarlaPluginJack.cpp index 5be129163..02f4dbc70 100644 --- a/source/backend/plugin/CarlaPluginJack.cpp +++ b/source/backend/plugin/CarlaPluginJack.cpp @@ -1,19 +1,5 @@ -/* - * Carla Plugin JACK - * Copyright (C) 2016-2022 Filipe Coelho - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * For a full copy of the GNU General Public License see the doc/GPL.txt file. - */ +// SPDX-FileCopyrightText: 2011-2024 Filipe Coelho +// SPDX-License-Identifier: GPL-2.0-or-later #include "CarlaPluginInternal.hpp" #include "CarlaEngine.hpp" @@ -499,7 +485,7 @@ private: CARLA_SAFE_ASSERT_RETURN(uniqueCodeID != nullptr && uniqueCodeID[0] != '\0', false); CARLA_SAFE_ASSERT_RETURN(appName.isNotEmpty(), false); - String child(pluginName); + CarlaString child(pluginName); child += "."; child += uniqueCodeID; @@ -1886,7 +1872,7 @@ private: char code[6]; code[5] = '\0'; - String child; + CarlaString child; for (;;) { diff --git a/source/backend/plugin/CarlaPluginLV2.cpp b/source/backend/plugin/CarlaPluginLV2.cpp index a13febf2d..6cb5ebcab 100644 --- a/source/backend/plugin/CarlaPluginLV2.cpp +++ b/source/backend/plugin/CarlaPluginLV2.cpp @@ -1,19 +1,5 @@ -/* - * Carla LV2 Plugin - * Copyright (C) 2011-2022 Filipe Coelho - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * For a full copy of the GNU General Public License see the doc/GPL.txt file. - */ +// SPDX-FileCopyrightText: 2011-2024 Filipe Coelho +// SPDX-License-Identifier: GPL-2.0-or-later // testing macros // #define LV2_UIS_ONLY_BRIDGES @@ -5853,7 +5839,7 @@ public: return nullptr; } - water::String basedir(pData->engine->getName()); + CarlaString basedir(pData->engine->getName()); if (temporary) basedir += ".tmp"; @@ -5881,7 +5867,7 @@ public: { // seems like a normal save, let's be nice and put a symlink const water::String abstractFilename(wabsolutePath.getFileName()); - const File targetPath(targetDir.getChildFile(abstractFilename)); + const File targetPath(targetDir.getChildFile(abstractFilename.toRawUTF8())); wabsolutePath.createSymbolicLink(targetPath, true); @@ -5916,7 +5902,7 @@ public: return File(); } - water::String basedir(pData->engine->getName()); + CarlaString basedir(pData->engine->getName()); if (temporary) basedir += ".tmp"; @@ -5930,7 +5916,7 @@ public: if (File::isAbsolutePath(abstractPath)) { File wabstractPath(abstractPath); - targetPath = targetDir.getChildFile(wabstractPath.getFileName()); + targetPath = targetDir.getChildFile(wabstractPath.getFileName().toRawUTF8()); if (symlinkIfNeeded) { diff --git a/source/bridges-plugin/CarlaBridgePlugin.cpp b/source/bridges-plugin/CarlaBridgePlugin.cpp index 028c15811..31339fcca 100644 --- a/source/bridges-plugin/CarlaBridgePlugin.cpp +++ b/source/bridges-plugin/CarlaBridgePlugin.cpp @@ -111,8 +111,8 @@ static void initSignalHandler() // ------------------------------------------------------------------------- -static String gProjectFilename; static CarlaHostHandle gHostHandle; +static CarlaString gProjectFilename; static void gIdle() { @@ -124,7 +124,7 @@ static void gIdle() if (gProjectFilename.isNotEmpty()) { - if (! carla_save_plugin_state(gHostHandle, 0, gProjectFilename.toRawUTF8())) + if (! carla_save_plugin_state(gHostHandle, 0, gProjectFilename)) carla_stderr("Plugin preset save failed, error was:\n%s", carla_get_last_error(gHostHandle)); } } @@ -195,15 +195,15 @@ public: const CarlaPluginInfo* const pInfo = carla_get_plugin_info(gHostHandle, 0); CARLA_SAFE_ASSERT_RETURN(pInfo != nullptr,); - gProjectFilename = CharPointer_UTF8(pInfo->name); + gProjectFilename = pInfo->name; gProjectFilename += ".carxs"; if (! File::isAbsolutePath(gProjectFilename)) - gProjectFilename = File::getCurrentWorkingDirectory().getChildFile(gProjectFilename).getFullPathName(); + gProjectFilename = File::getCurrentWorkingDirectory().getChildFile(gProjectFilename).getFullPathName().toRawUTF8(); - if (File(gProjectFilename.toRawUTF8()).existsAsFile()) + if (File(gProjectFilename).existsAsFile()) { - if (carla_load_plugin_state(gHostHandle, 0, gProjectFilename.toRawUTF8())) + if (carla_load_plugin_state(gHostHandle, 0, gProjectFilename)) carla_stdout("Plugin state loaded successfully"); else carla_stderr("Plugin state load failed, error was:\n%s", carla_get_last_error(gHostHandle)); @@ -211,7 +211,7 @@ public: else { carla_stdout("Previous plugin state in '%s' is non-existent, will start from default state", - gProjectFilename.toRawUTF8()); + gProjectFilename.buffer()); } } diff --git a/source/modules/sfzero/sfzero/SFZSound.cpp b/source/modules/sfzero/sfzero/SFZSound.cpp index 930ba12ac..4494d1078 100644 --- a/source/modules/sfzero/sfzero/SFZSound.cpp +++ b/source/modules/sfzero/sfzero/SFZSound.cpp @@ -45,12 +45,12 @@ Sample *Sound::addSample(water::String path, water::String defaultPath) water::File sampleFile; if (defaultPath.isEmpty()) { - sampleFile = file_.getSiblingFile(path); + sampleFile = file_.getSiblingFile(path.toRawUTF8()); } else { - water::File defaultDir = file_.getSiblingFile(defaultPath); - sampleFile = defaultDir.getChildFile(path); + water::File defaultDir = file_.getSiblingFile(defaultPath.toRawUTF8()); + sampleFile = defaultDir.getChildFile(path.toRawUTF8()); } water::String samplePath = sampleFile.getFullPathName(); Sample *sample = samples_[samplePath]; diff --git a/source/modules/water/files/File.cpp b/source/modules/water/files/File.cpp index 6c900d9c0..3e15e1de1 100644 --- a/source/modules/water/files/File.cpp +++ b/source/modules/water/files/File.cpp @@ -108,7 +108,7 @@ static String removeEllipsis (const String& path) #endif { StringArray toks; - toks.addTokens (path, File::separatorString, StringRef()); + toks.addTokens (path, CARLA_OS_SEP_STR, StringRef()); bool anythingChanged = false; for (int i = 1; i < toks.size(); ++i) @@ -129,7 +129,7 @@ static String removeEllipsis (const String& path) } if (anythingChanged) - return toks.joinIntoString (File::separatorString); + return toks.joinIntoString (CARLA_OS_SEP_STR); } return path; @@ -144,9 +144,9 @@ String File::parseAbsolutePath (const String& p) // Windows.. String path (removeEllipsis (p.replaceCharacter ('/', '\\'))); - if (path.startsWithChar (separator)) + if (path.startsWithChar (CARLA_OS_SEP)) { - if (path[1] != separator) + if (path[1] != CARLA_OS_SEP) { // Check if path is valid under Wine String testpath ("Z:" + path); @@ -195,7 +195,7 @@ String File::parseAbsolutePath (const String& p) if (path.startsWithChar ('~')) { - if (path[1] == separator || path[1] == 0) + if (path[1] == CARLA_OS_SEP || path[1] == 0) { // expand a name of the form "~/abc" path = File::getSpecialLocation (File::userHomeDirectory).getFullPathName() @@ -210,13 +210,13 @@ String File::parseAbsolutePath (const String& p) path = addTrailingSeparator (pw->pw_dir) + path.fromFirstOccurrenceOf ("/", false, false); } } - else if (! path.startsWithChar (separator)) + else if (! path.startsWithChar (CARLA_OS_SEP)) { - return File::getCurrentWorkingDirectory().getChildFile (path).getFullPathName(); + return File::getCurrentWorkingDirectory().getChildFile (path.toRawUTF8()).getFullPathName(); } #endif - while (path.endsWithChar (separator) && path != separatorString) // careful not to turn a single "/" into an empty string. + while (path.endsWithChar (CARLA_OS_SEP) && path != CARLA_OS_SEP_STR) // careful not to turn a single "/" into an empty string. path = path.dropLastCharacters (1); return path; @@ -224,8 +224,8 @@ String File::parseAbsolutePath (const String& p) String File::addTrailingSeparator (const String& path) { - return path.endsWithChar (separator) ? path - : path + separator; + return path.endsWithChar (CARLA_OS_SEP) ? path + : path + CARLA_OS_SEP; } //============================================================================== @@ -321,7 +321,7 @@ bool File::copyDirectoryTo (const File& newDirectory) const for (size_t i = 0; i < subFiles.size(); ++i) { const File& src (subFiles[i]); - const File& dst (newDirectory.getChildFile (src.getFileName())); + const File& dst (newDirectory.getChildFile (src.getFileName().toRawUTF8())); if (src.isSymbolicLink()) { @@ -339,7 +339,7 @@ bool File::copyDirectoryTo (const File& newDirectory) const findChildFiles (subFiles, File::findDirectories, false); for (size_t i = 0; i < subFiles.size(); ++i) - if (! subFiles[i].copyDirectoryTo (newDirectory.getChildFile (subFiles[i].getFileName()))) + if (! subFiles[i].copyDirectoryTo (newDirectory.getChildFile (subFiles[i].getFileName().toRawUTF8()))) return false; return true; @@ -351,13 +351,13 @@ bool File::copyDirectoryTo (const File& newDirectory) const //============================================================================== String File::getPathUpToLastSlash() const { - const int lastSlash = fullPath.lastIndexOfChar (separator); + const int lastSlash = fullPath.lastIndexOfChar (CARLA_OS_SEP); if (lastSlash > 0) return fullPath.substring (0, lastSlash); if (lastSlash == 0) - return separatorString; + return CARLA_OS_SEP_STR; return fullPath; } @@ -372,12 +372,12 @@ File File::getParentDirectory() const //============================================================================== String File::getFileName() const { - return fullPath.substring (fullPath.lastIndexOfChar (separator) + 1); + return fullPath.substring (fullPath.lastIndexOfChar (CARLA_OS_SEP) + 1); } String File::getFileNameWithoutExtension() const { - const int lastSlash = fullPath.lastIndexOfChar (separator) + 1; + const int lastSlash = fullPath.lastIndexOfChar (CARLA_OS_SEP) + 1; const int lastDot = fullPath.lastIndexOfChar ('.'); if (lastDot > lastSlash) @@ -403,24 +403,24 @@ bool File::isAChildOf (const File& potentialParent) const } //============================================================================== -bool File::isAbsolutePath (StringRef path) +bool File::isAbsolutePath (const char* const path) { - const water_uchar firstChar = *(path.text); + const char firstChar = *path; - return firstChar == separator + return firstChar == CARLA_OS_SEP #ifdef CARLA_OS_WIN - || (firstChar != 0 && path.text[1] == ':'); + || (firstChar != '\0' && path[1] == ':'); #else || firstChar == '~'; #endif } -File File::getChildFile (StringRef relativePath) const +File File::getChildFile (const char* const relativePath) const { - CharPointer_UTF8 r = relativePath.text; + if (isAbsolutePath (relativePath)) + return File (relativePath); - if (isAbsolutePath (r)) - return File (r); + CharPointer_UTF8 r(relativePath); #ifdef CARLA_OS_WIN if (r.indexOf ((water_uchar) '/') >= 0) @@ -438,13 +438,13 @@ File File::getChildFile (StringRef relativePath) const { const water_uchar thirdChar = *++r; - if (thirdChar == separator || thirdChar == 0) + if (thirdChar == CARLA_OS_SEP || thirdChar == 0) { - const int lastSlash = path.lastIndexOfChar (separator); + const int lastSlash = path.lastIndexOfChar (CARLA_OS_SEP); if (lastSlash >= 0) path = path.substring (0, lastSlash); - while (*r == separator) // ignore duplicate slashes + while (*r == CARLA_OS_SEP) // ignore duplicate slashes ++r; } else @@ -453,9 +453,9 @@ File File::getChildFile (StringRef relativePath) const break; } } - else if (secondChar == separator || secondChar == 0) // remove "./" + else if (secondChar == CARLA_OS_SEP || secondChar == 0) // remove "./" { - while (*r == separator) // ignore duplicate slashes + while (*r == CARLA_OS_SEP) // ignore duplicate slashes ++r; } else @@ -470,26 +470,11 @@ File File::getChildFile (StringRef relativePath) const return File (path.toRawUTF8()); } -File File::getSiblingFile (StringRef fileName) const +File File::getSiblingFile (const char* const fileName) const { return getParentDirectory().getChildFile (fileName); } -//============================================================================== -String File::descriptionOfSizeInBytes (const int64 bytes) -{ - const char* suffix; - double divisor = 0; - - if (bytes == 1) { suffix = " byte"; } - else if (bytes < 1024) { suffix = " bytes"; } - else if (bytes < 1024 * 1024) { suffix = " KB"; divisor = 1024.0; } - else if (bytes < 1024 * 1024 * 1024) { suffix = " MB"; divisor = 1024.0 * 1024.0; } - else { suffix = " GB"; divisor = 1024.0 * 1024.0 * 1024.0; } - - return (divisor > 0 ? String (bytes / divisor, 1) : String (bytes)) + suffix; -} - //============================================================================== Result File::create() const { @@ -525,7 +510,7 @@ Result File::createDirectory() const Result r (parentDir.createDirectory()); if (r.wasOk()) - r = createDirectoryInternal (fullPath.trimCharactersAtEnd (separatorString)); + r = createDirectoryInternal (fullPath.trimCharactersAtEnd (CARLA_OS_SEP_STR)); return r; } @@ -613,7 +598,7 @@ File File::getNonexistentChildFile (const String& suggestedPrefix, const String& suffix, bool putNumbersInBrackets) const { - File f (getChildFile (suggestedPrefix + suffix)); + File f (getChildFile (String(suggestedPrefix + suffix).toRawUTF8())); if (f.exists()) { @@ -653,7 +638,7 @@ File File::getNonexistentChildFile (const String& suggestedPrefix, newName << ++number; } - f = getChildFile (newName + suffix); + f = getChildFile (String(newName + suffix).toRawUTF8()); } while (f.exists()); } @@ -676,26 +661,28 @@ String File::getFileExtension() const { const int indexOfDot = fullPath.lastIndexOfChar ('.'); - if (indexOfDot > fullPath.lastIndexOfChar (separator)) + if (indexOfDot > fullPath.lastIndexOfChar (CARLA_OS_SEP)) return fullPath.substring (indexOfDot); return String(); } -bool File::hasFileExtension (StringRef possibleSuffix) const +bool File::hasFileExtension (const char* const possibleSuffix_) const { + const CharPointer_UTF8 possibleSuffix(possibleSuffix_); + if (possibleSuffix.isEmpty()) - return fullPath.lastIndexOfChar ('.') <= fullPath.lastIndexOfChar (separator); + return fullPath.lastIndexOfChar ('.') <= fullPath.lastIndexOfChar (CARLA_OS_SEP); - const int semicolon = possibleSuffix.text.indexOf ((water_uchar) ';'); + const int semicolon = possibleSuffix.indexOf ((water_uchar) ';'); if (semicolon >= 0) - return hasFileExtension (String (possibleSuffix.text).substring (0, semicolon).trimEnd()) - || hasFileExtension ((possibleSuffix.text + (semicolon + 1)).findEndOfWhitespace()); + return hasFileExtension (String (possibleSuffix).substring (0, semicolon).trimEnd().toRawUTF8()) + || hasFileExtension ((possibleSuffix + (semicolon + 1)).findEndOfWhitespace()); if (fullPath.endsWithIgnoreCase (possibleSuffix)) { - if (possibleSuffix.text[0] == '.') + if (possibleSuffix[0] == '.') return true; const int dotPos = fullPath.length() - possibleSuffix.length() - 1; @@ -707,21 +694,21 @@ bool File::hasFileExtension (StringRef possibleSuffix) const return false; } -File File::withFileExtension (StringRef newExtension) const +File File::withFileExtension (const char* const newExtension) const { if (fullPath.isEmpty()) return File(); - String filePart (getFileName()); + String filePart (getFileName().toRawUTF8()); const int i = filePart.lastIndexOfChar ('.'); if (i >= 0) filePart = filePart.substring (0, i); - if (newExtension.isNotEmpty() && newExtension.text[0] != '.') + if (newExtension[0] != '\0' && newExtension[0] != '.') filePart << '.'; - return getSiblingFile (filePart + newExtension); + return getSiblingFile (String(filePart + newExtension).toRawUTF8()); } //============================================================================== @@ -877,7 +864,7 @@ static int countNumberOfSeparators (CharPointer_UTF8 s) if (c == 0) break; - if (c == File::separator) + if (c == CARLA_OS_SEP) ++num; } @@ -888,7 +875,7 @@ String File::getRelativePathFrom (const File& dir) const { String thisPath (fullPath); - while (thisPath.endsWithChar (separator)) + while (thisPath.endsWithChar (CARLA_OS_SEP)) thisPath = thisPath.dropLastCharacters (1); String dirPath (addTrailingSeparator (dir.existsAsFile() ? dir.getParentDirectory().getFullPathName() @@ -917,7 +904,7 @@ String File::getRelativePathFrom (const File& dir) const ++i; - if (c1 == separator) + if (c1 == CARLA_OS_SEP) { thisPathAfterCommon = thisPathIter; dirPathAfterCommon = dirPathIter; @@ -927,7 +914,7 @@ String File::getRelativePathFrom (const File& dir) const } // if the only common bit is the root, then just return the full path.. - if (commonBitLength == 0 || (commonBitLength == 1 && thisPath[1] == separator)) + if (commonBitLength == 0 || (commonBitLength == 1 && thisPath[1] == CARLA_OS_SEP)) return fullPath; const int numUpDirectoriesNeeded = countNumberOfSeparators (dirPathAfterCommon); @@ -945,10 +932,10 @@ String File::getRelativePathFrom (const File& dir) const } //============================================================================== -File File::createTempFile (StringRef fileNameEnding) +File File::createTempFile (const char* const fileNameEnding) { const File tempFile (getSpecialLocation (tempDirectory) - .getChildFile ("temp_" + String::toHexString (Random::getSystemRandom().nextInt())) + .getChildFile (String("temp_" + String::toHexString (Random::getSystemRandom().nextInt())).toRawUTF8()) .withFileExtension (fileNameEnding)); if (tempFile.exists()) @@ -1025,9 +1012,6 @@ namespace WindowsFileHelpers } } -const water_uchar File::separator = '\\'; -const String File::separatorString ("\\"); - bool File::isDirectory() const { const DWORD attr = WindowsFileHelpers::getAtts (fullPath); @@ -1295,9 +1279,6 @@ namespace } } -const water_uchar File::separator = '/'; -const String File::separatorString ("/"); - bool File::isDirectory() const { water_statStruct info; @@ -1322,7 +1303,7 @@ bool File::hasWriteAccess() const if (exists()) return access (fullPath.toUTF8(), W_OK) == 0; - if ((! isDirectory()) && fullPath.containsChar (separator)) + if ((! isDirectory()) && fullPath.containsChar (CARLA_OS_SEP)) return getParentDirectory().hasWriteAccess(); return false; @@ -1606,7 +1587,7 @@ File File::getLinkedTarget() const String f (getLinkedFile (getFullPathName())); if (f.isNotEmpty()) - return getSiblingFile (f); + return getSiblingFile (f.toRawUTF8()); return *this; } diff --git a/source/modules/water/files/File.h b/source/modules/water/files/File.h index 282a25b76..9f18889f2 100644 --- a/source/modules/water/files/File.h +++ b/source/modules/water/files/File.h @@ -129,13 +129,6 @@ public: */ int64 getSize() const; - /** Utility function to convert a file size in bytes to a neat string description. - - So for example 100 would return "100 bytes", 2000 would return "2 KB", - 2000000 would produce "2 MB", etc. - */ - static String descriptionOfSizeInBytes (int64 bytes); - //============================================================================== /** Returns the complete, absolute path of this file. @@ -204,7 +197,7 @@ public: @see getFileExtension, withFileExtension, getFileNameWithoutExtension */ - bool hasFileExtension (StringRef extensionToTest) const; + bool hasFileExtension (const char* extensionToTest) const; /** Returns a version of this file with a different file extension. @@ -216,7 +209,7 @@ public: @see getFileName, getFileExtension, hasFileExtension, getFileNameWithoutExtension */ - File withFileExtension (StringRef newExtension) const; + File withFileExtension (const char* newExtension) const; /** Returns the last part of the filename, without its file extension. @@ -241,7 +234,7 @@ public: @see getSiblingFile, getParentDirectory, getRelativePathFrom, isAChildOf */ - File getChildFile (StringRef relativeOrAbsolutePath) const; + File getChildFile (const char* relativeOrAbsolutePath) const; /** Returns a file which is in the same directory as this one. @@ -249,7 +242,7 @@ public: @see getChildFile, getParentDirectory */ - File getSiblingFile (StringRef siblingFileName) const; + File getSiblingFile (const char* siblingFileName) const; //============================================================================== /** Returns the directory that contains this file or directory. @@ -661,7 +654,7 @@ public: This will try to return the name of a non-existent temp file. To get the temp folder, you can use getSpecialLocation (File::tempDirectory). */ - static File createTempFile (StringRef fileNameEnding); + static File createTempFile (const char* fileNameEnding); //============================================================================== /** Returns the current working directory. @@ -678,17 +671,6 @@ public: */ bool setAsCurrentWorkingDirectory() const; - //============================================================================== - /** The system-specific file separator character. - On Windows, this will be '\', on Mac/Linux, it'll be '/' - */ - static const water_uchar separator; - - /** The system-specific file separator character, as a string. - On Windows, this will be '\', on Mac/Linux, it'll be '/' - */ - static const String separatorString; - //============================================================================== /** Returns a version of a filename with any illegal characters removed. @@ -716,7 +698,7 @@ public: static bool areFileNamesCaseSensitive(); /** Returns true if the string seems to be a fully-specified absolute path. */ - static bool isAbsolutePath (StringRef path); + static bool isAbsolutePath (const char* path); /** Creates a file that simply contains this string, without doing the sanity-checking that the normal constructors do. diff --git a/source/modules/water/streams/FileInputSource.cpp b/source/modules/water/streams/FileInputSource.cpp index bdaa0db89..974a0e7aa 100644 --- a/source/modules/water/streams/FileInputSource.cpp +++ b/source/modules/water/streams/FileInputSource.cpp @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2016 ROLI Ltd. - Copyright (C) 2017-2018 Filipe Coelho + Copyright (C) 2017-2024 Filipe Coelho Permission is granted to use this software under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license/ @@ -41,7 +41,7 @@ InputStream* FileInputSource::createInputStream() InputStream* FileInputSource::createInputStreamFor (const String& relatedItemPath) { - return file.getSiblingFile (relatedItemPath).createInputStream(); + return file.getSiblingFile (relatedItemPath.toRawUTF8()).createInputStream(); } } diff --git a/source/modules/water/threads/ChildProcess.cpp b/source/modules/water/threads/ChildProcess.cpp index 012366a2a..28120abab 100644 --- a/source/modules/water/threads/ChildProcess.cpp +++ b/source/modules/water/threads/ChildProcess.cpp @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2016 ROLI Ltd. - Copyright (C) 2017-2022 Filipe Coelho + Copyright (C) 2017-2024 Filipe Coelho Permission is granted to use this software under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license/ @@ -130,8 +130,8 @@ public: // Looks like you're trying to launch a non-existent exe or a folder (perhaps on OSX // you're trying to launch the .app folder rather than the actual binary inside it?) - wassert (File::getCurrentWorkingDirectory().getChildFile (exe).existsAsFile() - || ! exe.containsChar (File::separator)); + wassert (File::getCurrentWorkingDirectory().getChildFile (exe.toRawUTF8()).existsAsFile() + || ! exe.containsChar (CARLA_OS_SEP)); Array argv; for (int i = 0; i < arguments.size(); ++i) diff --git a/source/utils/CarlaDssiUtils.cpp b/source/utils/CarlaDssiUtils.cpp index cee62ac39..8bd1b2e8e 100644 --- a/source/utils/CarlaDssiUtils.cpp +++ b/source/utils/CarlaDssiUtils.cpp @@ -1,19 +1,5 @@ -/* - * Carla DSSI utils - * Copyright (C) 2013-2024 Filipe Coelho - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * For a full copy of the GNU General Public License see the doc/GPL.txt file. - */ +// SPDX-FileCopyrightText: 2011-2024 Filipe Coelho +// SPDX-License-Identifier: GPL-2.0-or-later #include "CarlaDssiUtils.hpp" diff --git a/source/utils/CarlaJsfxUtils.hpp b/source/utils/CarlaJsfxUtils.hpp index a8cc5f85f..cb5ed7924 100644 --- a/source/utils/CarlaJsfxUtils.hpp +++ b/source/utils/CarlaJsfxUtils.hpp @@ -149,7 +149,7 @@ public: CarlaJsfxUnit(const water::File& rootPath, const water::File& filePath) : fFileId(createFileId(rootPath, filePath)), - fFilePath(rootPath.getChildFile(fFileId).getFullPathName()), + fFilePath(rootPath.getChildFile(fFileId.toRawUTF8()).getFullPathName()), fRootPath(rootPath.getFullPathName()) {} explicit operator bool() const noexcept