diff --git a/.gitignore b/.gitignore index cc70f47c..4f2975b3 100644 --- a/.gitignore +++ b/.gitignore @@ -10,9 +10,9 @@ /bin/app/*.log /bin/test/data/log/ -/bin/test/data/temp.xml /bin/test/data/TestSettings.xml /bin/test/data/CommandlineTestSuite/settings.xml +/bin/test/data/ConfigManagerTestSuite/temp.xml /java_indexer/target/ diff --git a/bin/test/data/ConfigManagerTestSuite/test_data.xml b/bin/test/data/ConfigManagerTestSuite/test_data.xml new file mode 100644 index 00000000..76c33f67 --- /dev/null +++ b/bin/test/data/ConfigManagerTestSuite/test_data.xml @@ -0,0 +1,8 @@ + + + + + ΓΌ + + + diff --git a/bin/test/data/SettingsTestSuite/settings.xml b/bin/test/data/SettingsTestSuite/settings.xml index fe8f7f44..8dd4f72a 100644 --- a/bin/test/data/SettingsTestSuite/settings.xml +++ b/bin/test/data/SettingsTestSuite/settings.xml @@ -4,6 +4,7 @@ 42 3.1416 Hello World! + Hello World! diff --git a/src/app/main.cpp b/src/app/main.cpp index f7f7df03..efcc2756 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -66,14 +66,14 @@ void prefillJavaRuntimePath() std::vector paths = javaPathDetector->getPaths(); if (!paths.empty()) { - MessageStatus("Ran Java runtime path detection, found: " + paths.front().str()).dispatch(); + MessageStatus(L"Ran Java runtime path detection, found: " + paths.front().wstr()).dispatch(); settings->setJavaPath(paths.front()); settings->save(); } else { - MessageStatus("Ran Java runtime path detection, no path found.").dispatch(); + MessageStatus(L"Ran Java runtime path detection, no path found.").dispatch(); } } } @@ -87,14 +87,14 @@ void prefillJreSystemLibraryPaths() std::vector paths = jreSystemLibraryPathsDetector->getPaths(); if (!paths.empty()) { - MessageStatus("Ran JRE system library path detection, found: " + paths.front().str()).dispatch(); + MessageStatus(L"Ran JRE system library path detection, found: " + paths.front().wstr()).dispatch(); settings->setJreSystemLibraryPaths(paths); settings->save(); } else { - MessageStatus("Ran JRE system library path detection, no path found.").dispatch(); + MessageStatus(L"Ran JRE system library path detection, no path found.").dispatch(); } } } @@ -108,14 +108,14 @@ void prefillMavenExecutablePath() std::vector paths = mavenPathDetector->getPaths(); if (!paths.empty()) { - MessageStatus("Ran Maven executable path detection, found: " + paths.front().str()).dispatch(); + MessageStatus(L"Ran Maven executable path detection, found: " + paths.front().wstr()).dispatch(); settings->setMavenPath(paths.front()); settings->save(); } else { - MessageStatus("Ran Maven executable path detection, no path found.").dispatch(); + MessageStatus(L"Ran Maven executable path detection, no path found.").dispatch(); } } } @@ -129,7 +129,7 @@ void prefillCxxHeaderPaths() std::vector paths = cxxHeaderDetector->getPaths(); if (!paths.empty()) { - MessageStatus("Ran C/C++ header path detection, found " + std::to_string(paths.size()) + " paths").dispatch(); + MessageStatus(L"Ran C/C++ header path detection, found " + std::to_wstring(paths.size()) + L" path" + (paths.size() == 1 ? L"" : L"s")).dispatch(); settings->setHeaderSearchPaths(paths); settings->save(); @@ -146,7 +146,7 @@ void prefillCxxFrameworkPaths() std::vector paths = cxxFrameworkDetector->getPaths(); if (!paths.empty()) { - MessageStatus("Ran C/C++ framework path detection, found " + std::to_string(paths.size()) + " paths").dispatch(); + MessageStatus(L"Ran C/C++ framework path detection, found " + std::to_wstring(paths.size()) + L" path" + (paths.size() == 1 ? L"" : L"s")).dispatch(); settings->setFrameworkSearchPaths(paths); settings->save(); @@ -208,9 +208,10 @@ int main(int argc, char *argv[]) QApplication::setApplicationVersion(version.toDisplayString().c_str()); MessageStatus( - std::string("Starting Sourcetrail ") + - (utility::getApplicationArchitectureType() == APPLICATION_ARCHITECTURE_X86_32 ? "32" : "64") + " bit, " + - "version " + version.toDisplayString()).dispatch(); + std::wstring(L"Starting Sourcetrail ") + + (utility::getApplicationArchitectureType() == APPLICATION_ARCHITECTURE_X86_32 ? L"32" : L"64") + L" bit, " + + L"version " + version.toDisplayWString() + ).dispatch(); commandline::CommandLineParser commandLineParser(version.toString()); commandLineParser.preparse(argc, argv); @@ -273,7 +274,7 @@ int main(int argc, char *argv[]) if (commandLineParser.hasError() ) { - std::cout << commandLineParser.getError() << std::endl; + std::wcout << commandLineParser.getError() << std::endl; } else { diff --git a/src/indexer/main.cpp b/src/indexer/main.cpp index 0c0c49e2..46532b87 100644 --- a/src/indexer/main.cpp +++ b/src/indexer/main.cpp @@ -71,7 +71,7 @@ int main(int argc, char *argv[]) logFilePath = argv[5]; } - AppPath::setAppPath(appPath); + AppPath::setAppPath(FilePath(appPath)); UserPaths::setUserDataPath(FilePath(userDataPath)); setupLogging(logFilePath); diff --git a/src/lib/Application.cpp b/src/lib/Application.cpp index 7a943c06..fb151fb9 100644 --- a/src/lib/Application.cpp +++ b/src/lib/Application.cpp @@ -13,6 +13,7 @@ #include "utility/scheduling/TaskScheduler.h" #include "utility/tracing.h" #include "utility/UserPaths.h" +#include "utility/utilityQString.h" #include "utility/utilityUuid.h" #include "utility/Version.h" @@ -99,7 +100,7 @@ std::string Application::getUUID() void Application::loadSettings() { - MessageStatus("Load settings: " + UserPaths::getAppSettingsPath().str()).dispatch(); + MessageStatus(L"Load settings: " + UserPaths::getAppSettingsPath().wstr()).dispatch(); std::shared_ptr settings = ApplicationSettings::getInstance(); settings->load(UserPaths::getAppSettingsPath()); @@ -160,6 +161,16 @@ int Application::handleDialog(const std::string& message, const std::vectorconfirm(message, options); } +int Application::handleDialog(const std::wstring& message) +{ + return getDialogView()->confirm(message); +} + +int Application::handleDialog(const std::wstring& message, const std::vector& options) +{ + return getDialogView()->confirm(message, options); +} + std::shared_ptr Application::getDialogView() { if (m_componentManager) @@ -182,7 +193,7 @@ void Application::updateBookmarks(const std::vector>& void Application::createAndLoadProject(const FilePath& projectSettingsFilePath) { - MessageStatus("Loading Project: " + projectSettingsFilePath.str(), false, true).dispatch(); + MessageStatus(L"Loading Project: " + projectSettingsFilePath.wstr(), false, true).dispatch(); try { updateRecentProjects(projectSettingsFilePath); @@ -200,7 +211,7 @@ void Application::createAndLoadProject(const FilePath& projectSettingsFilePath) else { LOG_ERROR_STREAM(<< "Failed to load project."); - MessageStatus("Failed to load project: " + projectSettingsFilePath.str(), true).dispatch(); + MessageStatus(L"Failed to load project: " + projectSettingsFilePath.wstr(), true).dispatch(); } updateTitle(); @@ -208,12 +219,12 @@ void Application::createAndLoadProject(const FilePath& projectSettingsFilePath) catch (std::exception& e) { LOG_ERROR_STREAM(<< "Failed to load project, exception thrown: " << e.what()); - MessageStatus("Failed to load project, exception was thrown: " + projectSettingsFilePath.str(), true).dispatch(); + MessageStatus(L"Failed to load project, exception was thrown: " + projectSettingsFilePath.wstr(), true).dispatch(); } catch (...) { LOG_ERROR_STREAM(<< "Failed to load project, unknown exception thrown."); - MessageStatus("Failed to load project, unknown exception was thrown: " + projectSettingsFilePath.str(), true).dispatch(); + MessageStatus(L"Failed to load project, unknown exception was thrown: " + projectSettingsFilePath.wstr(), true).dispatch(); } if (m_hasGUI) @@ -240,7 +251,7 @@ void Application::handleMessage(MessageActivateWindow* message) void Application::handleMessage(MessageEnteredLicense* message) { - MessageStatus("Found valid license key, unlocked application.").dispatch(); + MessageStatus(L"Found valid license key, unlocked application.").dispatch(); m_licenseType = message->type; @@ -313,7 +324,7 @@ void Application::handleMessage(MessageRefresh* message) void Application::handleMessage(MessageSwitchColorScheme* message) { - MessageStatus("Switch color scheme: " + message->colorSchemePath.str()).dispatch(); + MessageStatus(L"Switch color scheme: " + message->colorSchemePath.wstr()).dispatch(); loadStyle(message->colorSchemePath); MessageRefresh().refreshUiOnly().noReloadStyle().dispatch(); @@ -416,16 +427,16 @@ void Application::updateTitle() { if (m_hasGUI) { - std::string title = "Sourcetrail"; + std::wstring title = L"Sourcetrail"; switch (m_licenseType) { case MessageEnteredLicense::LICENSE_TEST: - title += " [test]"; + title += L" [test]"; break; case MessageEnteredLicense::LICENSE_NONE: case MessageEnteredLicense::LICENSE_NON_COMMERCIAL: - title += " [non-commercial]"; + title += L" [non-commercial]"; break; case MessageEnteredLicense::LICENSE_COMMERCIAL: break; @@ -437,7 +448,7 @@ void Application::updateTitle() if (!projectPath.empty()) { - title += " - " + projectPath.fileName(); + title += L" - " + projectPath.wFileName(); } } @@ -452,7 +463,7 @@ bool Application::checkSharedMemory() { MessageStatus("Error on accessing shared memory. Indexing not possible. Please restart computer or run as admin: " + error, true).dispatch(); handleDialog( - "There was an error accessing shared memory on your computer: " + error + "\n\n" + L"There was an error accessing shared memory on your computer: " + utility::decodeFromUtf8(error) + L"\n\n" "Project indexing is not possible. Please restart your computer or try running Sourcetrail as admin. If the " "issue persists contact mail@sourcetrail.com"); return false; diff --git a/src/lib/Application.h b/src/lib/Application.h index a67c05fd..8f090f6a 100644 --- a/src/lib/Application.h +++ b/src/lib/Application.h @@ -53,6 +53,8 @@ public: int handleDialog(const std::string& message); int handleDialog(const std::string& message, const std::vector& options); + int handleDialog(const std::wstring& message); + int handleDialog(const std::wstring& message, const std::vector& options); std::shared_ptr getDialogView(); void updateHistory(const std::vector& history); diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index 120b8eea..51c71015 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -447,6 +447,7 @@ add_files( utility/messaging/type/MessageShowReference.h utility/messaging/type/MessageShowScope.h utility/messaging/type/MessageShowStatus.h + utility/messaging/type/MessageStatus.cpp utility/messaging/type/MessageStatus.h utility/messaging/type/MessageStatusFilterChanged.h utility/messaging/type/MessageSwitchColorScheme.h diff --git a/src/lib/LicenseChecker.cpp b/src/lib/LicenseChecker.cpp index da3fc5c9..22e6e1b0 100644 --- a/src/lib/LicenseChecker.cpp +++ b/src/lib/LicenseChecker.cpp @@ -32,7 +32,7 @@ std::string LicenseChecker::getCurrentLicenseString() const { License license; bool isLoaded = license.loadFromEncodedString( - ApplicationSettings::getInstance()->getLicenseString(), AppPath::getAppPath()); + ApplicationSettings::getInstance()->getLicenseString(), AppPath::getAppPath().str()); if (isLoaded) { @@ -68,10 +68,9 @@ LicenseChecker::LicenseState LicenseChecker::checkCurrentLicense() const return LICENSE_EMPTY; } - std::string licenseCheck = appSettings->getLicenseCheck(); - std::string appPath(AppPath::getAppPath()); + const FilePath appPath = AppPath::getAppPath(); - if (appPath.size() <= 0) + if (appPath.empty()) { LOG_ERROR_STREAM(<< "Failed to retrieve app path"); return LICENSE_EMPTY; @@ -83,13 +82,13 @@ LicenseChecker::LicenseState LicenseChecker::checkCurrentLicense() const return LICENSE_EMPTY; } - if (!License::checkLocation(FilePath(appPath).makeAbsolute().str(), licenseCheck)) + if (!License::checkLocation(appPath.getAbsolute().str(), appSettings->getLicenseCheck())) { return LICENSE_MOVED; } License license; - bool isLoaded = license.loadFromEncodedString(licenseString, appPath); + bool isLoaded = license.loadFromEncodedString(licenseString, appPath.str()); if (!isLoaded) { return LICENSE_MOVED; @@ -121,7 +120,7 @@ MessageEnteredLicense::LicenseType LicenseChecker::getCurrentLicenseType() const { License license; bool isLoaded = license.loadFromEncodedString( - ApplicationSettings::getInstance()->getLicenseString(), AppPath::getAppPath()); + ApplicationSettings::getInstance()->getLicenseString(), AppPath::getAppPath().str()); if (!isLoaded) { diff --git a/src/lib/component/controller/ActivationController.cpp b/src/lib/component/controller/ActivationController.cpp index 16ce4567..a1d4b73e 100644 --- a/src/lib/component/controller/ActivationController.cpp +++ b/src/lib/component/controller/ActivationController.cpp @@ -154,9 +154,8 @@ void ActivationController::handleMessage(MessageResetZoom* message) MessageRefresh().refreshUiOnly().dispatch(); } - std::stringstream text; - text << "Font size: " << fontSizeStd; - MessageStatus(text.str()).dispatch(); + + MessageStatus(L"Font size: " + std::to_wstring(fontSizeStd)).dispatch(); } void ActivationController::handleMessage(MessageZoom* message) @@ -178,10 +177,7 @@ void ActivationController::handleMessage(MessageZoom* message) settings->setFontSize(fontSize + (message->zoomIn ? 1 : -1)); settings->save(); - std::stringstream text; - text << "Font size: " << settings->getFontSize(); - MessageStatus(text.str()).dispatch(); - + MessageStatus(L"Font size: " + std::to_wstring(settings->getFontSize())).dispatch(); MessageRefresh().refreshUiOnly().dispatch(); } diff --git a/src/lib/component/controller/CodeController.cpp b/src/lib/component/controller/CodeController.cpp index 88d16337..4dde0459 100644 --- a/src/lib/component/controller/CodeController.cpp +++ b/src/lib/component/controller/CodeController.cpp @@ -7,6 +7,7 @@ #include "utility/text/TextAccess.h" #include "utility/tracing.h" #include "utility/logging/logging.h" +#include "utility/utilityQString.h" #include "utility/utilityString.h" #include "data/access/StorageAccess.h" @@ -156,25 +157,25 @@ void CodeController::handleMessage(MessageActivateTokens* message) size_t fileCount = m_collection->getSourceLocationFileCount(); size_t referenceCount = m_collection->getSourceLocationCount(); - std::stringstream ss; + std::wstring status = L""; if (message->tokenNames.size()) { - ss << "Activate \"" << message->tokenNames[0].getQualifiedName() << "\": "; + status += L"Activate \"" + utility::decodeFromUtf8(message->tokenNames[0].getQualifiedName()) + L"\": "; } - ss << message->tokenIds.size() << ' '; - ss << (message->tokenIds.size() == 1 ? "result" : "results"); + status += std::to_wstring(message->tokenIds.size()) + L" "; + status += (message->tokenIds.size() == 1 ? L"result" : L"results"); if (fileCount > 0) { - ss << " with " << referenceCount << ' '; - ss << (referenceCount == 1 ? "reference" : "references"); - ss << " in " << fileCount << ' '; - ss << (fileCount == 1 ? "file" : "files"); + status += L" with " + std::to_wstring(referenceCount) + L" "; + status += (referenceCount == 1 ? L"reference" : L"references"); + status += L" in " + std::to_wstring(fileCount) + L" "; + status += (fileCount == 1 ? L"file" : L"files"); } - MessageStatus(ss.str()).dispatch(); + MessageStatus(status).dispatch(); } } @@ -281,7 +282,7 @@ void CodeController::handleMessage(MessageScrollToLine* message) getView()->showContents(); MessageStatus( - "Showing source location: " + message->filePath.str() + " : " + std::to_string(message->line) + L"Showing source location: " + message->filePath.wstr() + L" : " + std::to_wstring(message->line) ).dispatch(); } diff --git a/src/lib/component/controller/GraphController.cpp b/src/lib/component/controller/GraphController.cpp index c74b7570..b120e897 100644 --- a/src/lib/component/controller/GraphController.cpp +++ b/src/lib/component/controller/GraphController.cpp @@ -153,7 +153,7 @@ void GraphController::handleMessage(MessageActivateTrail* message) { TRACE("trail activate"); - MessageStatus("Retrieving depth graph data", false, true).dispatch(); + MessageStatus(L"Retrieving depth graph data", false, true).dispatch(); m_activeEdgeIds.clear(); @@ -172,7 +172,7 @@ void GraphController::handleMessage(MessageActivateTrail* message) if (r == 1) { - MessageStatus("Depth graph aborted.").dispatch(); + MessageStatus(L"Depth graph aborted.").dispatch(); return; } } @@ -183,12 +183,12 @@ void GraphController::handleMessage(MessageActivateTrail* message) setVisibility(setActive(m_activeNodeIds, true)); - MessageStatus("Layouting depth graph", false, true).dispatch(); + MessageStatus(L"Layouting depth graph", false, true).dispatch(); layoutNesting(); layoutTrail(message->horizontalLayout, message->originId); - MessageStatus("Displaying depth graph", false, true).dispatch(); + MessageStatus(L"Displaying depth graph", false, true).dispatch(); message->setIsReplayed(false); buildGraph(message, message->isLast(), true, false); @@ -386,7 +386,7 @@ void GraphController::handleMessage(MessageGraphNodeHide* message) { if (node->active || node->hasActiveSubNode()) { - MessageStatus("Can't hide active node or node with active children", true).dispatch(); + MessageStatus(L"Can't hide active node or node with active children", true).dispatch(); return; } diff --git a/src/lib/component/controller/IDECommunicationController.cpp b/src/lib/component/controller/IDECommunicationController.cpp index ed1c7b57..d00913d1 100644 --- a/src/lib/component/controller/IDECommunicationController.cpp +++ b/src/lib/component/controller/IDECommunicationController.cpp @@ -115,8 +115,10 @@ void IDECommunicationController::handleSetActiveTokenMessage( if (selectedLocationIds.size() > 0) { - MessageStatus("Activating source location from plug-in succeeded: " + filePath.str() + ", row: " + - std::to_string(message.row) + ", col: " + std::to_string(message.column)).dispatch(); + MessageStatus( + L"Activating source location from plug-in succeeded: " + filePath.wstr() + L", row: " + + std::to_wstring(message.row) + L", col: " + std::to_wstring(message.column) + ).dispatch(); MessageActivateSourceLocations(selectedLocationIds).dispatch(); MessageActivateWindow().dispatch(); @@ -133,8 +135,8 @@ void IDECommunicationController::handleSetActiveTokenMessage( else { MessageStatus( - "Activating source location from plug-in failed. File " + filePath.str() - + " was not found in the project.", + L"Activating source location from plug-in failed. File " + filePath.wstr() + + L" was not found in the project.", true ).dispatch(); } @@ -191,7 +193,7 @@ void IDECommunicationController::handleMessage(MessageIDECreateCDB* message) { std::string networkMessage = NetworkProtocolHelper::buildCreateCDBMessage(); - MessageStatus("Requesting IDE to create Compilation Database via plug-in.").dispatch(); + MessageStatus(L"Requesting IDE to create Compilation Database via plug-in.").dispatch(); sendMessage(networkMessage); } @@ -199,12 +201,12 @@ void IDECommunicationController::handleMessage(MessageIDECreateCDB* message) void IDECommunicationController::handleMessage(MessageMoveIDECursor* message) { std::string networkMessage = NetworkProtocolHelper::buildSetIDECursorMessage( - message->FilePosition, message->Row, message->Column + message->FilePosition.str(), message->Row, message->Column ); MessageStatus( - "Jump to source location via plug-in: " + message->FilePosition + ", row: " + - std::to_string(message->Row) + ", col: " + std::to_string(message->Column) + L"Jump to source location via plug-in: " + message->FilePosition.wstr() + L", row: " + + std::to_wstring(message->Row) + L", col: " + std::to_wstring(message->Column) ).dispatch(); sendMessage(networkMessage); diff --git a/src/lib/component/controller/StatusBarController.cpp b/src/lib/component/controller/StatusBarController.cpp index ecac6315..68a5d7ec 100644 --- a/src/lib/component/controller/StatusBarController.cpp +++ b/src/lib/component/controller/StatusBarController.cpp @@ -72,13 +72,12 @@ void StatusBarController::handleMessage(MessageStatus* message) setStatus(message->status(), message->isError, message->showLoader); } -void StatusBarController::setStatus(const std::string& status, bool isError, bool showLoader) +void StatusBarController::setStatus(const std::wstring& status, bool isError, bool showLoader) { if (!status.empty()) { - LOG_INFO_STREAM(<< "STATUS " << status); + LOG_INFO(L"STATUS " + status); } getView()->showMessage(status, isError, showLoader); - } diff --git a/src/lib/component/controller/StatusBarController.h b/src/lib/component/controller/StatusBarController.h index c98e286b..4eb967e4 100644 --- a/src/lib/component/controller/StatusBarController.h +++ b/src/lib/component/controller/StatusBarController.h @@ -41,7 +41,7 @@ private: virtual void handleMessage(MessageShowErrors* message); virtual void handleMessage(MessageStatus* message); - void setStatus(const std::string& status, bool isError, bool showLoader); + void setStatus(const std::wstring& status, bool isError, bool showLoader); StorageAccess* m_storageAccess; }; diff --git a/src/lib/component/controller/StatusController.cpp b/src/lib/component/controller/StatusController.cpp index bf88db31..b7d39788 100644 --- a/src/lib/component/controller/StatusController.cpp +++ b/src/lib/component/controller/StatusController.cpp @@ -35,14 +35,14 @@ void StatusController::handleMessage(MessageShowStatus* message) void StatusController::handleMessage(MessageStatus* message) { - if (!message->status().size()) + if (message->status().empty()) { return; } std::vector stati; - for (const std::string& status : message->stati()) + for (const std::wstring& status : message->stati()) { stati.push_back(Status(status, message->isError)); } diff --git a/src/lib/component/view/DialogView.cpp b/src/lib/component/view/DialogView.cpp index ada6a852..ec7e1141 100644 --- a/src/lib/component/view/DialogView.cpp +++ b/src/lib/component/view/DialogView.cpp @@ -54,3 +54,13 @@ int DialogView::confirm(const std::string& message, const std::vector()); +} + +int DialogView::confirm(const std::wstring& message, const std::vector& options) +{ + return -1; +} diff --git a/src/lib/component/view/DialogView.h b/src/lib/component/view/DialogView.h index 6b0fb884..96fdd84d 100644 --- a/src/lib/component/view/DialogView.h +++ b/src/lib/component/view/DialogView.h @@ -34,6 +34,8 @@ public: int confirm(const std::string& message); virtual int confirm(const std::string& message, const std::vector& options); + int confirm(const std::wstring& message); + virtual int confirm(const std::wstring& message, const std::vector& options); protected: StorageAccess* m_storageAccess; diff --git a/src/lib/component/view/GraphViewStyle.cpp b/src/lib/component/view/GraphViewStyle.cpp index 91b30ad5..4506c767 100644 --- a/src/lib/component/view/GraphViewStyle.cpp +++ b/src/lib/component/view/GraphViewStyle.cpp @@ -486,7 +486,7 @@ GraphViewStyle::NodeStyle GraphViewStyle::getStyleOfBundleNode(bool isFocused) return getStyleForNodeType( NodeType::STYLE_BIG_NODE, "bundle", - ResourcePaths::getGuiPath().concatenate(FilePath("graph_view/images/bundle.png")), + ResourcePaths::getGuiPath().concatenate(L"graph_view/images/bundle.png"), true, false, isFocused, diff --git a/src/lib/component/view/MainView.h b/src/lib/component/view/MainView.h index 0da1a04e..0dff385c 100644 --- a/src/lib/component/view/MainView.h +++ b/src/lib/component/view/MainView.h @@ -23,7 +23,7 @@ public: virtual void refreshView() = 0; virtual void hideStartScreen() = 0; - virtual void setTitle(const std::string& title) = 0; + virtual void setTitle(const std::wstring& title) = 0; virtual void activateWindow() = 0; virtual void updateRecentProjectMenu() = 0; diff --git a/src/lib/component/view/StatusBarView.h b/src/lib/component/view/StatusBarView.h index f38afb18..d26a80e5 100644 --- a/src/lib/component/view/StatusBarView.h +++ b/src/lib/component/view/StatusBarView.h @@ -13,7 +13,7 @@ public: ~StatusBarView(void); virtual std::string getName() const; - virtual void showMessage(const std::string& message, bool isError, bool showLoader) = 0; + virtual void showMessage(const std::wstring& message, bool isError, bool showLoader) = 0; virtual void setErrorCount(ErrorCountInfo errorCount) = 0; virtual void showIdeStatus(const std::string& message) = 0; diff --git a/src/lib/component/view/helper/CodeSnippetParams.cpp b/src/lib/component/view/helper/CodeSnippetParams.cpp index 535beeb0..84c31459 100644 --- a/src/lib/component/view/helper/CodeSnippetParams.cpp +++ b/src/lib/component/view/helper/CodeSnippetParams.cpp @@ -62,7 +62,7 @@ bool CodeSnippetParams::sort(const CodeSnippetParams& a, const CodeSnippetParams // alphabetical filepath without extension else { - return aFilePath.withoutExtension().fileName() < bFilePath.withoutExtension().fileName(); + return aFilePath.withoutExtension().wFileName() < bFilePath.withoutExtension().wFileName(); } } diff --git a/src/lib/data/NodeType.cpp b/src/lib/data/NodeType.cpp index 90beb678..954a22dc 100644 --- a/src/lib/data/NodeType.cpp +++ b/src/lib/data/NodeType.cpp @@ -228,19 +228,19 @@ FilePath NodeType::getIconPath() const if (isPackage()) { // this icon cannot be changed - return ResourcePaths::getGuiPath().concatenate(FilePath("graph_view/images/namespace.png")); + return ResourcePaths::getGuiPath().concatenate(L"graph_view/images/namespace.png"); } switch (m_type) { case NodeType::NODE_ENUM: - return ResourcePaths::getGuiPath().concatenate(FilePath("graph_view/images/enum.png")); + return ResourcePaths::getGuiPath().concatenate(L"graph_view/images/enum.png"); case NodeType::NODE_TYPEDEF: - return ResourcePaths::getGuiPath().concatenate(FilePath("graph_view/images/typedef.png")); + return ResourcePaths::getGuiPath().concatenate(L"graph_view/images/typedef.png"); case NodeType::NODE_MACRO: - return ResourcePaths::getGuiPath().concatenate(FilePath("graph_view/images/macro.png")); + return ResourcePaths::getGuiPath().concatenate(L"graph_view/images/macro.png"); case NodeType::NODE_FILE: - return ResourcePaths::getGuiPath().concatenate(FilePath("graph_view/images/file.png")); + return ResourcePaths::getGuiPath().concatenate(L"graph_view/images/file.png"); default: return FilePath(); } diff --git a/src/lib/data/TaskFinishParsing.cpp b/src/lib/data/TaskFinishParsing.cpp index e48452f2..d196b371 100644 --- a/src/lib/data/TaskFinishParsing.cpp +++ b/src/lib/data/TaskFinishParsing.cpp @@ -7,6 +7,7 @@ #include "utility/messaging/type/MessageStatus.h" #include "utility/scheduling/Blackboard.h" #include "utility/utility.h" +#include "utility/utilityQString.h" #include "Application.h" TaskFinishParsing::TaskFinishParsing( @@ -69,16 +70,16 @@ Task::TaskState TaskFinishParsing::doUpdate(std::shared_ptr blackboa ErrorCountInfo errorInfo = m_storageAccess->getErrorCount(); - std::stringstream ss; - ss << "Finished indexing: "; - ss << indexedSourceFileCount << "/" << sourceFileCount << " source files indexed; "; - ss << utility::timeToString(time); - ss << "; " << errorInfo.total << " error" << (errorInfo.total != 1 ? "s" : ""); + std::wstring status; + status += L"Finished indexing: "; + status += std::to_wstring(indexedSourceFileCount) + L"/" + std::to_wstring(sourceFileCount) + L" source files indexed; "; + status += utility::decodeFromUtf8(utility::timeToString(time)); + status += L"; " + std::to_wstring(errorInfo.total) + L" error" + (errorInfo.total != 1 ? L"s" : L""); if (errorInfo.fatal > 0) { - ss << " (" << errorInfo.fatal << " fatal)"; + status += L" (" + std::to_wstring(errorInfo.fatal) + L" fatal)"; } - MessageStatus(ss.str(), false, false).dispatch(); + MessageStatus(status, false, false).dispatch(); StorageStats stats = m_storageAccess->getStorageStats(); dialogView->finishedIndexingDialog( @@ -110,6 +111,6 @@ void TaskFinishParsing::terminate() app->getDialogView()->hideDialogs(); } - MessageStatus("An unknown exception was thrown during indexing.", true, false).dispatch(); + MessageStatus(L"An unknown exception was thrown during indexing.", true, false).dispatch(); MessageFinishedParsing().dispatch(); } diff --git a/src/lib/data/indexer/TaskBuildIndex.cpp b/src/lib/data/indexer/TaskBuildIndex.cpp index d8ab4ffb..0de5d4e9 100644 --- a/src/lib/data/indexer/TaskBuildIndex.cpp +++ b/src/lib/data/indexer/TaskBuildIndex.cpp @@ -14,9 +14,9 @@ #include "utility/messaging/type/MessageStatus.h" #if _WIN32 -const std::string TaskBuildIndex::s_processName("sourcetrail_indexer.exe"); +const std::wstring TaskBuildIndex::s_processName(L"sourcetrail_indexer.exe"); #else -const std::string TaskBuildIndex::s_processName("sourcetrail_indexer"); +const std::wstring TaskBuildIndex::s_processName(L"sourcetrail_indexer"); #endif TaskBuildIndex::TaskBuildIndex( @@ -177,7 +177,7 @@ void TaskBuildIndex::runIndexerProcess(int processId, const std::string& logFile m_runningThreadCount++; } - FilePath indexerProcessPath(AppPath::getAppPath() + s_processName); + FilePath indexerProcessPath = AppPath::getAppPath().concatenate(s_processName); if (!indexerProcessPath.exists()) { m_interrupted = true; @@ -188,7 +188,7 @@ void TaskBuildIndex::runIndexerProcess(int processId, const std::string& logFile std::string command = "\"" + indexerProcessPath.str() + "\""; command += " " + std::to_string(processId); command += " " + Application::getUUID(); - command += " \"" + AppPath::getAppPath() + "\""; + command += " \"" + AppPath::getAppPath().str() + "\""; command += " \"" + UserPaths::getUserDataPath().str() + "\""; if (logFilePath.size()) @@ -292,14 +292,11 @@ void TaskBuildIndex::updateIndexingDialog( if (sourcePaths.size()) { - std::vector stati; + std::vector stati; for (const FilePath& path : sourcePaths) { m_indexingFileCount++; - - std::stringstream ss; - ss << "[" << m_indexingFileCount << "/" << sourceFileCount << "] Indexing file: " << path.str(); - stati.push_back(ss.str()); + stati.push_back(L"[" + std::to_wstring(m_indexingFileCount) + L"/" + std::to_wstring(sourceFileCount) + L"] Indexing file: " + path.wstr()); } MessageStatus(stati, false, true).dispatch(); } diff --git a/src/lib/data/indexer/TaskBuildIndex.h b/src/lib/data/indexer/TaskBuildIndex.h index a78d42bc..a3cb9887 100644 --- a/src/lib/data/indexer/TaskBuildIndex.h +++ b/src/lib/data/indexer/TaskBuildIndex.h @@ -41,7 +41,7 @@ protected: bool fetchIntermediateStorages(std::shared_ptr blackboard); void updateIndexingDialog(std::shared_ptr blackboard, const std::vector& sourcePaths); - static const std::string s_processName; + static const std::wstring s_processName; std::shared_ptr m_indexerCommandList; std::shared_ptr m_storageProvider; diff --git a/src/lib/data/parser/ParseLocation.cpp b/src/lib/data/parser/ParseLocation.cpp index 972e89a1..491c44cd 100644 --- a/src/lib/data/parser/ParseLocation.cpp +++ b/src/lib/data/parser/ParseLocation.cpp @@ -1,7 +1,7 @@ #include "data/parser/ParseLocation.h" ParseLocation::ParseLocation() - : filePath("") + : filePath(L"") , startLineNumber(0) , startColumnNumber(0) , endLineNumber(0) diff --git a/src/lib/data/storage/PersistentStorage.cpp b/src/lib/data/storage/PersistentStorage.cpp index 5a9257ac..33804aff 100644 --- a/src/lib/data/storage/PersistentStorage.cpp +++ b/src/lib/data/storage/PersistentStorage.cpp @@ -476,7 +476,7 @@ std::shared_ptr PersistentStorage::getFullTextSearchLo if (m_fullTextSearchIndex.fileCount() == 0) { - MessageStatus("Building fulltext search index", false, true).dispatch(); + MessageStatus(L"Building fulltext search index", false, true).dispatch(); buildFullTextSearchIndex(); } diff --git a/src/lib/project/Project.cpp b/src/lib/project/Project.cpp index 6216b4d9..5b00a440 100644 --- a/src/lib/project/Project.cpp +++ b/src/lib/project/Project.cpp @@ -146,11 +146,11 @@ void Project::load() { MessageFinishedParsing().dispatch(); } - MessageStatus("Finished Loading", false, false).dispatch(); + MessageStatus(L"Finished Loading", false, false).dispatch(); } else { - MessageStatus("Project not loaded", false, false).dispatch(); + MessageStatus(L"Project not loaded", false, false).dispatch(); } if (m_state != PROJECT_STATE_LOADED && m_hasGUI) @@ -326,11 +326,11 @@ void Project::buildIndex(const RefreshInfo& info, DialogView* dialogView) MessageFinishedParsing().dispatch(); } - MessageStatus("Nothing to refresh, all files are up-to-date.").dispatch(); + MessageStatus(L"Nothing to refresh, all files are up-to-date.").dispatch(); return; } - MessageStatus("Preparing Indexing", false, true).dispatch(); + MessageStatus(L"Preparing Indexing", false, true).dispatch(); MessageClearErrorCount().dispatch(); dialogView->showUnknownProgressDialog("Preparing Indexing", "Setting up Indexers"); diff --git a/src/lib/settings/ApplicationSettings.cpp b/src/lib/settings/ApplicationSettings.cpp index 274fab97..63fa1618 100644 --- a/src/lib/settings/ApplicationSettings.cpp +++ b/src/lib/settings/ApplicationSettings.cpp @@ -65,7 +65,7 @@ bool ApplicationSettings::load(const FilePath& filePath) { License license; bool isLoaded = license.loadFromEncodedString( - migration->getValueFromSettings(settings, "user/license/license", ""), AppPath::getAppPath()); + migration->getValueFromSettings(settings, "user/license/license", ""), AppPath::getAppPath().str()); if (isLoaded && license.isValid() && license.isNonCommercialLicenseType()) { migration->removeValuesInSettings(settings, "user/license/license"); @@ -149,8 +149,8 @@ void ApplicationSettings::setShowBuiltinTypesInGraph(bool showBuiltinTypes) FilePath ApplicationSettings::getColorSchemePath() const { - FilePath defaultPath(ResourcePaths::getColorSchemesPath().concatenate(FilePath("bright.xml"))); - FilePath path(getValue("application/color_scheme", defaultPath.str())); + FilePath defaultPath(ResourcePaths::getColorSchemesPath().concatenate(L"bright.xml")); + FilePath path(getValue("application/color_scheme", defaultPath.wstr())); if (path != defaultPath && !path.exists()) { @@ -305,14 +305,14 @@ void ApplicationSettings::setMultiProcessIndexingEnabled(bool enabled) setValue("indexing/multi_process_indexing", enabled); } -std::string ApplicationSettings::getJavaPath() const +FilePath ApplicationSettings::getJavaPath() const { - return getValue("indexing/java/java_path", ""); + return FilePath(getValue("indexing/java/java_path", L"")); } void ApplicationSettings::setJavaPath(const FilePath& path) { - setValue("indexing/java/java_path", path.str()); + setValue("indexing/java/java_path", path.wstr()); } int ApplicationSettings::getJavaMaximumMemory() const @@ -342,12 +342,12 @@ bool ApplicationSettings::setJreSystemLibraryPaths(const std::vector& FilePath ApplicationSettings::getMavenPath() const { - return FilePath(getValue("indexing/java/maven_path", "")); + return FilePath(getValue("indexing/java/maven_path", L"")); } void ApplicationSettings::setMavenPath(const FilePath& path) { - setValue("indexing/java/maven_path", path.str()); + setValue("indexing/java/maven_path", path.wstr()); } std::vector ApplicationSettings::getHeaderSearchPaths() const diff --git a/src/lib/settings/ApplicationSettings.h b/src/lib/settings/ApplicationSettings.h index f32e58f3..26097014 100644 --- a/src/lib/settings/ApplicationSettings.h +++ b/src/lib/settings/ApplicationSettings.h @@ -89,7 +89,7 @@ public: bool getMultiProcessIndexingEnabled() const; void setMultiProcessIndexingEnabled(bool enabled); - std::string getJavaPath() const; + FilePath getJavaPath() const; void setJavaPath(const FilePath& path); int getJavaMaximumMemory() const; diff --git a/src/lib/settings/ProjectSettings.cpp b/src/lib/settings/ProjectSettings.cpp index 6a5c3a1b..b21f6b81 100644 --- a/src/lib/settings/ProjectSettings.cpp +++ b/src/lib/settings/ProjectSettings.cpp @@ -13,7 +13,7 @@ #include "utility/utilityUuid.h" const size_t ProjectSettings::VERSION = 4; -const char PROJECT_FILE_EXTENSION[] = ".srctrlprj"; +const wchar_t PROJECT_FILE_EXTENSION[] = L".srctrlprj"; LanguageType ProjectSettings::getLanguageOfProject(const FilePath& filePath) { @@ -48,11 +48,6 @@ ProjectSettings::ProjectSettings(const FilePath& projectFilePath) setFilePath(projectFilePath); } -ProjectSettings::ProjectSettings(std::string projectName, const FilePath& projectFileLocation) -{ - setProjectFilePath(projectName, projectFileLocation); -} - ProjectSettings::~ProjectSettings() { } @@ -114,14 +109,14 @@ FilePath ProjectSettings::getProjectFilePath() const return getFilePath(); } -void ProjectSettings::setProjectFilePath(std::string projectName, const FilePath& projectFileLocation) +void ProjectSettings::setProjectFilePath(std::wstring projectName, const FilePath& projectFileLocation) { - setFilePath(FilePath(projectFileLocation.str() + "/" + projectName + PROJECT_FILE_EXTENSION)); + setFilePath(projectFileLocation.getConcatenated(L"/" + projectName + PROJECT_FILE_EXTENSION)); } -std::string ProjectSettings::getProjectName() const +std::wstring ProjectSettings::getProjectName() const { - return getFilePath().withoutExtension().fileName(); + return getFilePath().withoutExtension().wFileName(); } FilePath ProjectSettings::getProjectDirectoryPath() const diff --git a/src/lib/settings/ProjectSettings.h b/src/lib/settings/ProjectSettings.h index 368265a2..59decb7e 100644 --- a/src/lib/settings/ProjectSettings.h +++ b/src/lib/settings/ProjectSettings.h @@ -19,7 +19,6 @@ public: ProjectSettings(); ProjectSettings(const FilePath& projectFilePath); - ProjectSettings(std::string projectName, const FilePath& projectFileLocation); virtual ~ProjectSettings(); bool equalsExceptNameAndLocation(const ProjectSettings& other) const; @@ -30,9 +29,9 @@ public: bool reload(); FilePath getProjectFilePath() const; - void setProjectFilePath(std::string projectName, const FilePath& projectFileLocation); + void setProjectFilePath(std::wstring projectName, const FilePath& projectFileLocation); - std::string getProjectName() const; + std::wstring getProjectName() const; FilePath getProjectDirectoryPath() const; std::string getDescription() const; diff --git a/src/lib/settings/Settings.cpp b/src/lib/settings/Settings.cpp index 08adddf9..92b72ddf 100644 --- a/src/lib/settings/Settings.cpp +++ b/src/lib/settings/Settings.cpp @@ -114,11 +114,8 @@ void Settings::setFilePath(const FilePath& filePath) std::vector Settings::getPathValues(const std::string& key) const { - std::vector values; - values = getValues(key, values); - std::vector paths; - for (const std::string& value : values) + for (const std::wstring& value : getValues(key, {})) { paths.push_back(FilePath(value)); } @@ -127,10 +124,10 @@ std::vector Settings::getPathValues(const std::string& key) const bool Settings::setPathValues(const std::string& key, const std::vector& paths) { - std::vector values; + std::vector values; for (const FilePath& path : paths) { - values.push_back(path.str()); + values.push_back(path.wstr()); } return setValues(key, values); diff --git a/src/lib/settings/SourceGroupSettings.cpp b/src/lib/settings/SourceGroupSettings.cpp index 576b8ddb..214b0751 100644 --- a/src/lib/settings/SourceGroupSettings.cpp +++ b/src/lib/settings/SourceGroupSettings.cpp @@ -174,11 +174,8 @@ void SourceGroupSettings::setSourceExtensions(const std::vector& so std::vector SourceGroupSettings::getPathValues(const std::string& key, std::shared_ptr config) { - std::vector values; - values = getValues(key, values, config); - std::vector paths; - for (const std::string& value : values) + for (const std::wstring& value : getValues(key, {}, config)) { paths.push_back(FilePath(value)); } @@ -187,10 +184,10 @@ std::vector SourceGroupSettings::getPathValues(const std::string& key, bool SourceGroupSettings::setPathValues(const std::string& key, const std::vector& paths, std::shared_ptr config) { - std::vector values; + std::vector values; for (const FilePath& path : paths) { - values.push_back(path.str()); + values.push_back(path.wstr()); } return setValues(key, values, config); diff --git a/src/lib/settings/SourceGroupSettingsCxxCdb.cpp b/src/lib/settings/SourceGroupSettingsCxxCdb.cpp index 6baa49bb..ae639871 100644 --- a/src/lib/settings/SourceGroupSettingsCxxCdb.cpp +++ b/src/lib/settings/SourceGroupSettingsCxxCdb.cpp @@ -19,7 +19,7 @@ void SourceGroupSettingsCxxCdb::load(std::shared_ptr config const std::string key = s_keyPrefix + getId(); - setCompilationDatabasePath(FilePath(getValue(key + "/build_file_path/compilation_db_path", "", config))); + setCompilationDatabasePath(FilePath(getValue(key + "/build_file_path/compilation_db_path", L"", config))); } void SourceGroupSettingsCxxCdb::save(std::shared_ptr config) @@ -28,7 +28,7 @@ void SourceGroupSettingsCxxCdb::save(std::shared_ptr config) const std::string key = s_keyPrefix + getId(); - setValue(key + "/build_file_path/compilation_db_path", getCompilationDatabasePath().str(), config); + setValue(key + "/build_file_path/compilation_db_path", getCompilationDatabasePath().wstr(), config); } bool SourceGroupSettingsCxxCdb::equals(std::shared_ptr other) const diff --git a/src/lib/settings/SourceGroupSettingsJavaGradle.cpp b/src/lib/settings/SourceGroupSettingsJavaGradle.cpp index c7787cb8..93942393 100644 --- a/src/lib/settings/SourceGroupSettingsJavaGradle.cpp +++ b/src/lib/settings/SourceGroupSettingsJavaGradle.cpp @@ -18,8 +18,8 @@ void SourceGroupSettingsJavaGradle::load(std::shared_ptr co const std::string key = s_keyPrefix + getId(); - setGradleProjectFilePath(FilePath(getValue(key + "/gradle/project_file_path", "", config))); - setGradleDependenciesDirectory(FilePath(getValue(key + "/gradle/dependencies_directory", "", config))); + setGradleProjectFilePath(FilePath(getValue(key + "/gradle/project_file_path", L"", config))); + setGradleDependenciesDirectory(FilePath(getValue(key + "/gradle/dependencies_directory", L"", config))); setShouldIndexGradleTests(getValue(key + "/gradle/should_index_tests", false, config)); } @@ -29,8 +29,8 @@ void SourceGroupSettingsJavaGradle::save(std::shared_ptr config) const std::string key = s_keyPrefix + getId(); - setValue(key + "/gradle/project_file_path", getGradleProjectFilePath().str(), config); - setValue(key + "/gradle/dependencies_directory", getGradleDependenciesDirectory().str(), config); + setValue(key + "/gradle/project_file_path", getGradleProjectFilePath().wstr(), config); + setValue(key + "/gradle/dependencies_directory", getGradleDependenciesDirectory().wstr(), config); setValue(key + "/gradle/should_index_tests", getShouldIndexGradleTests(), config); } diff --git a/src/lib/settings/SourceGroupSettingsJavaMaven.cpp b/src/lib/settings/SourceGroupSettingsJavaMaven.cpp index f9d25217..85a3454a 100644 --- a/src/lib/settings/SourceGroupSettingsJavaMaven.cpp +++ b/src/lib/settings/SourceGroupSettingsJavaMaven.cpp @@ -18,8 +18,8 @@ void SourceGroupSettingsJavaMaven::load(std::shared_ptr con const std::string key = s_keyPrefix + getId(); - setMavenProjectFilePath(FilePath(getValue(key + "/maven/project_file_path", "", config))); - setMavenDependenciesDirectory(FilePath(getValue(key + "/maven/dependencies_directory", "", config))); + setMavenProjectFilePath(FilePath(getValue(key + "/maven/project_file_path", L"", config))); + setMavenDependenciesDirectory(FilePath(getValue(key + "/maven/dependencies_directory", L"", config))); setShouldIndexMavenTests(getValue(key + "/maven/should_index_tests", false, config)); } @@ -29,8 +29,8 @@ void SourceGroupSettingsJavaMaven::save(std::shared_ptr config) const std::string key = s_keyPrefix + getId(); - setValue(key + "/maven/project_file_path", getMavenProjectFilePath().str(), config); - setValue(key + "/maven/dependencies_directory", getMavenDependenciesDirectory().str(), config); + setValue(key + "/maven/project_file_path", getMavenProjectFilePath().wstr(), config); + setValue(key + "/maven/dependencies_directory", getMavenDependenciesDirectory().wstr(), config); setValue(key + "/maven/should_index_tests", getShouldIndexMavenTests(), config); } diff --git a/src/lib/utility/AppPath.cpp b/src/lib/utility/AppPath.cpp index d220da79..924b4088 100644 --- a/src/lib/utility/AppPath.cpp +++ b/src/lib/utility/AppPath.cpp @@ -1,15 +1,13 @@ #include "AppPath.h" -#include +FilePath AppPath::m_appPath(L""); -std::string AppPath::m_appPath = ""; - -std::string AppPath::getAppPath() +FilePath AppPath::getAppPath() { return m_appPath; } -bool AppPath::setAppPath(std::string path) +bool AppPath::setAppPath(const FilePath& path) { if(!path.empty()) { diff --git a/src/lib/utility/AppPath.h b/src/lib/utility/AppPath.h index 81fd767f..21f1a4a4 100644 --- a/src/lib/utility/AppPath.h +++ b/src/lib/utility/AppPath.h @@ -1,22 +1,16 @@ #ifndef APP_PATH_H #define APP_PATH_H -#include - -#ifdef _WIN32 -#define WIN32_LEAN_AND_MEAN -#define NOMINMAX -#include -#endif // _WIN32 +#include "utility/file/FilePath.h" class AppPath { public: - static std::string getAppPath(); - static bool setAppPath(std::string path); + static FilePath getAppPath(); + static bool setAppPath(const FilePath& path); private: - static std::string m_appPath; + static FilePath m_appPath; }; #endif // APP_PATH_H diff --git a/src/lib/utility/ConfigManager.cpp b/src/lib/utility/ConfigManager.cpp index c6f4dea4..eead56cf 100644 --- a/src/lib/utility/ConfigManager.cpp +++ b/src/lib/utility/ConfigManager.cpp @@ -8,6 +8,7 @@ #include "utility/text/TextAccess.h" #include "utility/utility.h" #include "utility/utilityString.h" +#include "utility/utilityQString.h" std::shared_ptr ConfigManager::createEmpty() { @@ -50,6 +51,17 @@ bool ConfigManager::getValue(const std::string& key, std::string& value) const } } +bool ConfigManager::getValue(const std::string& key, std::wstring& value) const +{ + std::string valueString; + if (getValue(key, valueString)) + { + value = utility::decodeFromUtf8(valueString.c_str()); + return true; + } + return false; +} + bool ConfigManager::getValue(const std::string& key, int& value) const { std::string valueString; @@ -110,6 +122,21 @@ bool ConfigManager::getValues(const std::string& key, std::vector& } } +bool ConfigManager::getValues(const std::string& key, std::vector& values) const +{ + std::vector valuesStringVector; + if (getValues(key, valuesStringVector)) + { + for (const std::string& valueString : valuesStringVector) + { + values.push_back(utility::decodeFromUtf8(valueString)); + } + return true; + } + return false; +} + + bool ConfigManager::getValues(const std::string& key, std::vector& values) const { std::vector valuesStringVector; @@ -166,6 +193,11 @@ void ConfigManager::setValue(const std::string& key, const std::string& value) } } +void ConfigManager::setValue(const std::string& key, const std::wstring& value) +{ + setValue(key, utility::encodeToUtf8(value)); +} + void ConfigManager::setValue(const std::string& key, const int value) { setValue(key, std::to_string(value)); @@ -197,6 +229,16 @@ void ConfigManager::setValues(const std::string& key, const std::vector& values) +{ + std::vector stringValues; + for (std::wstring v : values) + { + stringValues.push_back(utility::encodeToUtf8(v)); + } + setValues(key, stringValues); +} + void ConfigManager::setValues(const std::string& key, const std::vector& values) { std::vector stringValues; diff --git a/src/lib/utility/ConfigManager.h b/src/lib/utility/ConfigManager.h index 1a57e688..e4db852a 100644 --- a/src/lib/utility/ConfigManager.h +++ b/src/lib/utility/ConfigManager.h @@ -19,21 +19,25 @@ public: void clear(); bool getValue(const std::string& key, std::string& value) const; + bool getValue(const std::string& key, std::wstring& value) const; bool getValue(const std::string& key, int& value) const; bool getValue(const std::string& key, float& value) const; bool getValue(const std::string& key, bool& value) const; bool getValues(const std::string& key, std::vector& values) const; + bool getValues(const std::string& key, std::vector& values) const; bool getValues(const std::string& key, std::vector& values) const; bool getValues(const std::string& key, std::vector& values) const; bool getValues(const std::string& key, std::vector& values) const; void setValue(const std::string& key, const std::string& value); + void setValue(const std::string& key, const std::wstring& value); void setValue(const std::string& key, const int value); void setValue(const std::string& key, const float value); void setValue(const std::string& key, const bool value); void setValues(const std::string& key, const std::vector& values); + void setValues(const std::string& key, const std::vector& values); void setValues(const std::string& key, const std::vector& values); void setValues(const std::string& key, const std::vector& values); void setValues(const std::string& key, const std::vector& values); @@ -52,7 +56,7 @@ public: private: ConfigManager(); ConfigManager(const ConfigManager&); - void operator=(const ConfigManager&); + void operator=(const ConfigManager&) = delete; void parseSubtree(TiXmlNode* parentElement, const std::string& currentPath); bool createXmlDocument(bool saveAsFile, std::string filepath, std::string& output); diff --git a/src/lib/utility/ResourcePaths.cpp b/src/lib/utility/ResourcePaths.cpp index bce6ca40..63d2bdb6 100644 --- a/src/lib/utility/ResourcePaths.cpp +++ b/src/lib/utility/ResourcePaths.cpp @@ -4,25 +4,25 @@ FilePath ResourcePaths::getColorSchemesPath() { - return FilePath(AppPath::getAppPath() + "data/color_schemes/"); + return AppPath::getAppPath().concatenate(L"data/color_schemes/"); } FilePath ResourcePaths::getFallbackPath() { - return FilePath(AppPath::getAppPath() + "data/fallback/"); + return AppPath::getAppPath().concatenate(L"data/fallback/"); } FilePath ResourcePaths::getFontsPath() { - return FilePath(AppPath::getAppPath() + "data/fonts/"); + return AppPath::getAppPath().concatenate(L"data/fonts/"); } FilePath ResourcePaths::getGuiPath() { - return FilePath(AppPath::getAppPath() + "data/gui/"); + return AppPath::getAppPath().concatenate(L"data/gui/"); } FilePath ResourcePaths::getJavaPath() { - return FilePath(AppPath::getAppPath() + "data/java/"); + return AppPath::getAppPath().concatenate(L"data/java/"); } diff --git a/src/lib/utility/Status.h b/src/lib/utility/Status.h index 37d87137..00cfa2cd 100644 --- a/src/lib/utility/Status.h +++ b/src/lib/utility/Status.h @@ -13,13 +13,13 @@ typedef int StatusFilter; struct Status { - Status(std::string message, bool isError = false) + Status(std::wstring message, bool isError = false) : message(message) , type(isError ? StatusType::STATUS_ERROR : StatusType::STATUS_INFO) { } - std::string message; + std::wstring message; StatusType type; }; diff --git a/src/lib/utility/UserPaths.cpp b/src/lib/utility/UserPaths.cpp index d8c6fb8b..52c75818 100644 --- a/src/lib/utility/UserPaths.cpp +++ b/src/lib/utility/UserPaths.cpp @@ -14,15 +14,15 @@ void UserPaths::setUserDataPath(const FilePath& path) FilePath UserPaths::getAppSettingsPath() { - return getUserDataPath().concatenate(FilePath("ApplicationSettings.xml")); + return getUserDataPath().concatenate(L"ApplicationSettings.xml"); } FilePath UserPaths::getWindowSettingsPath() { - return getUserDataPath().concatenate(FilePath("window_settings.ini")); + return getUserDataPath().concatenate(L"window_settings.ini"); } FilePath UserPaths::getLogPath() { - return getUserDataPath().concatenate(FilePath("log/")); + return getUserDataPath().concatenate(L"log/"); } diff --git a/src/lib/utility/commandline/CommandLineParser.cpp b/src/lib/utility/commandline/CommandLineParser.cpp index b880b73e..06dd02f8 100644 --- a/src/lib/utility/commandline/CommandLineParser.cpp +++ b/src/lib/utility/commandline/CommandLineParser.cpp @@ -188,7 +188,7 @@ bool CommandLineParser::hasError() return !m_errorString.empty(); } -std::string CommandLineParser::getError() +std::wstring CommandLineParser::getError() { return m_errorString; } @@ -220,18 +220,18 @@ void CommandLineParser::processProjectfile() { m_projectFile.makeAbsolute(); - const std::string errorstring = - "Provided Projectfile is not valid:\n* Provided Projectfile('" + m_projectFile.fileName() + "') "; + const std::wstring errorstring = + L"Provided Projectfile is not valid:\n* Provided Projectfile('" + m_projectFile.wFileName() + L"') "; if (!m_projectFile.exists()) { - m_errorString = errorstring + " does not exist"; + m_errorString = errorstring + L" does not exist"; m_projectFile = FilePath(); return; } if (m_projectFile.extension() != ".srctrlprj" && m_projectFile.extension() != ".coatiproject") { - m_errorString = errorstring + " has a wrong file ending"; + m_errorString = errorstring + L" has a wrong file ending"; m_projectFile = FilePath(); return; } @@ -239,7 +239,7 @@ void CommandLineParser::processProjectfile() std::shared_ptr configManager = ConfigManager::createEmpty(); if (!configManager->load(TextAccess::createFromFile(m_projectFile))) { - m_errorString = errorstring + " could not be loaded (invalid)"; + m_errorString = errorstring + L" could not be loaded (invalid)"; m_projectFile = FilePath(); return; } diff --git a/src/lib/utility/commandline/CommandLineParser.h b/src/lib/utility/commandline/CommandLineParser.h index c15f7169..6de968a4 100644 --- a/src/lib/utility/commandline/CommandLineParser.h +++ b/src/lib/utility/commandline/CommandLineParser.h @@ -41,7 +41,7 @@ public: void fullRefresh(); void incompleteRefresh(); - std::string getError(); + std::wstring getError(); License getLicense(); License* getLicensePtr(); @@ -66,7 +66,7 @@ private: boost::program_options::options_description m_options; boost::program_options::positional_options_description m_positional; - std::string m_errorString; + std::wstring m_errorString; License m_license; std::vector m_args; diff --git a/src/lib/utility/commandline/commands/CommandlineCommandConfig.cpp b/src/lib/utility/commandline/commands/CommandlineCommandConfig.cpp index d704db55..a91b4a62 100644 --- a/src/lib/utility/commandline/commands/CommandlineCommandConfig.cpp +++ b/src/lib/utility/commandline/commands/CommandlineCommandConfig.cpp @@ -136,7 +136,7 @@ void CommandConfig::printSettings(ApplicationSettings* settings) << "\n use-processes: " << settings->getMultiProcessIndexingEnabled() << "\n logging-enabled: " << settings->getLoggingEnabled() << "\n verbose-indexer-logging-enabled: " << settings->getVerboseIndexerLoggingEnabled() - << "\n jvm-path: " << settings->getJavaPath() + << "\n jvm-path: " << settings->getJavaPath().str() << "\n jvm-max-memory: " << settings->getJavaMaximumMemory() << "\n maven-path: " << settings->getMavenPath().str(); printVector("global-header-search-paths", settings->getHeaderSearchPaths()); diff --git a/src/lib/utility/file/FileInfo.cpp b/src/lib/utility/file/FileInfo.cpp index b0a8a304..46f5baa7 100644 --- a/src/lib/utility/file/FileInfo.cpp +++ b/src/lib/utility/file/FileInfo.cpp @@ -1,7 +1,7 @@ #include "FileInfo.h" FileInfo::FileInfo() - : path(FilePath("")) + : path(FilePath(L"")) { } diff --git a/src/lib/utility/file/FilePath.cpp b/src/lib/utility/file/FilePath.cpp index 70a7843a..730f0c5e 100644 --- a/src/lib/utility/file/FilePath.cpp +++ b/src/lib/utility/file/FilePath.cpp @@ -18,16 +18,6 @@ FilePath::FilePath() { } -FilePath::FilePath(const char* filePath) - : m_path(std::make_unique(filePath)) - , m_exists(false) - , m_checkedExists(false) - , m_isDirectory(false) - , m_checkedIsDirectory(false) - , m_canonicalized(false) -{ -} - FilePath::FilePath(const std::string& filePath) : m_path(std::make_unique(filePath)) , m_exists(false) @@ -38,7 +28,7 @@ FilePath::FilePath(const std::string& filePath) { } -FilePath::FilePath(const boost::filesystem::path& filePath) +FilePath::FilePath(const std::wstring& filePath) : m_path(std::make_unique(filePath)) , m_exists(false) , m_checkedExists(false) @@ -127,7 +117,7 @@ bool FilePath::isAbsolute() const FilePath FilePath::getParentDirectory() const { - FilePath parentDirectory(m_path->parent_path()); + FilePath parentDirectory(m_path->parent_path().wstring()); if (!parentDirectory.empty()) { @@ -320,6 +310,25 @@ FilePath FilePath::getConcatenated(const FilePath& other) const return path; } +FilePath& FilePath::concatenate(const std::wstring& other) +{ + m_path->operator/=(other); + m_exists = false; + m_checkedExists = false; + m_isDirectory = false; + m_checkedIsDirectory = false; + m_canonicalized = false; + + return *this; +} + +FilePath FilePath::getConcatenated(const std::wstring& other) const +{ + FilePath path(*this); + path.concatenate(other); + return path; +} + bool FilePath::contains(const FilePath& other) const { if (!isDirectory()) @@ -362,6 +371,11 @@ std::string FilePath::str() const return m_path->generic_string(); } +std::wstring FilePath::wstr() const +{ + return m_path->generic_wstring(); +} + std::string FilePath::getBackslashedString() const { return utility::replace(str(), "/", "\\"); @@ -372,6 +386,11 @@ std::string FilePath::fileName() const return m_path->filename().generic_string(); } +std::wstring FilePath::wFileName() const +{ + return m_path->filename().generic_wstring(); +} + std::string FilePath::extension() const { return m_path->extension().generic_string(); @@ -379,12 +398,12 @@ std::string FilePath::extension() const FilePath FilePath::withoutExtension() const { - return FilePath(getPath().replace_extension()); + return FilePath(getPath().replace_extension().wstring()); } FilePath FilePath::replaceExtension(const std::string& extension) const { - return FilePath(getPath().replace_extension(extension)); + return FilePath(getPath().replace_extension(extension).wstring()); } bool FilePath::hasExtension(const std::vector& extensions) const diff --git a/src/lib/utility/file/FilePath.h b/src/lib/utility/file/FilePath.h index bd87f8ff..d93f61ca 100644 --- a/src/lib/utility/file/FilePath.h +++ b/src/lib/utility/file/FilePath.h @@ -17,9 +17,8 @@ class FilePath { public: FilePath(); - explicit FilePath(const char* filePath); explicit FilePath(const std::string& filePath); - explicit FilePath(const boost::filesystem::path& filePath); + explicit FilePath(const std::wstring& filePath); FilePath(const FilePath& other); FilePath(FilePath&& other); FilePath(const std::string& filePath, const std::string& base); @@ -43,13 +42,17 @@ public: FilePath getRelativeTo(const FilePath& other) const; FilePath& concatenate(const FilePath& other); FilePath getConcatenated(const FilePath& other) const; + FilePath& concatenate(const std::wstring& other); + FilePath getConcatenated(const std::wstring& other) const; std::vector expandEnvironmentVariables() const; bool contains(const FilePath& other) const; std::string str() const; + std::wstring wstr() const; std::string getBackslashedString() const; std::string fileName() const; + std::wstring wFileName() const; std::string extension() const; FilePath withoutExtension() const; diff --git a/src/lib/utility/file/FileRegister.cpp b/src/lib/utility/file/FileRegister.cpp index 088fed8f..c4f2f1bd 100644 --- a/src/lib/utility/file/FileRegister.cpp +++ b/src/lib/utility/file/FileRegister.cpp @@ -13,7 +13,7 @@ FileRegister::FileRegister( , m_indexedPaths(indexedPaths) , m_excludedPaths(excludedPaths) , m_hasFilePathCache( - [&](const std::string& f) + [&](const std::wstring& f) { const FilePath filePath(f); bool ret = false; @@ -101,5 +101,5 @@ bool FileRegister::fileIsIndexed(const FilePath& filePath) const bool FileRegister::hasFilePath(const FilePath& filePath) const { - return m_hasFilePathCache.getValue(filePath.str()); + return m_hasFilePathCache.getValue(filePath.wstr()); } diff --git a/src/lib/utility/file/FileRegister.h b/src/lib/utility/file/FileRegister.h index 73951072..63d6ba1a 100644 --- a/src/lib/utility/file/FileRegister.h +++ b/src/lib/utility/file/FileRegister.h @@ -29,7 +29,7 @@ private: const FilePath& m_currentPath; const std::set m_indexedPaths; const std::set m_excludedPaths; - mutable UnorderedCache m_hasFilePathCache; + mutable UnorderedCache m_hasFilePathCache; }; #endif // FILE_REGISTER_H diff --git a/src/lib/utility/file/FileSystem.cpp b/src/lib/utility/file/FileSystem.cpp index 68a81320..a4162eea 100644 --- a/src/lib/utility/file/FileSystem.cpp +++ b/src/lib/utility/file/FileSystem.cpp @@ -32,7 +32,7 @@ std::vector FileSystem::getFilePathsFromDirectory( if (boost::filesystem::is_regular_file(*it) && (ext.empty() || ext.find(it->path().extension().string()) != ext.end())) { - files.push_back(FilePath(it->path().generic_string())); + files.push_back(FilePath(it->path().generic_wstring())); } ++it; } @@ -111,7 +111,7 @@ std::vector FileSystem::getFileInfosFromPaths( continue; } filePaths.insert(p); - files.push_back(getFileInfoForPath(FilePath(it->path()))); + files.push_back(getFileInfoForPath(FilePath(it->path().wstring()))); } } } @@ -175,7 +175,7 @@ std::set FileSystem::getSymLinkedDirectories(const std::vector files; for (auto& p : symlinkDirs) { - files.insert(FilePath(p)); + files.insert(FilePath(p.wstring())); } return files; } @@ -254,7 +254,7 @@ std::vector FileSystem::getDirectSubDirectories(const FilePath& path) { if (boost::filesystem::is_directory(dir->path())) { - v.push_back(FilePath(dir->path())); + v.push_back(FilePath(dir->path().wstring())); } } } @@ -272,7 +272,7 @@ std::vector FileSystem::getRecursiveSubDirectories(const FilePath &pat { if (boost::filesystem::is_directory(dir->path())) { - v.push_back(FilePath(dir->path())); + v.push_back(FilePath(dir->path().wstring())); } } } diff --git a/src/lib/utility/logging/FileLogger.cpp b/src/lib/utility/logging/FileLogger.cpp index d77085cc..4bb63749 100644 --- a/src/lib/utility/logging/FileLogger.cpp +++ b/src/lib/utility/logging/FileLogger.cpp @@ -9,7 +9,7 @@ FileLogger::FileLogger() : Logger("FileLogger") , m_logFileName("log") - , m_logDirectory("user/log/") + , m_logDirectory(L"user/log/") , m_maxLogLineCount(0) , m_maxLogFileCount(0) , m_currentLogLineCount(0) diff --git a/src/lib/utility/logging/LogManager.cpp b/src/lib/utility/logging/LogManager.cpp index f566aa34..e9620028 100644 --- a/src/lib/utility/logging/LogManager.cpp +++ b/src/lib/utility/logging/LogManager.cpp @@ -6,6 +6,7 @@ #include "utility/messaging/type/MessageStatus.h" #include "utility/utility.h" #include "utility/Version.h" +#include "utility/utilityQString.h" std::shared_ptr LogManager::getInstance() { @@ -38,12 +39,12 @@ void LogManager::setLoggingEnabled(bool enabled) (utility::getApplicationArchitectureType() == APPLICATION_ARCHITECTURE_X86_32 ? "32" : "64") + " bit, " + "version " + Version::getApplicationVersion().toDisplayString() ); - MessageStatus("Enabled console and file logging.").dispatch(); + MessageStatus(L"Enabled console and file logging.").dispatch(); } else { LOG_INFO("Disabled logging"); - MessageStatus("Disabled console and file logging.").dispatch(); + MessageStatus(L"Disabled console and file logging.").dispatch(); } } } @@ -96,6 +97,19 @@ void LogManager::logInfo( } } +void LogManager::logInfo( + const std::wstring& message, + const std::string& file, + const std::string& function, + const unsigned int line +) +{ + if (m_loggingEnabled) + { + m_logManagerImplementation.logInfo(utility::encodeToUtf8(message), file, function, line); + } +} + void LogManager::logWarning( const std::string& message, const std::string& file, @@ -109,6 +123,19 @@ void LogManager::logWarning( } } +void LogManager::logWarning( + const std::wstring& message, + const std::string& file, + const std::string& function, + const unsigned int line +) +{ + if (m_loggingEnabled) + { + m_logManagerImplementation.logWarning(utility::encodeToUtf8(message), file, function, line); + } +} + void LogManager::logError( const std::string& message, const std::string& file, @@ -122,6 +149,19 @@ void LogManager::logError( } } +void LogManager::logError( + const std::wstring& message, + const std::string& file, + const std::string& function, + const unsigned int line +) +{ + if (m_loggingEnabled) + { + m_logManagerImplementation.logError(utility::encodeToUtf8(message), file, function, line); + } +} + std::shared_ptr LogManager::s_instance; LogManager::LogManager() diff --git a/src/lib/utility/logging/LogManager.h b/src/lib/utility/logging/LogManager.h index 35206f83..75f8a18e 100644 --- a/src/lib/utility/logging/LogManager.h +++ b/src/lib/utility/logging/LogManager.h @@ -30,18 +30,36 @@ public: const std::string& function, const unsigned int line ); + void logInfo( + const std::wstring& message, + const std::string& file, + const std::string& function, + const unsigned int line + ); void logWarning( const std::string& message, const std::string& file, const std::string& function, const unsigned int line ); + void logWarning( + const std::wstring& message, + const std::string& file, + const std::string& function, + const unsigned int line + ); void logError( const std::string& message, const std::string& file, const std::string& function, const unsigned int line ); + void logError( + const std::wstring& message, + const std::string& file, + const std::string& function, + const unsigned int line + ); private: static std::shared_ptr s_instance; diff --git a/src/lib/utility/messaging/type/MessageMoveIDECursor.h b/src/lib/utility/messaging/type/MessageMoveIDECursor.h index 03a46672..044f507d 100644 --- a/src/lib/utility/messaging/type/MessageMoveIDECursor.h +++ b/src/lib/utility/messaging/type/MessageMoveIDECursor.h @@ -1,12 +1,13 @@ #ifndef MESSAGE_MOVE_IDE_CURSOR_H #define MESSAGE_MOVE_IDE_CURSOR_H +#include "utility/file/FilePath.h" #include "utility/messaging/Message.h" class MessageMoveIDECursor : public Message { public: - MessageMoveIDECursor(const std::string& FilePos, const unsigned int Row, const unsigned int Column) + MessageMoveIDECursor(const FilePath& FilePos, const unsigned int Row, const unsigned int Column) : FilePosition(FilePos) , Row(Row) , Column(Column) @@ -20,10 +21,10 @@ public: virtual void print(std::ostream& os) const { - os << FilePosition << ":" << Row << ":" << Column; + os << FilePosition.str() << ":" << Row << ":" << Column; } - const std::string FilePosition; + const FilePath FilePosition; const unsigned int Row; const unsigned int Column; }; diff --git a/src/lib/utility/messaging/type/MessageStatus.cpp b/src/lib/utility/messaging/type/MessageStatus.cpp new file mode 100644 index 00000000..13444ae0 --- /dev/null +++ b/src/lib/utility/messaging/type/MessageStatus.cpp @@ -0,0 +1,74 @@ +#include "utility/messaging/type/MessageStatus.h" + +#include "utility/utilityQString.h" +#include "utility/utilityString.h" + +MessageStatus::MessageStatus(const std::string& status, bool isError, bool showLoader) + : isError(isError) + , showLoader(showLoader) +{ + m_stati.push_back(utility::decodeFromUtf8(utility::replace(status, "\n", " "))); + + setSendAsTask(false); +} + +MessageStatus::MessageStatus(const std::wstring& status, bool isError, bool showLoader) + : isError(isError) + , showLoader(showLoader) +{ + m_stati.push_back(utility::replace(status, L"\n", L" ")); + + setSendAsTask(false); +} + +MessageStatus::MessageStatus(const std::vector& stati, bool isError, bool showLoader) + : isError(isError) + , showLoader(showLoader) + , m_stati(stati) +{ + setSendAsTask(false); +} + +const std::string MessageStatus::getStaticType() +{ + return "MessageStatus"; +} + +const std::vector& MessageStatus::stati() const +{ + return m_stati; +} + +std::wstring MessageStatus::status() const +{ + if (m_stati.size()) + { + return m_stati[0]; + } + + return L""; +} + +void MessageStatus::print(std::ostream& os) const +{ + for (const std::wstring& status : m_stati) + { + os << utility::encodeToUtf8(status); + + if (m_stati.size() > 1) + { + os << " - "; + } + } + + if (isError) + { + os << " - error"; + } + + if (showLoader) + { + os << " - loading"; + } +} + diff --git a/src/lib/utility/messaging/type/MessageStatus.h b/src/lib/utility/messaging/type/MessageStatus.h index 784b3756..a1341813 100644 --- a/src/lib/utility/messaging/type/MessageStatus.h +++ b/src/lib/utility/messaging/type/MessageStatus.h @@ -1,80 +1,30 @@ #ifndef MESSAGE_STATUS_H #define MESSAGE_STATUS_H +#include #include #include "utility/messaging/Message.h" -#include "utility/utilityString.h" class MessageStatus : public Message { public: - MessageStatus(const std::string& status, bool isError = false, bool showLoader = false) - : isError(isError) - , showLoader(showLoader) - { - m_stati.push_back(utility::replace(status, "\n", " ")); + MessageStatus(const std::string& status, bool isError = false, bool showLoader = false); + MessageStatus(const std::wstring& status, bool isError = false, bool showLoader = false); + MessageStatus(const std::vector& stati, bool isError = false, bool showLoader = false); - setSendAsTask(false); - } + static const std::string getStaticType(); - MessageStatus(const std::vector& stati, bool isError = false, bool showLoader = false) - : isError(isError) - , showLoader(showLoader) - , m_stati(stati) - { - setSendAsTask(false); - } - - static const std::string getStaticType() - { - return "MessageStatus"; - } - - const std::vector& stati() const - { - return m_stati; - } - - std::string status() const - { - if (m_stati.size()) - { - return m_stati[0]; - } - - return ""; - } - - virtual void print(std::ostream& os) const - { - for (const std::string& status : m_stati) - { - os << status; - - if (m_stati.size() > 1) - { - os << " - "; - } - } - - if (isError) - { - os << " - error"; - } - - if (showLoader) - { - os << " - loading"; - } - } + const std::vector& stati() const; + std::wstring status() const; + virtual void print(std::ostream& os) const; const bool isError; const bool showLoader; private: - std::vector m_stati; + std::vector m_stati; }; #endif // MESSAGE_STATUS_H diff --git a/src/lib/utility/text/TextAccess.cpp b/src/lib/utility/text/TextAccess.cpp index 7bea33c4..b98cea71 100644 --- a/src/lib/utility/text/TextAccess.cpp +++ b/src/lib/utility/text/TextAccess.cpp @@ -134,7 +134,7 @@ std::vector TextAccess::splitStringByLines(const std::string& text) } TextAccess::TextAccess() - : m_filePath("") + : m_filePath(L"") { } diff --git a/src/lib/utility/utilityString.cpp b/src/lib/utility/utilityString.cpp index 6e1b70e1..7ce76ea6 100644 --- a/src/lib/utility/utilityString.cpp +++ b/src/lib/utility/utilityString.cpp @@ -5,6 +5,28 @@ #include #include +namespace +{ + template + StringType doRreplace(StringType str, const StringType& from, const StringType& to) + { + size_t pos = 0; + + if (from.size() == 0) + { + return str; + } + + while ((pos = str.find(from, pos)) != std::string::npos) + { + str.replace(pos, from.length(), to); + pos += to.length(); + } + + return str; + } +} + namespace utility { std::deque split(const std::string& str, char delimiter) @@ -199,20 +221,12 @@ namespace utility std::string replace(std::string str, const std::string& from, const std::string& to) { - size_t pos = 0; + return doRreplace(str, from, to); + } - if (from.size() == 0) - { - return str; - } - - while ((pos = str.find(from, pos)) != std::string::npos) - { - str.replace(pos, from.length(), to); - pos += to.length(); - } - - return str; + std::wstring replace(std::wstring str, const std::wstring& from, const std::wstring& to) + { + return doRreplace(str, from, to); } std::string replaceBetween(const std::string& str, char startDelimiter, char endDelimiter, const std::string& to) diff --git a/src/lib/utility/utilityString.h b/src/lib/utility/utilityString.h index 1cd6b3ef..2be4cbb7 100644 --- a/src/lib/utility/utilityString.h +++ b/src/lib/utility/utilityString.h @@ -45,6 +45,8 @@ namespace utility bool equalsCaseInsensitive(const std::string& a, const std::string& b); std::string replace(std::string str, const std::string& from, const std::string& to); + std::wstring replace(std::wstring str, const std::wstring& from, const std::wstring& to); + std::string replaceBetween(const std::string& str, char startDelimiter, char endDelimiter, const std::string& to); std::string insertLineBreaksAtBlankSpaces(const std::string& s, size_t maxLineLength); diff --git a/src/lib_cxx/data/parser/cxx/utilityClang.cpp b/src/lib_cxx/data/parser/cxx/utilityClang.cpp index fabd6820..69eb0994 100644 --- a/src/lib_cxx/data/parser/cxx/utilityClang.cpp +++ b/src/lib_cxx/data/parser/cxx/utilityClang.cpp @@ -120,7 +120,7 @@ std::string utility::getFileNameOfFileEntry(const clang::FileEntry* entry) } else { - fileName = FilePath(entry->getName().str()).getParentDirectory().concatenate(FilePath(FilePath(fileName).fileName())).str(); + fileName = FilePath(entry->getName().str()).getParentDirectory().concatenate(FilePath(fileName).wFileName()).str(); } } return fileName; diff --git a/src/lib_cxx/project/SourceGroupCxxCdb.cpp b/src/lib_cxx/project/SourceGroupCxxCdb.cpp index d2d886d0..41299de9 100644 --- a/src/lib_cxx/project/SourceGroupCxxCdb.cpp +++ b/src/lib_cxx/project/SourceGroupCxxCdb.cpp @@ -28,17 +28,15 @@ bool SourceGroupCxxCdb::prepareIndexing() FilePath cdbPath = m_settings->getCompilationDatabasePathExpandedAndAbsolute(); if (!cdbPath.empty() && !cdbPath.exists()) { - MessageStatus("Can't refresh project").dispatch(); + MessageStatus(L"Can't refresh project").dispatch(); if (std::shared_ptr application = Application::getInstance()) { if (application->hasGUI()) { - std::vector options; - options.push_back("Ok"); application->handleDialog( - "Can't refresh. The compilation database of the project does not exist anymore: " + cdbPath.str(), - options + L"Can't refresh. The compilation database of the project does not exist anymore: " + cdbPath.wstr(), + { L"Ok" } ); } } diff --git a/src/lib_gui/CMakeLists.txt b/src/lib_gui/CMakeLists.txt index f1fa3408..e7dc9d68 100644 --- a/src/lib_gui/CMakeLists.txt +++ b/src/lib_gui/CMakeLists.txt @@ -285,5 +285,7 @@ add_files( utility/utilityApp.h utility/utilityPathDetection.cpp utility/utilityPathDetection.h + utility/utilityQString.cpp + utility/utilityQString.h ) diff --git a/src/lib_gui/platform_includes/includesLinux.h b/src/lib_gui/platform_includes/includesLinux.h index 50d72947..f6c70ef7 100644 --- a/src/lib_gui/platform_includes/includesLinux.h +++ b/src/lib_gui/platform_includes/includesLinux.h @@ -46,7 +46,7 @@ void setupApp(int argc, char *argv[]) { if (AppPath::getAppPath().empty()) { - AppPath::setAppPath(QCoreApplication::applicationDirPath().toStdString() + "/"); + AppPath::setAppPath(FilePath(QCoreApplication::applicationDirPath().toStdWString() + L"/")); } std::string userdir(std::getenv("HOME")); @@ -67,8 +67,8 @@ void setupApp(int argc, char *argv[]) } } - utility::copyNewFilesFromDirectory(QString::fromStdString(ResourcePaths::getFallbackPath().str()), userDataPath); - utility::copyNewFilesFromDirectory(QString::fromStdString(AppPath::getAppPath() + "/user/" ), userDataPath); + utility::copyNewFilesFromDirectory(QString::fromStdWString(ResourcePaths::getFallbackPath().wstr()), userDataPath); + utility::copyNewFilesFromDirectory(QString::fromStdWString(AppPath::getAppPath().concatenate(L"user/").wstr()), userDataPath); } #endif // INCLUDES_DEFAULT_H diff --git a/src/lib_gui/platform_includes/includesMac.h b/src/lib_gui/platform_includes/includesMac.h index 0787cc0f..78bf434a 100644 --- a/src/lib_gui/platform_includes/includesMac.h +++ b/src/lib_gui/platform_includes/includesMac.h @@ -15,7 +15,7 @@ void setupPlatform(int argc, char *argv[]) { - UserPaths::setUserDataPath(FilePath("./user/")); + UserPaths::setUserDataPath(FilePath(L"./user/")); // ---------------------------------------------------------------------------- // This makes relative paths work in C++ in Xcode by changing directory to the Resources folder inside the .app bundle @@ -58,7 +58,7 @@ void setupPlatform(int argc, char *argv[]) // ---------------------------------------------------------------------------- // Makes the mac bundle copy the user files to the Application Support folder QString dataPath = QStandardPaths::writableLocation(QStandardPaths::DataLocation); - QString oldDataPath = QString::fromStdString(ResourcePaths::getFallbackPath().str()); + QString oldDataPath = QString::fromStdWString(ResourcePaths::getFallbackPath().wstr()); QDir dataDir(dataPath); if (!dataDir.exists()) @@ -81,13 +81,13 @@ void setupPlatform(int argc, char *argv[]) utility::copyNewFilesFromDirectory(oldDataPath, dataPath); // ---------------------------------------------------------------------------- - UserPaths::setUserDataPath(FilePath(dataPath.toStdString() + "/")); + UserPaths::setUserDataPath(FilePath(dataPath.toStdWString() + L"/")); } void setupApp(int argc, char *argv[]) { - FilePath path(QDir::currentPath().toStdString()); - AppPath::setAppPath(path.getAbsolute().str() + "/"); + const FilePath path(QDir::currentPath().toStdWString() + L"/"); + AppPath::setAppPath(path.getAbsolute()); } #endif // INCLUDES_MAC_H diff --git a/src/lib_gui/platform_includes/includesWindows.h b/src/lib_gui/platform_includes/includesWindows.h index 8fb33109..78f7c125 100644 --- a/src/lib_gui/platform_includes/includesWindows.h +++ b/src/lib_gui/platform_includes/includesWindows.h @@ -36,21 +36,20 @@ void setupApp(int argc, char *argv[]) { appPath = appPath.substr(0, pos + 1); } - AppPath::setAppPath(FilePath(appPath).str()); } { - FilePath userDataPath(AppPath::getAppPath() + "user/"); + FilePath userDataPath = AppPath::getAppPath().concatenate(L"user/"); if (!userDataPath.exists()) { userDataPath = FilePath(std::string(std::getenv("APPDATA")) + "/../local/Coati Software/"); if (utility::getApplicationArchitectureType() == APPLICATION_ARCHITECTURE_X86_64) { - userDataPath.concatenate(FilePath("Sourcetrail 64-bit/")); + userDataPath.concatenate(L"Sourcetrail 64-bit/"); } else { - userDataPath.concatenate(FilePath("Sourcetrail/")); + userDataPath.concatenate(L"Sourcetrail/"); } userDataPath.makeCanonical(); } @@ -58,8 +57,8 @@ void setupApp(int argc, char *argv[]) } // This "copyFile" method does nothing if the copy destination already exist - FileSystem::copyFile(ResourcePaths::getFallbackPath().concatenate(FilePath("ApplicationSettings.xml")), UserPaths::getAppSettingsPath()); - FileSystem::copyFile(ResourcePaths::getFallbackPath().concatenate(FilePath("window_settings.ini")), UserPaths::getWindowSettingsPath()); + FileSystem::copyFile(ResourcePaths::getFallbackPath().concatenate(L"ApplicationSettings.xml"), UserPaths::getAppSettingsPath()); + FileSystem::copyFile(ResourcePaths::getFallbackPath().concatenate(L"window_settings.ini"), UserPaths::getWindowSettingsPath()); } #endif // INCLUDES_WINDOWS_H diff --git a/src/lib_gui/qt/QtApplication.cpp b/src/lib_gui/qt/QtApplication.cpp index 0a54fc2f..7be4e797 100644 --- a/src/lib_gui/qt/QtApplication.cpp +++ b/src/lib_gui/qt/QtApplication.cpp @@ -26,7 +26,7 @@ bool QtApplication::event(QEvent *event) { QFileOpenEvent* fileEvent = dynamic_cast(event); - FilePath path(fileEvent->file().toStdString()); + FilePath path(fileEvent->file().toStdWString()); if (path.exists() && (path.extension() == ".srctrlprj" || path.extension() == ".coatiproject")) { diff --git a/src/lib_gui/qt/QtCoreApplication.cpp b/src/lib_gui/qt/QtCoreApplication.cpp index 851239f6..c390a82e 100644 --- a/src/lib_gui/qt/QtCoreApplication.cpp +++ b/src/lib_gui/qt/QtCoreApplication.cpp @@ -19,8 +19,8 @@ void QtCoreApplication::handleMessage(MessageQuitApplication* message) void QtCoreApplication::handleMessage(MessageStatus* message) { - for (const std::string& status : message->stati()) + for (const std::wstring& status : message->stati()) { - std::cout << status << std::endl; + std::wcout << status << std::endl; } } diff --git a/src/lib_gui/qt/element/QtCodeArea.cpp b/src/lib_gui/qt/element/QtCodeArea.cpp index f019ca8e..c2e03806 100644 --- a/src/lib_gui/qt/element/QtCodeArea.cpp +++ b/src/lib_gui/qt/element/QtCodeArea.cpp @@ -682,7 +682,7 @@ void QtCodeArea::setIDECursorPosition() { std::pair lineColumn = toLineColumn(this->cursorForPosition(m_eventPosition).position()); - MessageMoveIDECursor(getSourceLocationFile()->getFilePath().str(), lineColumn.first, lineColumn.second).dispatch(); + MessageMoveIDECursor(getSourceLocationFile()->getFilePath(), lineColumn.first, lineColumn.second).dispatch(); } void QtCodeArea::activateErrors(const std::vector& annotations) diff --git a/src/lib_gui/qt/element/QtCodeFile.cpp b/src/lib_gui/qt/element/QtCodeFile.cpp index 7d58e728..78da87c2 100644 --- a/src/lib_gui/qt/element/QtCodeFile.cpp +++ b/src/lib_gui/qt/element/QtCodeFile.cpp @@ -60,11 +60,6 @@ const FilePath& QtCodeFile::getFilePath() const return m_filePath; } -std::string QtCodeFile::getFileName() const -{ - return m_filePath.fileName(); -} - const QtCodeFileTitleBar* QtCodeFile::getTitleBar() const { return m_titleBar; diff --git a/src/lib_gui/qt/element/QtCodeFile.h b/src/lib_gui/qt/element/QtCodeFile.h index ddc91970..aca30604 100644 --- a/src/lib_gui/qt/element/QtCodeFile.h +++ b/src/lib_gui/qt/element/QtCodeFile.h @@ -30,7 +30,6 @@ public: void setModificationTime(const TimeStamp modificationTime); const FilePath& getFilePath() const; - std::string getFileName() const; const QtCodeFileTitleBar* getTitleBar() const; diff --git a/src/lib_gui/qt/element/QtCodeFileTitleButton.cpp b/src/lib_gui/qt/element/QtCodeFileTitleButton.cpp index e1bfa3cd..4e1bfbf9 100644 --- a/src/lib_gui/qt/element/QtCodeFileTitleButton.cpp +++ b/src/lib_gui/qt/element/QtCodeFileTitleButton.cpp @@ -10,6 +10,7 @@ #include "qt/utility/utilityQt.h" #include "settings/ColorScheme.h" #include "utility/ResourcePaths.h" +#include "utility/utilityQString.h" QtCodeFileTitleButton::QtCodeFileTitleButton(QWidget* parent) : QPushButton(parent) @@ -67,8 +68,8 @@ void QtCodeFileTitleButton::setIsComplete(bool isComplete) if (!isComplete) { - FilePath hatchingFilePath(ResourcePaths::getGuiPath().str() + "code_view/images/pattern_" + - ColorScheme::getInstance()->getColor("code/file/title/hatching") + ".png" + FilePath hatchingFilePath = ResourcePaths::getGuiPath().concatenate(L"code_view/images/pattern_" + + utility::decodeFromUtf8(ColorScheme::getInstance()->getColor("code/file/title/hatching")) + L".png" ); setStyleSheet(( @@ -103,23 +104,23 @@ void QtCodeFileTitleButton::updateTexts() return; } - std::string title = m_filePath.fileName(); - std::string toolTip = "file: " + m_filePath.str(); + std::wstring title = m_filePath.wFileName(); + std::wstring toolTip = L"file: " + m_filePath.wstr(); if ((!m_filePath.recheckExists()) || (FileSystem::getLastWriteTime(m_filePath) > m_modificationTime)) { - title += "*"; - toolTip = "out of date " + toolTip; + title += L"*"; + toolTip = L"out of date " + toolTip; } if (!m_isComplete) { - toolTip = "incomplete " + toolTip; + toolTip = L"incomplete " + toolTip; } - setText(title.c_str()); - setToolTip(toolTip.c_str()); + setText(QString::fromStdWString(title)); + setToolTip(QString::fromStdWString(toolTip)); } void QtCodeFileTitleButton::updateFromOther(const QtCodeFileTitleButton* other) diff --git a/src/lib_gui/qt/element/QtCodeNavigator.cpp b/src/lib_gui/qt/element/QtCodeNavigator.cpp index 94410a94..f224da71 100644 --- a/src/lib_gui/qt/element/QtCodeNavigator.cpp +++ b/src/lib_gui/qt/element/QtCodeNavigator.cpp @@ -569,22 +569,22 @@ void QtCodeNavigator::refreshStyle() m_fileButton->setFixedHeight(height); m_prevButton->setIcon(utility::createButtonIcon( - ResourcePaths::getGuiPath().str() + "code_view/images/arrow_left.png", + ResourcePaths::getGuiPath().concatenate(L"code_view/images/arrow_left.png"), "search/button" )); m_nextButton->setIcon(utility::createButtonIcon( - ResourcePaths::getGuiPath().str() + "code_view/images/arrow_right.png", + ResourcePaths::getGuiPath().concatenate(L"code_view/images/arrow_right.png"), "search/button" )); m_listButton->setIcon(utility::createButtonIcon( - ResourcePaths::getGuiPath().str() + "code_view/images/list.png", + ResourcePaths::getGuiPath().concatenate(L"code_view/images/list.png"), "search/button" )); m_fileButton->setIcon(utility::createButtonIcon( - ResourcePaths::getGuiPath().str() + "code_view/images/file.png", + ResourcePaths::getGuiPath().concatenate(L"code_view/images/file.png"), "search/button" )); diff --git a/src/lib_gui/qt/element/QtCodeSnippet.cpp b/src/lib_gui/qt/element/QtCodeSnippet.cpp index ce1ce0fd..8bc89974 100644 --- a/src/lib_gui/qt/element/QtCodeSnippet.cpp +++ b/src/lib_gui/qt/element/QtCodeSnippet.cpp @@ -83,7 +83,7 @@ QtCodeSnippet::QtCodeSnippet(const CodeSnippetParams& params, QtCodeNavigator* n m_title = createScopeLine(layout); if (m_titleId == 0) // title is a file path { - m_title->setText(FilePath(m_titleString).fileName().c_str()); + m_title->setText(QString::fromStdWString(FilePath(m_titleString).wFileName())); } else { @@ -100,7 +100,7 @@ QtCodeSnippet::QtCodeSnippet(const CodeSnippetParams& params, QtCodeNavigator* n m_footer = createScopeLine(layout); if (m_footerId == 0) // footer is a file path { - m_footer->setText(FilePath(m_footerString).fileName().c_str()); + m_footer->setText(QString::fromStdWString(FilePath(m_footerString).wFileName())); } else { diff --git a/src/lib_gui/qt/element/QtDirectoryListBox.cpp b/src/lib_gui/qt/element/QtDirectoryListBox.cpp index 71706a55..59adce83 100644 --- a/src/lib_gui/qt/element/QtDirectoryListBox.cpp +++ b/src/lib_gui/qt/element/QtDirectoryListBox.cpp @@ -59,7 +59,7 @@ void QtListItemWidget::setText(QString text) FilePath relativeRoot = m_list->getRelativeRootDirectory(); if (!relativeRoot.empty()) { - const FilePath path(text.toStdString()); + const FilePath path(text.toStdWString()); const FilePath relPath = path.getRelativeTo(relativeRoot); if (relPath.str().size() < path.str().size()) { @@ -100,7 +100,7 @@ void QtListItemWidget::setFocus() void QtListItemWidget::handleButtonPress() { - FilePath path(m_data->text().toStdString()); + FilePath path(m_data->text().toStdWString()); const FilePath relativeRoot = m_list->getRelativeRootDirectory(); if (!path.empty() && !path.isAbsolute() && !relativeRoot.empty()) { @@ -141,7 +141,7 @@ QtDirectoryListBox::QtDirectoryListBox(QWidget *parent, const QString& listName, m_list->setObjectName("list"); m_list->setAttribute(Qt::WA_MacShowFocusRect, 0); - setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("window/listbox.css"))).c_str()); + setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(L"window/listbox.css")).c_str()); layout->addWidget(m_list, 5); QWidget* buttonContainer = new QWidget(this); diff --git a/src/lib_gui/qt/element/QtHistoryList.cpp b/src/lib_gui/qt/element/QtHistoryList.cpp index e5d49b3d..347889bf 100644 --- a/src/lib_gui/qt/element/QtHistoryList.cpp +++ b/src/lib_gui/qt/element/QtHistoryList.cpp @@ -131,7 +131,7 @@ QtHistoryList::QtHistoryList(const std::vector& history, size_t cur } setStyleSheet(utility::getStyleSheet( - ResourcePaths::getGuiPath().concatenate(FilePath("history_list/history_list.css"))).c_str()); + ResourcePaths::getGuiPath().concatenate(L"history_list/history_list.css")).c_str()); connect(m_list, &QListWidget::itemClicked, this, &QtHistoryList::onItemClicked); } diff --git a/src/lib_gui/qt/element/QtLocationPicker.cpp b/src/lib_gui/qt/element/QtLocationPicker.cpp index 55c17018..8b8afa96 100644 --- a/src/lib_gui/qt/element/QtLocationPicker.cpp +++ b/src/lib_gui/qt/element/QtLocationPicker.cpp @@ -99,7 +99,7 @@ void QtLocationPicker::changeEvent(QEvent *event) void QtLocationPicker::handleButtonPress() { - FilePath path(m_data->text().toStdString()); + FilePath path(m_data->text().toStdWString()); if (!path.empty() && !path.isAbsolute() && !m_relativeRootDirectory.empty()) { path = m_relativeRootDirectory.getConcatenated(path); diff --git a/src/lib_gui/qt/element/QtRefreshBar.cpp b/src/lib_gui/qt/element/QtRefreshBar.cpp index e061e845..ce214447 100644 --- a/src/lib_gui/qt/element/QtRefreshBar.cpp +++ b/src/lib_gui/qt/element/QtRefreshBar.cpp @@ -46,7 +46,7 @@ void QtRefreshBar::refreshStyle() m_refreshButton->setFixedHeight(height); m_refreshButton->setIcon(utility::createButtonIcon( - ResourcePaths::getGuiPath().str() + "refresh_view/images/refresh.png", + ResourcePaths::getGuiPath().concatenate(L"refresh_view/images/refresh.png"), "search/button" )); diff --git a/src/lib_gui/qt/element/QtScreenSearchBox.cpp b/src/lib_gui/qt/element/QtScreenSearchBox.cpp index b40b26c4..ca0eb39b 100644 --- a/src/lib_gui/qt/element/QtScreenSearchBox.cpp +++ b/src/lib_gui/qt/element/QtScreenSearchBox.cpp @@ -123,22 +123,22 @@ QtScreenSearchBox::~QtScreenSearchBox() void QtScreenSearchBox::refreshStyle() { m_searchButton->setIcon(utility::createButtonIcon( - ResourcePaths::getGuiPath().str() + "search_view/images/search.png", + ResourcePaths::getGuiPath().concatenate(L"search_view/images/search.png"), "screen_search/button" )); m_prevButton->setIcon(utility::createButtonIcon( - ResourcePaths::getGuiPath().str() + "code_view/images/arrow_left.png", + ResourcePaths::getGuiPath().concatenate(L"code_view/images/arrow_left.png"), "screen_search/button" )); m_nextButton->setIcon(utility::createButtonIcon( - ResourcePaths::getGuiPath().str() + "code_view/images/arrow_right.png", + ResourcePaths::getGuiPath().concatenate(L"code_view/images/arrow_right.png"), "screen_search/button" )); m_closeButton->setIcon(utility::createButtonIcon( - ResourcePaths::getGuiPath().str() + "screen_search_view/images/close.png", + ResourcePaths::getGuiPath().concatenate(L"screen_search_view/images/close.png"), "screen_search/button" )); diff --git a/src/lib_gui/qt/element/QtSearchBar.cpp b/src/lib_gui/qt/element/QtSearchBar.cpp index 751add0b..82299aae 100644 --- a/src/lib_gui/qt/element/QtSearchBar.cpp +++ b/src/lib_gui/qt/element/QtSearchBar.cpp @@ -102,12 +102,12 @@ void QtSearchBar::refreshStyle() m_homeButton->setFixedHeight(m_searchBox->height() + 5); m_searchButton->setIcon(utility::createButtonIcon( - ResourcePaths::getGuiPath().str() + "search_view/images/search.png", + ResourcePaths::getGuiPath().concatenate(L"search_view/images/search.png"), "search/button" )); m_homeButton->setIcon(utility::createButtonIcon( - ResourcePaths::getGuiPath().str() + "search_view/images/home.png", + ResourcePaths::getGuiPath().concatenate(L"search_view/images/home.png"), "search/button" )); diff --git a/src/lib_gui/qt/element/QtStatusBar.cpp b/src/lib_gui/qt/element/QtStatusBar.cpp index 71b31e67..c6a51c91 100644 --- a/src/lib_gui/qt/element/QtStatusBar.cpp +++ b/src/lib_gui/qt/element/QtStatusBar.cpp @@ -29,7 +29,7 @@ QtStatusBar::QtStatusBar() m_text.setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac m_text.setSizePolicy(QSizePolicy::Ignored, m_text.sizePolicy().verticalPolicy()); addWidget(&m_text, 1); - setText("", false, false); + setText(L"", false, false); connect(&m_text, &QPushButton::clicked, this, &QtStatusBar::showStatus); @@ -49,7 +49,7 @@ QtStatusBar::QtStatusBar() connect(&m_errorButton, &QPushButton::clicked, this, &QtStatusBar::showErrors); } -void QtStatusBar::setText(const std::string& text, bool isError, bool showLoader) +void QtStatusBar::setText(const std::wstring& text, bool isError, bool showLoader) { if (isError) { @@ -69,10 +69,10 @@ void QtStatusBar::setText(const std::string& text, bool isError, bool showLoader m_loader.hide(); } - if (text.size()) + if (!text.empty()) { m_textString = text; - m_text.setText(m_text.fontMetrics().elidedText(QString::fromStdString(m_textString), Qt::ElideRight, m_text.width())); + m_text.setText(m_text.fontMetrics().elidedText(QString::fromStdWString(m_textString), Qt::ElideRight, m_text.width())); } } @@ -108,7 +108,7 @@ void QtStatusBar::setIdeStatus(const std::string& text) void QtStatusBar::resizeEvent(QResizeEvent* event) { - m_text.setText(m_text.fontMetrics().elidedText(QString::fromStdString(m_textString), Qt::ElideRight, m_text.width())); + m_text.setText(m_text.fontMetrics().elidedText(QString::fromStdWString(m_textString), Qt::ElideRight, m_text.width())); } void QtStatusBar::showStatus() diff --git a/src/lib_gui/qt/element/QtStatusBar.h b/src/lib_gui/qt/element/QtStatusBar.h index 2dd04058..a6bded23 100644 --- a/src/lib_gui/qt/element/QtStatusBar.h +++ b/src/lib_gui/qt/element/QtStatusBar.h @@ -18,7 +18,7 @@ class QtStatusBar public: QtStatusBar(); - void setText(const std::string& text, bool isError, bool showLoader); + void setText(const std::wstring& text, bool isError, bool showLoader); void setErrorCount(ErrorCountInfo errorCount); void setIdeStatus(const std::string& text); @@ -33,7 +33,7 @@ private slots: private: std::shared_ptr m_movie; - std::string m_textString; + std::wstring m_textString; QPushButton m_text; QLabel m_loader; diff --git a/src/lib_gui/qt/element/QtUndoRedo.cpp b/src/lib_gui/qt/element/QtUndoRedo.cpp index 212f88e6..a09bf680 100644 --- a/src/lib_gui/qt/element/QtUndoRedo.cpp +++ b/src/lib_gui/qt/element/QtUndoRedo.cpp @@ -161,17 +161,17 @@ void QtUndoRedo::refreshStyle() m_historyButton->setFixedHeight(height); m_undoButton->setIcon(utility::createButtonIcon( - ResourcePaths::getGuiPath().str() + "undoredo_view/images/arrow_left.png", + ResourcePaths::getGuiPath().concatenate(L"undoredo_view/images/arrow_left.png"), "search/button" )); m_redoButton->setIcon(utility::createButtonIcon( - ResourcePaths::getGuiPath().str() + "undoredo_view/images/arrow_right.png", + ResourcePaths::getGuiPath().concatenate(L"undoredo_view/images/arrow_right.png"), "search/button" )); m_historyButton->setIcon(utility::createButtonIcon( - ResourcePaths::getGuiPath().str() + "undoredo_view/images/history.png", + ResourcePaths::getGuiPath().concatenate(L"undoredo_view/images/history.png"), "search/button" )); diff --git a/src/lib_gui/qt/graphics/QtGraphicsView.cpp b/src/lib_gui/qt/graphics/QtGraphicsView.cpp index 53b6c1c1..15cd5f37 100644 --- a/src/lib_gui/qt/graphics/QtGraphicsView.cpp +++ b/src/lib_gui/qt/graphics/QtGraphicsView.cpp @@ -190,12 +190,12 @@ void QtGraphicsView::updateZoom(float delta) void QtGraphicsView::refreshStyle() { m_zoomInButton->setIcon(utility::createButtonIcon( - ResourcePaths::getGuiPath().str() + "graph_view/images/zoom_in.png", + ResourcePaths::getGuiPath().concatenate(L"graph_view/images/zoom_in.png"), "search/button" )); m_zoomOutButton->setIcon(utility::createButtonIcon( - ResourcePaths::getGuiPath().str() + "graph_view/images/zoom_out.png", + ResourcePaths::getGuiPath().concatenate(L"graph_view/images/zoom_out.png"), "search/button" )); } diff --git a/src/lib_gui/qt/utility/utilityQt.cpp b/src/lib_gui/qt/utility/utilityQt.cpp index 4024ddd0..3f91a95d 100644 --- a/src/lib_gui/qt/utility/utilityQt.cpp +++ b/src/lib_gui/qt/utility/utilityQt.cpp @@ -212,9 +212,9 @@ namespace utility return QPixmap::fromImage(image); } - QIcon createButtonIcon(const std::string& iconPath, const std::string& colorId) + QIcon createButtonIcon(const FilePath& iconPath, const std::string& colorId) { - QPixmap pixmap(iconPath.c_str()); + QPixmap pixmap(QString::fromStdWString(iconPath.wstr())); QIcon icon(utility::colorizePixmap(pixmap, ColorScheme::getInstance()->getColor(colorId + "/icon").c_str())); icon.addPixmap( diff --git a/src/lib_gui/qt/utility/utilityQt.h b/src/lib_gui/qt/utility/utilityQt.h index 84f46317..57ad499b 100644 --- a/src/lib_gui/qt/utility/utilityQt.h +++ b/src/lib_gui/qt/utility/utilityQt.h @@ -20,7 +20,7 @@ namespace utility std::string getStyleSheet(const FilePath& path); QPixmap colorizePixmap(const QPixmap& pixmap, QColor color); - QIcon createButtonIcon(const std::string& iconPath, const std::string& colorId); + QIcon createButtonIcon(const FilePath& iconPath, const std::string& colorId); void copyNewFilesFromDirectory(QString src, QString dst); } diff --git a/src/lib_gui/qt/view/QtBookmarkView.cpp b/src/lib_gui/qt/view/QtBookmarkView.cpp index 4e78efd7..4fff2c39 100644 --- a/src/lib_gui/qt/view/QtBookmarkView.cpp +++ b/src/lib_gui/qt/view/QtBookmarkView.cpp @@ -83,7 +83,7 @@ void QtBookmarkView::setCreateButtonState(const CreateButtonState& state) m_createButtonState = state; m_createBookmarkButton->setIcon(utility::createButtonIcon( - ResourcePaths::getGuiPath().str() + "bookmark_view/images/edit_bookmark_icon.png", + ResourcePaths::getGuiPath().concatenate(L"bookmark_view/images/edit_bookmark_icon.png"), "search/button" )); @@ -100,7 +100,7 @@ void QtBookmarkView::setCreateButtonState(const CreateButtonState& state) m_createBookmarkButton->setEnabled(true); m_createBookmarkButton->setIcon(utility::createButtonIcon( - ResourcePaths::getGuiPath().str() + "bookmark_view/images/bookmark_active.png", + ResourcePaths::getGuiPath().concatenate(L"bookmark_view/images/bookmark_active.png"), "search/button" )); } @@ -250,7 +250,7 @@ void QtBookmarkView::showBookmarksClicked() void QtBookmarkView::setStyleSheet() { m_widget->setStyleSheet(utility::getStyleSheet( - ResourcePaths::getGuiPath().concatenate(FilePath("bookmark_view/bookmark_view.css")) + ResourcePaths::getGuiPath().concatenate(L"bookmark_view/bookmark_view.css") ).c_str()); } @@ -262,12 +262,12 @@ void QtBookmarkView::refreshStyle() m_showBookmarksButton->setFixedHeight(height); m_createBookmarkButton->setIcon(utility::createButtonIcon( - ResourcePaths::getGuiPath().str() + "bookmark_view/images/edit_bookmark_icon.png", + ResourcePaths::getGuiPath().concatenate(L"bookmark_view/images/edit_bookmark_icon.png"), "search/button" )); m_showBookmarksButton->setIcon(utility::createButtonIcon( - ResourcePaths::getGuiPath().str() + "bookmark_view/images/bookmark_list_icon.png", + ResourcePaths::getGuiPath().concatenate(L"bookmark_view/images/bookmark_list_icon.png"), "search/button" )); diff --git a/src/lib_gui/qt/view/QtCodeView.cpp b/src/lib_gui/qt/view/QtCodeView.cpp index eea1248d..11b2217b 100644 --- a/src/lib_gui/qt/view/QtCodeView.cpp +++ b/src/lib_gui/qt/view/QtCodeView.cpp @@ -284,7 +284,7 @@ void QtCodeView::setStyleSheet() const { utility::setWidgetBackgroundColor(m_widget, ColorScheme::getInstance()->getColor("code/background")); - std::string styleSheet = utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("code_view/code_view.css"))); + std::string styleSheet = utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(L"code_view/code_view.css")); m_widget->setStyleSheet(styleSheet.c_str()); } diff --git a/src/lib_gui/qt/view/QtDialogView.cpp b/src/lib_gui/qt/view/QtDialogView.cpp index 8fa242b1..5eb1bd79 100644 --- a/src/lib_gui/qt/view/QtDialogView.cpp +++ b/src/lib_gui/qt/view/QtDialogView.cpp @@ -44,7 +44,7 @@ void QtDialogView::showUnknownProgressDialog(const std::string& title, const std void QtDialogView::hideUnknownProgressDialog() { - MessageStatus("", false, false).dispatch(); + MessageStatus(L"", false, false).dispatch(); m_onQtThread2( [=]() @@ -104,7 +104,7 @@ void QtDialogView::hideProgressDialog() m_windowStack.popWindow(); } - MessageStatus("", false, false).dispatch(); + MessageStatus(L"", false, false).dispatch(); setUIBlocked(false); } @@ -113,7 +113,6 @@ void QtDialogView::hideProgressDialog() setParentWindow(nullptr); } - void QtDialogView::startIndexingDialog( Project* project, const std::vector& enabledModes, const RefreshInfo& info) { @@ -268,11 +267,51 @@ int QtDialogView::confirm(const std::string& message, const std::vector& options) +{ + int result = -1; + m_resultReady = false; + + m_onQtThread2( + [=, &result]() + { + QMessageBox msgBox; + msgBox.setText(QString::fromStdWString(message)); + + for (const std::wstring& option : options) + { + msgBox.addButton(QString::fromStdWString(option), QMessageBox::AcceptRole); } msgBox.exec(); diff --git a/src/lib_gui/qt/view/QtDialogView.h b/src/lib_gui/qt/view/QtDialogView.h index e217e6a4..d8b5cd04 100644 --- a/src/lib_gui/qt/view/QtDialogView.h +++ b/src/lib_gui/qt/view/QtDialogView.h @@ -45,7 +45,8 @@ public: virtual void hideDialogs(bool unblockUI = true) override; - int confirm(const std::string& message, const std::vector& options) override; + virtual int confirm(const std::string& message, const std::vector& options) override; + virtual int confirm(const std::wstring& message, const std::vector& options) override; void setParentWindow(QtWindow* window); diff --git a/src/lib_gui/qt/view/QtGraphView.cpp b/src/lib_gui/qt/view/QtGraphView.cpp index 608dad0e..99e7cfba 100644 --- a/src/lib_gui/qt/view/QtGraphView.cpp +++ b/src/lib_gui/qt/view/QtGraphView.cpp @@ -160,7 +160,7 @@ void QtGraphView::refreshView() QtGraphicsView* view = getView(); - std::string css = utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("graph_view/graph_view.css"))); + const std::string css = utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(L"graph_view/graph_view.css")); view->setStyleSheet(css.c_str()); view->setAppZoomFactor(GraphViewStyle::getZoomFactor()); view->refreshStyle(); @@ -168,12 +168,12 @@ void QtGraphView::refreshView() m_trailWidget->setStyleSheet(css.c_str()); m_expandButton->setIcon(utility::createButtonIcon( - ResourcePaths::getGuiPath().str() + "graph_view/images/graph.png", + ResourcePaths::getGuiPath().concatenate(L"graph_view/images/graph.png"), "search/button" )); m_collapseButton->setIcon(utility::createButtonIcon( - ResourcePaths::getGuiPath().str() + "graph_view/images/graph_arrow.png", + ResourcePaths::getGuiPath().concatenate(L"graph_view/images/graph_arrow.png"), "search/button" )); @@ -729,49 +729,49 @@ void QtGraphView::updateTrailButtons() m_trailDepthLabel->setEnabled(message.trailType); m_trailDepthSlider->setEnabled(message.trailType); - std::string backwardImagePath; - std::string forwardImagePath; + std::wstring backwardImagePath; + std::wstring forwardImagePath; if (message.trailType & Edge::EDGE_CALL) { m_backwardTrailButton->setToolTip("show caller graph"); m_forwardTrailButton->setToolTip("show callee graph"); - backwardImagePath = "graph_left.png"; - forwardImagePath = "graph_right.png"; + backwardImagePath = L"graph_left.png"; + forwardImagePath = L"graph_right.png"; } else if (message.trailType & Edge::EDGE_INHERITANCE) { m_backwardTrailButton->setToolTip("show base hierarchy"); m_forwardTrailButton->setToolTip("show derived hierarchy"); - backwardImagePath = "graph_up.png"; - forwardImagePath = "graph_down.png"; + backwardImagePath = L"graph_up.png"; + forwardImagePath = L"graph_down.png"; } else if (message.trailType & Edge::EDGE_INCLUDE) { m_backwardTrailButton->setToolTip("show including files hierarchy"); m_forwardTrailButton->setToolTip("show included files hierarchy"); - backwardImagePath = "graph_left.png"; - forwardImagePath = "graph_right.png"; + backwardImagePath = L"graph_left.png"; + forwardImagePath = L"graph_right.png"; } else { m_backwardTrailButton->setToolTip("no depth graph available for active symbol"); m_forwardTrailButton->setToolTip("no depth graph available for active symbol"); - backwardImagePath = "graph_left.png"; - forwardImagePath = "graph_right.png"; + backwardImagePath = L"graph_left.png"; + forwardImagePath = L"graph_right.png"; } m_backwardTrailButton->setIcon(utility::createButtonIcon( - ResourcePaths::getGuiPath().str() + "graph_view/images/" + backwardImagePath, + ResourcePaths::getGuiPath().concatenate(L"graph_view/images/" + backwardImagePath), "search/button" )); m_forwardTrailButton->setIcon(utility::createButtonIcon( - ResourcePaths::getGuiPath().str() + "graph_view/images/" + forwardImagePath, + ResourcePaths::getGuiPath().concatenate(L"graph_view/images/" + forwardImagePath), "search/button" )); @@ -842,7 +842,7 @@ void QtGraphView::switchToNewGraphData() if (m_oldGraph && m_oldGraph->getTrailMode() != Graph::TRAIL_NONE) { - MessageStatus("Finished graph display").dispatch(); + MessageStatus(L"Finished graph display").dispatch(); } } diff --git a/src/lib_gui/qt/view/QtMainView.cpp b/src/lib_gui/qt/view/QtMainView.cpp index 46fe2a2e..fc104b3a 100644 --- a/src/lib_gui/qt/view/QtMainView.cpp +++ b/src/lib_gui/qt/view/QtMainView.cpp @@ -100,12 +100,12 @@ void QtMainView::hideStartScreen() ); } -void QtMainView::setTitle(const std::string& title) +void QtMainView::setTitle(const std::wstring& title) { m_onQtThread( [=]() { - m_window->setWindowTitle(QString::fromStdString(title)); + m_window->setWindowTitle(QString::fromStdWString(title)); } ); } diff --git a/src/lib_gui/qt/view/QtMainView.h b/src/lib_gui/qt/view/QtMainView.h index c158f187..77e26661 100644 --- a/src/lib_gui/qt/view/QtMainView.h +++ b/src/lib_gui/qt/view/QtMainView.h @@ -50,7 +50,7 @@ public: virtual void refreshView(); virtual void hideStartScreen(); - virtual void setTitle(const std::string& title); + virtual void setTitle(const std::wstring& title); virtual void activateWindow(); virtual void updateRecentProjectMenu(); diff --git a/src/lib_gui/qt/view/QtRefreshView.cpp b/src/lib_gui/qt/view/QtRefreshView.cpp index 62aa4a8c..b11dd9c4 100644 --- a/src/lib_gui/qt/view/QtRefreshView.cpp +++ b/src/lib_gui/qt/view/QtRefreshView.cpp @@ -36,5 +36,5 @@ void QtRefreshView::refreshView() void QtRefreshView::setStyleSheet() { m_widget->setStyleSheet(utility::getStyleSheet( - ResourcePaths::getGuiPath().concatenate(FilePath("refresh_view/refresh_view.css"))).c_str()); + ResourcePaths::getGuiPath().concatenate(L"refresh_view/refresh_view.css")).c_str()); } diff --git a/src/lib_gui/qt/view/QtScreenSearchView.cpp b/src/lib_gui/qt/view/QtScreenSearchView.cpp index 3a9f7803..0035daf9 100644 --- a/src/lib_gui/qt/view/QtScreenSearchView.cpp +++ b/src/lib_gui/qt/view/QtScreenSearchView.cpp @@ -45,8 +45,11 @@ void QtScreenSearchView::refreshView() m_onQtThread([=]() { m_bar->setStyleSheet( - utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate( - FilePath("screen_search_view/screen_search_view.css"))).c_str() + utility::getStyleSheet( + ResourcePaths::getGuiPath().concatenate( + L"screen_search_view/screen_search_view.css" + ) + ).c_str() ); m_widget->refreshStyle(); diff --git a/src/lib_gui/qt/view/QtSearchView.cpp b/src/lib_gui/qt/view/QtSearchView.cpp index 98d71dd0..59abcc2a 100644 --- a/src/lib_gui/qt/view/QtSearchView.cpp +++ b/src/lib_gui/qt/view/QtSearchView.cpp @@ -77,7 +77,7 @@ void QtSearchView::setAutocompletionList(const std::vector& autocom void QtSearchView::setStyleSheet() { - std::string css = utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("search_view/search_view.css"))); + const std::string css = utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(L"search_view/search_view.css")); m_widget->setStyleSheet(css.c_str()); diff --git a/src/lib_gui/qt/view/QtStatusBarView.cpp b/src/lib_gui/qt/view/QtStatusBarView.cpp index 16b65ad7..3297dd0b 100644 --- a/src/lib_gui/qt/view/QtStatusBarView.cpp +++ b/src/lib_gui/qt/view/QtStatusBarView.cpp @@ -31,7 +31,7 @@ void QtStatusBarView::refreshView() { } -void QtStatusBarView::showMessage(const std::string& message, bool isError, bool showLoader) +void QtStatusBarView::showMessage(const std::wstring& message, bool isError, bool showLoader) { m_onQtThread( [=]() diff --git a/src/lib_gui/qt/view/QtStatusBarView.h b/src/lib_gui/qt/view/QtStatusBarView.h index e146b762..71913745 100644 --- a/src/lib_gui/qt/view/QtStatusBarView.h +++ b/src/lib_gui/qt/view/QtStatusBarView.h @@ -22,7 +22,7 @@ public: virtual void refreshView(); // StatusBar view implementation - virtual void showMessage(const std::string& message, bool isError, bool showLoader); + virtual void showMessage(const std::wstring& message, bool isError, bool showLoader); virtual void setErrorCount(ErrorCountInfo errorCount); virtual void showIdeStatus(const std::string& message); diff --git a/src/lib_gui/qt/view/QtStatusView.cpp b/src/lib_gui/qt/view/QtStatusView.cpp index a7a63292..9de3c810 100644 --- a/src/lib_gui/qt/view/QtStatusView.cpp +++ b/src/lib_gui/qt/view/QtStatusView.cpp @@ -122,7 +122,7 @@ void QtStatusView::addStatus(const std::vector& status) QString statusType = (s.type == StatusType::STATUS_ERROR ? "ERROR" : "INFO"); m_model->setItem(rowNumber, STATUSVIEW_COLUMN::TYPE, new QStandardItem(statusType)); - m_model->setItem(rowNumber, STATUSVIEW_COLUMN::STATUS, new QStandardItem(s.message.c_str())); + m_model->setItem(rowNumber, STATUSVIEW_COLUMN::STATUS, new QStandardItem(QString::fromStdWString(s.message))); } m_table->updateRows(); diff --git a/src/lib_gui/qt/view/QtTabbedView.cpp b/src/lib_gui/qt/view/QtTabbedView.cpp index 36ca8e87..5bd44872 100644 --- a/src/lib_gui/qt/view/QtTabbedView.cpp +++ b/src/lib_gui/qt/view/QtTabbedView.cpp @@ -65,6 +65,6 @@ void QtTabbedView::setStyleSheet() QtViewWidgetWrapper::getWidgetOfView(this), ColorScheme::getInstance()->getColor("tab/background")); m_widget->setStyleSheet( - utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("tabbed_view/tabbed_view.css"))).c_str() + utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(L"tabbed_view/tabbed_view.css")).c_str() ); } diff --git a/src/lib_gui/qt/view/QtTooltipView.cpp b/src/lib_gui/qt/view/QtTooltipView.cpp index fd62f554..0753e708 100644 --- a/src/lib_gui/qt/view/QtTooltipView.cpp +++ b/src/lib_gui/qt/view/QtTooltipView.cpp @@ -31,7 +31,7 @@ void QtTooltipView::refreshView() m_onQtThread([=]() { m_widget->setStyleSheet( - utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("tooltip_view/tooltip_view.css"))).c_str() + utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(L"tooltip_view/tooltip_view.css")).c_str() ); }); } diff --git a/src/lib_gui/qt/view/QtUndoRedoView.cpp b/src/lib_gui/qt/view/QtUndoRedoView.cpp index 8b2c8161..a0bc706c 100644 --- a/src/lib_gui/qt/view/QtUndoRedoView.cpp +++ b/src/lib_gui/qt/view/QtUndoRedoView.cpp @@ -68,5 +68,6 @@ void QtUndoRedoView::updateHistory(const std::vector& searchMatches void QtUndoRedoView::setStyleSheet() { m_widget->setStyleSheet(utility::getStyleSheet( - ResourcePaths::getGuiPath().concatenate(FilePath("undoredo_view/undoredo_view.css"))).c_str()); + ResourcePaths::getGuiPath().concatenate(L"undoredo_view/undoredo_view.css") + ).c_str()); } diff --git a/src/lib_gui/qt/window/QtAbout.cpp b/src/lib_gui/qt/window/QtAbout.cpp index 2ce10971..283bd3fd 100644 --- a/src/lib_gui/qt/window/QtAbout.cpp +++ b/src/lib_gui/qt/window/QtAbout.cpp @@ -23,7 +23,7 @@ QSize QtAbout::sizeHint() const void QtAbout::setupAbout() { - setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("about/about.css"))).c_str()); + setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(L"about/about.css")).c_str()); QVBoxLayout* windowLayout = new QVBoxLayout(); windowLayout->setContentsMargins(10, 10, 10, 0); @@ -34,7 +34,7 @@ void QtAbout::setupAbout() QHBoxLayout* row = new QHBoxLayout(); windowLayout->addLayout(row); { - QtDeviceScaledPixmap sourcetrailLogo((ResourcePaths::getGuiPath().str() + "about/logo_sourcetrail.png").c_str()); + QtDeviceScaledPixmap sourcetrailLogo(QString::fromStdWString(ResourcePaths::getGuiPath().wstr() + L"about/logo_sourcetrail.png")); sourcetrailLogo.scaleToHeight(150); QLabel* sourcetrailLogoLabel = new QLabel(this); diff --git a/src/lib_gui/qt/window/QtBookmarkBrowser.cpp b/src/lib_gui/qt/window/QtBookmarkBrowser.cpp index 2919b6d3..804e86a7 100644 --- a/src/lib_gui/qt/window/QtBookmarkBrowser.cpp +++ b/src/lib_gui/qt/window/QtBookmarkBrowser.cpp @@ -24,8 +24,8 @@ QtBookmarkBrowser::~QtBookmarkBrowser() void QtBookmarkBrowser::setupBookmarkBrowser() { setStyleSheet(( - utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("window/window.css"))) + - utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("bookmark_view/bookmark_view.css"))) + utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(L"window/window.css")) + + utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(L"bookmark_view/bookmark_view.css")) ).c_str()); m_headerBackground = new QWidget(m_window); diff --git a/src/lib_gui/qt/window/QtBookmarkCreator.cpp b/src/lib_gui/qt/window/QtBookmarkCreator.cpp index c51f2017..889c3e2e 100644 --- a/src/lib_gui/qt/window/QtBookmarkCreator.cpp +++ b/src/lib_gui/qt/window/QtBookmarkCreator.cpp @@ -106,8 +106,8 @@ void QtBookmarkCreator::setupBookmarkCreator() void QtBookmarkCreator::refreshStyle() { setStyleSheet(( - utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("window/window.css"))) + - utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("bookmark_view/bookmark_view.css"))) + utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(L"window/window.css")) + + utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(L"bookmark_view/bookmark_view.css")) ).c_str()); } @@ -172,7 +172,7 @@ void QtBookmarkCreator::handleNext() m_controllerProxy->executeAsTaskWithArgs( &BookmarkController::createBookmark, name, comment, category, m_nodeId); - MessageStatus("Creating Bookmark for active Token").dispatch(); + MessageStatus(L"Creating Bookmark for active Token").dispatch(); } close(); diff --git a/src/lib_gui/qt/window/QtEulaWindow.cpp b/src/lib_gui/qt/window/QtEulaWindow.cpp index a1f4a3d5..ac9dc3cc 100644 --- a/src/lib_gui/qt/window/QtEulaWindow.cpp +++ b/src/lib_gui/qt/window/QtEulaWindow.cpp @@ -35,7 +35,7 @@ void QtEulaWindow::populateWindow(QWidget* widget) } std::shared_ptr text = - TextAccess::createFromFile(FilePath(ResourcePaths::getGuiPath().str() + "installer/EULA.txt")); + TextAccess::createFromFile(ResourcePaths::getGuiPath().concatenate(L"installer/EULA.txt")); QTextEdit* licenseText = new QTextEdit(); licenseText->setObjectName("textField"); diff --git a/src/lib_gui/qt/window/QtIndexingDialog.cpp b/src/lib_gui/qt/window/QtIndexingDialog.cpp index 2c63f8a4..322dee0a 100644 --- a/src/lib_gui/qt/window/QtIndexingDialog.cpp +++ b/src/lib_gui/qt/window/QtIndexingDialog.cpp @@ -392,8 +392,8 @@ QBoxLayout* QtIndexingDialog::createLayout() ); setStyleSheet(( - utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("window/window.css"))) + - utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("indexing_dialog/indexing_dialog.css"))) + utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(L"window/window.css")) + + utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(L"indexing_dialog/indexing_dialog.css")) ).c_str()); QVBoxLayout* layout = new QVBoxLayout(this); diff --git a/src/lib_gui/qt/window/QtKeyboardShortcuts.cpp b/src/lib_gui/qt/window/QtKeyboardShortcuts.cpp index 434308ca..2bbf802a 100644 --- a/src/lib_gui/qt/window/QtKeyboardShortcuts.cpp +++ b/src/lib_gui/qt/window/QtKeyboardShortcuts.cpp @@ -70,7 +70,7 @@ void QtKeyboardShortcuts::populateWindow(QWidget* widget) widget->setLayout(layout); - widget->setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("keyboard_shortcuts/keyboard_shortcuts.css"))).c_str()); + widget->setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(L"keyboard_shortcuts/keyboard_shortcuts.css")).c_str()); } void QtKeyboardShortcuts::windowReady() diff --git a/src/lib_gui/qt/window/QtLicenseWindow.cpp b/src/lib_gui/qt/window/QtLicenseWindow.cpp index 15ad0791..8836b504 100644 --- a/src/lib_gui/qt/window/QtLicenseWindow.cpp +++ b/src/lib_gui/qt/window/QtLicenseWindow.cpp @@ -134,7 +134,7 @@ void QtLicenseWindow::populateWindow(QWidget* widget) void QtLicenseWindow::windowReady() { m_content->setStyleSheet(m_content->styleSheet() + - utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("license/license.css"))).c_str()); + utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(L"license/license.css")).c_str()); addLogo(); diff --git a/src/lib_gui/qt/window/QtMainWindow.cpp b/src/lib_gui/qt/window/QtMainWindow.cpp index f6b2baa6..fe1b128b 100644 --- a/src/lib_gui/qt/window/QtMainWindow.cpp +++ b/src/lib_gui/qt/window/QtMainWindow.cpp @@ -120,7 +120,7 @@ QtMainWindow::QtMainWindow() { // can only be done once, because resetting the style on the QCoreApplication causes crash app->setStyleSheet( - utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("main/scrollbar.css"))).c_str()); + utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(L"main/scrollbar.css")).c_str()); } m_recentProjectAction = new QAction*[ApplicationSettings::getInstance()->getMaxRecentProjectsCount()]; @@ -371,7 +371,7 @@ void QtMainWindow::setContentEnabled(bool enabled) void QtMainWindow::refreshStyle() { - setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("main/main.css"))).c_str()); + setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(L"main/main.css")).c_str()); } void QtMainWindow::setWindowsTaskbarProgress(float progress) @@ -589,7 +589,7 @@ void QtMainWindow::openProject() if (!fileName.isEmpty()) { - MessageLoadProject(FilePath(fileName.toStdString())).dispatch(); + MessageLoadProject(FilePath(fileName.toStdWString())).dispatch(); m_windowStack.clearWindows(); } } @@ -692,7 +692,7 @@ void QtMainWindow::resetWindowLayout() { FileSystem::remove(UserPaths::getWindowSettingsPath()); FileSystem::copyFile( - ResourcePaths::getFallbackPath().concatenate(FilePath("window_settings.ini")), + ResourcePaths::getFallbackPath().concatenate(L"window_settings.ini"), UserPaths::getWindowSettingsPath() ); loadDockWidgetLayout(); @@ -703,7 +703,7 @@ void QtMainWindow::openRecentProject() QAction *action = qobject_cast(sender()); if (action) { - MessageLoadProject(FilePath(action->data().toString().toStdString())).dispatch(); + MessageLoadProject(FilePath(action->data().toString().toStdWString())).dispatch(); m_windowStack.clearWindows(); } } diff --git a/src/lib_gui/qt/window/QtSelectPathsDialog.cpp b/src/lib_gui/qt/window/QtSelectPathsDialog.cpp index ed625513..475b88e8 100644 --- a/src/lib_gui/qt/window/QtSelectPathsDialog.cpp +++ b/src/lib_gui/qt/window/QtSelectPathsDialog.cpp @@ -21,7 +21,7 @@ std::vector QtSelectPathsDialog::getPathsList() const { if (m_list->item(i)->checkState() == Qt::Checked) { - checkedPaths.push_back(FilePath(m_list->item(i)->text().toStdString())); + checkedPaths.push_back(FilePath(m_list->item(i)->text().toStdWString())); } } diff --git a/src/lib_gui/qt/window/QtStartScreen.cpp b/src/lib_gui/qt/window/QtStartScreen.cpp index acb92124..e207c63e 100644 --- a/src/lib_gui/qt/window/QtStartScreen.cpp +++ b/src/lib_gui/qt/window/QtStartScreen.cpp @@ -33,7 +33,7 @@ void QtRecentProjectButton::setProjectPath(const FilePath& projectFilePath) { m_projectFilePath = projectFilePath; m_projectExists = projectFilePath.exists(); - this->setText(m_projectFilePath.withoutExtension().fileName().c_str()); + this->setText(QString::fromStdWString(m_projectFilePath.withoutExtension().wFileName())); if (m_projectExists) { this->setToolTip(m_projectFilePath.str().c_str()); @@ -82,13 +82,12 @@ void QtRecentProjectButton::handleButtonClick() } } - QtStartScreen::QtStartScreen(QWidget *parent) : QtWindow(true, parent) - , m_cppIcon((ResourcePaths::getGuiPath().str() + "icon/cpp_icon.png").c_str()) - , m_cIcon((ResourcePaths::getGuiPath().str() + "icon/c_icon.png").c_str()) - , m_javaIcon((ResourcePaths::getGuiPath().str() + "icon/java_icon.png").c_str()) - , m_projectIcon((ResourcePaths::getGuiPath().str() + "icon/empty_icon.png").c_str()) + , m_cppIcon(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"icon/cpp_icon.png").wstr())) + , m_cIcon(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"icon/c_icon.png").wstr())) + , m_javaIcon(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"icon/java_icon.png").wstr())) + , m_projectIcon(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"icon/empty_icon.png").wstr())) { } @@ -142,15 +141,15 @@ void QtStartScreen::updateButtons() } i++; } - setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("startscreen/startscreen.css"))).c_str()); + setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(L"startscreen/startscreen.css")).c_str()); } void QtStartScreen::setupStartScreen() { License license; - license.loadFromEncodedString(ApplicationSettings::getInstance()->getLicenseString(), AppPath::getAppPath()); + license.loadFromEncodedString(ApplicationSettings::getInstance()->getLicenseString(), AppPath::getAppPath().str()); - setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("startscreen/startscreen.css"))).c_str()); + setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(L"startscreen/startscreen.css")).c_str()); addLogo(); QHBoxLayout* layout = new QHBoxLayout(); diff --git a/src/lib_gui/qt/window/QtWindow.cpp b/src/lib_gui/qt/window/QtWindow.cpp index b7b5dc48..48741e5b 100644 --- a/src/lib_gui/qt/window/QtWindow.cpp +++ b/src/lib_gui/qt/window/QtWindow.cpp @@ -88,7 +88,7 @@ QSize QtWindow::sizeHint() const void QtWindow::setup() { - setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("window/window.css"))).c_str()); + setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(L"window/window.css")).c_str()); QVBoxLayout* layout = new QVBoxLayout(); layout->setContentsMargins(10, 10, 10, 10); diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzard.cpp b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzard.cpp index fc2bfcf4..99a6d78f 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzard.cpp +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzard.cpp @@ -31,6 +31,7 @@ #include "utility/utility.h" #include "utility/utilityApp.h" #include "utility/utilityPathDetection.h" +#include "utility/utilityQString.h" #include "utility/utilityString.h" #include "utility/utilityUuid.h" @@ -74,7 +75,7 @@ void QtProjectWizzard::newProjectFromCDB(const FilePath& filePath, const std::ve if (m_projectSettings->getProjectFilePath().empty()) { - m_projectSettings->setProjectFilePath(filePath.withoutExtension().fileName(), filePath.getParentDirectory()); + m_projectSettings->setProjectFilePath(filePath.withoutExtension().wFileName(), filePath.getParentDirectory()); } if (!m_contentWidget) @@ -841,7 +842,12 @@ void QtProjectWizzard::dependenciesJava() void QtProjectWizzard::sourcePathsJavaMaven() { std::dynamic_pointer_cast(m_newSourceGroupSettings)->setMavenDependenciesDirectory( - FilePath("./sourcetrail_dependencies/" + utility::replace(m_projectSettings->getProjectName(), " ", "_") + "/" + m_newSourceGroupSettings->getId() + "/maven") + FilePath( + L"./sourcetrail_dependencies/" + utility::replace(m_projectSettings->getProjectName(), L" ", L"_") + + L"/" + + utility::decodeFromUtf8(m_newSourceGroupSettings->getId()) + + L"/maven" + ) ); QtProjectWizzardWindow* window = createWindowWithContentGroup( @@ -860,7 +866,12 @@ void QtProjectWizzard::sourcePathsJavaMaven() void QtProjectWizzard::sourcePathsJavaGradle() { std::dynamic_pointer_cast(m_newSourceGroupSettings)->setGradleDependenciesDirectory( - FilePath("./sourcetrail_dependencies/" + utility::replace(m_projectSettings->getProjectName(), " ", "_") + "/" + m_newSourceGroupSettings->getId() + "/gradle") + FilePath( + L"./sourcetrail_dependencies/" + utility::replace(m_projectSettings->getProjectName(), L" ", L"_") + + L"/" + + utility::decodeFromUtf8(m_newSourceGroupSettings->getId()) + + L"/gradle" + ) ); QtProjectWizzardWindow* window = createWindowWithContentGroup( @@ -938,7 +949,7 @@ void QtProjectWizzard::createProject() } else { - MessageStatus("Created project: " + path.str()).dispatch(); + MessageStatus(L"Created project: " + path.wstr()).dispatch(); } MessageLoadProject(path, settingsChanged).dispatch(); diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPath.cpp b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPath.cpp index 0bf545d2..8c0b0377 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPath.cpp +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPath.cpp @@ -60,7 +60,7 @@ bool QtProjectWizzardContentPath::check() break; } - FilePath path = m_settings->makePathExpandedAndAbsolute(FilePath(m_picker->getText().toStdString())); + FilePath path = m_settings->makePathExpandedAndAbsolute(FilePath(m_picker->getText().toStdWString())); if (m_picker->pickDirectory()) { @@ -157,7 +157,7 @@ void QtProjectWizzardContentPathCDB::save() std::dynamic_pointer_cast(m_settings); if (settings) { - settings->setCompilationDatabasePath(FilePath(m_picker->getText().toStdString())); + settings->setCompilationDatabasePath(FilePath(m_picker->getText().toStdWString())); } } @@ -216,7 +216,7 @@ void QtProjectWizzardContentPathSourceMaven::save() std::shared_ptr settings = std::dynamic_pointer_cast(m_settings); if (settings) { - settings->setMavenProjectFilePath(FilePath(m_picker->getText().toStdString())); + settings->setMavenProjectFilePath(FilePath(m_picker->getText().toStdWString())); settings->setShouldIndexMavenTests(m_shouldIndexTests->isChecked()); } } @@ -240,8 +240,8 @@ std::vector QtProjectWizzardContentPathSourceMaven::getFileNames() const bool success = utility::mavenGenerateSources(mavenPath, mavenProjectRoot); if (!success) { - const std::string dialogMessage = - "Sourcetrail was unable to locate Maven on this machine.\n" + const std::wstring dialogMessage = + L"Sourcetrail was unable to locate Maven on this machine.\n" "Please make sure to provide the correct Maven Path in the preferences."; MessageStatus(dialogMessage, true, false).dispatch(); @@ -308,7 +308,7 @@ void QtProjectWizzardContentPathDependenciesMaven::save() std::shared_ptr settings = std::dynamic_pointer_cast(m_settings); if (settings) { - settings->setMavenDependenciesDirectory(FilePath(m_picker->getText().toStdString())); + settings->setMavenDependenciesDirectory(FilePath(m_picker->getText().toStdWString())); } } @@ -361,7 +361,7 @@ void QtProjectWizzardContentPathSourceGradle::save() std::shared_ptr settings = std::dynamic_pointer_cast(m_settings); if (settings) { - settings->setGradleProjectFilePath(FilePath(m_picker->getText().toStdString())); + settings->setGradleProjectFilePath(FilePath(m_picker->getText().toStdWString())); settings->setShouldIndexGradleTests(m_shouldIndexTests->isChecked()); } } @@ -439,6 +439,6 @@ void QtProjectWizzardContentPathDependenciesGradle::save() std::shared_ptr settings = std::dynamic_pointer_cast(m_settings); if (settings) { - settings->setGradleDependenciesDirectory(FilePath(m_picker->getText().toStdString())); + settings->setGradleDependenciesDirectory(FilePath(m_picker->getText().toStdWString())); } } diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPreferences.cpp b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPreferences.cpp index daf1aa63..bc139f40 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPreferences.cpp +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPreferences.cpp @@ -69,7 +69,7 @@ void QtProjectWizzardContentPreferences::populate(QGridLayout* layout, int& row) m_colorSchemes = addComboBox("Color Scheme", "", layout, row); for (size_t i = 0; i < m_colorSchemePaths.size(); i++) { - m_colorSchemes->insertItem(i, m_colorSchemePaths[i].withoutExtension().fileName().c_str()); + m_colorSchemes->insertItem(i, QString::fromStdWString(m_colorSchemePaths[i].withoutExtension().wFileName())); } connect(m_colorSchemes, static_cast(&QComboBox::activated), this, &QtProjectWizzardContentPreferences::colorSchemeChanged); @@ -411,7 +411,7 @@ void QtProjectWizzardContentPreferences::load() if (m_javaPath) { - m_javaPath->setText(QString::fromStdString(appSettings->getJavaPath())); + m_javaPath->setText(QString::fromStdWString(appSettings->getJavaPath().wstr())); } m_jvmMaximumMemory->setText(QString::number(appSettings->getJavaMaximumMemory())); @@ -472,7 +472,7 @@ void QtProjectWizzardContentPreferences::save() if (m_javaPath) { - appSettings->setJavaPath(FilePath(m_javaPath->getText().toStdString())); + appSettings->setJavaPath(FilePath(m_javaPath->getText().toStdWString())); } appSettings->setJreSystemLibraryPaths(m_jreSystemLibraryPaths->getList()); @@ -482,7 +482,7 @@ void QtProjectWizzardContentPreferences::save() if (m_mavenPath) { - appSettings->setMavenPath(FilePath(m_mavenPath->getText().toStdString())); + appSettings->setMavenPath(FilePath(m_mavenPath->getText().toStdWString())); } appSettings->save(); diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentProjectData.cpp b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentProjectData.cpp index 14fab7d6..6576e0eb 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentProjectData.cpp +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentProjectData.cpp @@ -56,15 +56,15 @@ void QtProjectWizzardContentProjectData::populate(QGridLayout* layout, int& row) void QtProjectWizzardContentProjectData::load() { - m_projectName->setText(QString::fromStdString(m_projectSettings->getProjectName())); - m_projectFileLocation->setText(QString::fromStdString(m_projectSettings->getProjectDirectoryPath().str())); + m_projectName->setText(QString::fromStdWString(m_projectSettings->getProjectName())); + m_projectFileLocation->setText(QString::fromStdWString(m_projectSettings->getProjectDirectoryPath().wstr())); } void QtProjectWizzardContentProjectData::save() { m_projectSettings->setProjectFilePath( - m_projectName->text().toStdString(), - FilePath(m_projectFileLocation->getText().toStdString()) + m_projectName->text().toStdWString(), + FilePath(m_projectFileLocation->getText().toStdWString()) ); } @@ -86,7 +86,7 @@ bool QtProjectWizzardContentProjectData::check() return false; } - std::vector paths = FilePath(m_projectFileLocation->getText().toStdString()).expandEnvironmentVariables(); + std::vector paths = FilePath(m_projectFileLocation->getText().toStdWString()).expandEnvironmentVariables(); if (paths.size() != 1 || !paths[0].exists()) { QMessageBox msgBox; diff --git a/src/lib_gui/utility/path_detector/cxx_header/CxxVs10To14HeaderPathDetector.cpp b/src/lib_gui/utility/path_detector/cxx_header/CxxVs10To14HeaderPathDetector.cpp index 3478ab54..a7481d92 100644 --- a/src/lib_gui/utility/path_detector/cxx_header/CxxVs10To14HeaderPathDetector.cpp +++ b/src/lib_gui/utility/path_detector/cxx_header/CxxVs10To14HeaderPathDetector.cpp @@ -29,13 +29,9 @@ std::vector CxxVs10To14HeaderPathDetector::getPaths() const std::vector headerSearchPaths; if (vsInstallPath.exists()) { - std::vector subdirectories; - subdirectories.push_back("vc/include"); - subdirectories.push_back("vc/atlmfc/include"); - - for (size_t i = 0; i < subdirectories.size(); i++) + for (const std::wstring& subdirectory : { L"vc/include" , L"vc/atlmfc/include" }) { - FilePath headerSearchPath = vsInstallPath.getConcatenated(FilePath(subdirectories[i])); + FilePath headerSearchPath = vsInstallPath.getConcatenated(subdirectory); if (headerSearchPath.exists()) { headerSearchPaths.push_back(headerSearchPath.makeCanonical()); @@ -98,7 +94,7 @@ FilePath CxxVs10To14HeaderPathDetector::getVsInstallPathUsingRegistry() const QSettings expressKey(key, QSettings::NativeFormat); // NativeFormat means from Registry on Windows. QString value = expressKey.value("InstallDir").toString() + "../../"; - FilePath path(value.toStdString()); + FilePath path(value.toStdWString()); if (path.exists()) { return path; diff --git a/src/lib_gui/utility/path_detector/cxx_header/CxxVs15HeaderPathDetector.cpp b/src/lib_gui/utility/path_detector/cxx_header/CxxVs15HeaderPathDetector.cpp index 446297d0..ced95921 100644 --- a/src/lib_gui/utility/path_detector/cxx_header/CxxVs15HeaderPathDetector.cpp +++ b/src/lib_gui/utility/path_detector/cxx_header/CxxVs15HeaderPathDetector.cpp @@ -22,7 +22,7 @@ std::vector CxxVs15HeaderPathDetector::getPaths() const std::vector headerSearchPaths; { - const std::vector expandedPaths = FilePath("%ProgramFiles(x86)%/Microsoft Visual Studio/Installer/vswhere.exe").expandEnvironmentVariables(); + const std::vector expandedPaths = FilePath(L"%ProgramFiles(x86)%/Microsoft Visual Studio/Installer/vswhere.exe").expandEnvironmentVariables(); if (!expandedPaths.empty()) { const std::string command = "\"" + expandedPaths[0].str() + "\" -latest -property installationPath"; @@ -32,16 +32,16 @@ std::vector CxxVs15HeaderPathDetector::getPaths() const const FilePath vsInstallPath(output); if (vsInstallPath.exists()) { - for (const FilePath& versionPath : FileSystem::getDirectSubDirectories(vsInstallPath.getConcatenated(FilePath("VC/Tools/MSVC")))) + for (const FilePath& versionPath : FileSystem::getDirectSubDirectories(vsInstallPath.getConcatenated(L"VC/Tools/MSVC"))) { if (versionPath.exists()) { - headerSearchPaths.push_back(versionPath.getConcatenated(FilePath("include"))); - headerSearchPaths.push_back(versionPath.getConcatenated(FilePath("atlmfc/include"))); + headerSearchPaths.push_back(versionPath.getConcatenated(L"include")); + headerSearchPaths.push_back(versionPath.getConcatenated(L"atlmfc/include")); } } - headerSearchPaths.push_back(vsInstallPath.getConcatenated(FilePath("VC/Auxiliary/VS/include"))); - headerSearchPaths.push_back(vsInstallPath.getConcatenated(FilePath("VC/Auxiliary/VS/UnitTest/include"))); + headerSearchPaths.push_back(vsInstallPath.getConcatenated(L"VC/Auxiliary/VS/include")); + headerSearchPaths.push_back(vsInstallPath.getConcatenated(L"VC/Auxiliary/VS/UnitTest/include")); } } } diff --git a/src/lib_gui/utility/path_detector/cxx_header/utilityCxxHeaderDetection.cpp b/src/lib_gui/utility/path_detector/cxx_header/utilityCxxHeaderDetection.cpp index 77c67ce2..21c7b80b 100644 --- a/src/lib_gui/utility/path_detector/cxx_header/utilityCxxHeaderDetection.cpp +++ b/src/lib_gui/utility/path_detector/cxx_header/utilityCxxHeaderDetection.cpp @@ -44,18 +44,13 @@ namespace utility const FilePath sdkPath = getWindowsSdkRootPathUsingRegistry(architectureType, windowsSdkVersions[i]); if (sdkPath.exists()) { - const FilePath sdkIncludePath = sdkPath.getConcatenated(FilePath("include/")); + const FilePath sdkIncludePath = sdkPath.getConcatenated(L"include/"); if (sdkIncludePath.exists()) { - std::vector subdirectories; - subdirectories.push_back("shared"); - subdirectories.push_back("um"); - subdirectories.push_back("winrt"); - bool usingSubdirectories = false; - for (size_t j = 0; j < subdirectories.size(); j++) + for (const std::wstring subDirectory : { L"shared", L"um", L"winrt" }) { - const FilePath sdkSubdirectory = sdkIncludePath.getConcatenated(FilePath(subdirectories[j])); + const FilePath sdkSubdirectory = sdkIncludePath.getConcatenated(subDirectory); if (sdkSubdirectory.exists()) { headerSearchPaths.push_back(sdkSubdirectory); @@ -75,9 +70,9 @@ namespace utility const FilePath sdkPath = getWindowsSdkRootPathUsingRegistry(architectureType, "v10.0"); if (sdkPath.exists()) { - for (const FilePath& versionPath : FileSystem::getDirectSubDirectories(sdkPath.getConcatenated(FilePath("include/")))) + for (const FilePath& versionPath : FileSystem::getDirectSubDirectories(sdkPath.getConcatenated(L"include/"))) { - const FilePath ucrtPath = versionPath.getConcatenated(FilePath("ucrt")); + const FilePath ucrtPath = versionPath.getConcatenated(L"ucrt"); if (ucrtPath.exists()) { headerSearchPaths.push_back(ucrtPath); @@ -102,7 +97,7 @@ namespace utility QSettings expressKey(key, QSettings::NativeFormat); // NativeFormat means from Registry on Windows. QString value = expressKey.value("InstallationFolder").toString(); - FilePath path(value.toStdString()); + FilePath path(value.toStdWString()); if (path.exists()) { return path; diff --git a/src/lib_gui/utility/path_detector/java_runtime/JavaPathDetectorLinux.cpp b/src/lib_gui/utility/path_detector/java_runtime/JavaPathDetectorLinux.cpp index c94af8f1..f5b43872 100644 --- a/src/lib_gui/utility/path_detector/java_runtime/JavaPathDetectorLinux.cpp +++ b/src/lib_gui/utility/path_detector/java_runtime/JavaPathDetectorLinux.cpp @@ -5,9 +5,9 @@ #include "utility/utilityString.h" #ifdef __x86_64__ - const char jvmLibPathRelativeToJavaExecutable[] = "/../lib/amd64/server/libjvm.so"; + const wchar_t jvmLibPathRelativeToJavaExecutable[] = L"/../lib/amd64/server/libjvm.so"; #else - const char jvmLibPathRelativeToJavaExecutable[] = "/../lib/i386/server/libjvm.so"; + const wchar_t jvmLibPathRelativeToJavaExecutable[] = L"/../lib/i386/server/libjvm.so"; #endif @@ -25,7 +25,7 @@ FilePath JavaPathDetectorLinux::getJavaInPath() const std::string command = "which java"; std::string output = utility::executeProcess(command.c_str()); - if (output.size()) + if (!output.empty()) { output = utility::trim(output); @@ -52,7 +52,7 @@ FilePath JavaPathDetectorLinux::readLink(const FilePath& path) const FilePath JavaPathDetectorLinux::getFilePathRelativeToJavaExecutable(FilePath& javaExecutablePath) const { - FilePath p(javaExecutablePath.getParentDirectory().str() + jvmLibPathRelativeToJavaExecutable); + FilePath p = javaExecutablePath.getParentDirectory().concatenate(jvmLibPathRelativeToJavaExecutable); if (p.exists()) { return p.makeCanonical(); @@ -90,20 +90,20 @@ std::vector JavaPathDetectorLinux::getPaths() const { std::vector paths; FilePath p = getJavaInPath(); - if( !p.empty() ) + if(!p.empty()) { paths.push_back(p); } p = getJavaInJavaHome(); - if( !p.empty() ) + if(!p.empty()) { paths.push_back(p); } // some default paths for java - paths.push_back(FilePath("/etc/alternatives/java")); - paths.push_back(FilePath("/usr/lib/jvm/default/bin/java")); - paths.push_back(FilePath("/usr/lib/jvm/java-openjdk/bin/java")); + paths.push_back(FilePath(L"/etc/alternatives/java")); + paths.push_back(FilePath(L"/usr/lib/jvm/default/bin/java")); + paths.push_back(FilePath(L"/usr/lib/jvm/java-openjdk/bin/java")); for (const FilePath& path : paths ) { diff --git a/src/lib_gui/utility/path_detector/java_runtime/JavaPathDetectorMac.cpp b/src/lib_gui/utility/path_detector/java_runtime/JavaPathDetectorMac.cpp index 04ade598..49859ae1 100644 --- a/src/lib_gui/utility/path_detector/java_runtime/JavaPathDetectorMac.cpp +++ b/src/lib_gui/utility/path_detector/java_runtime/JavaPathDetectorMac.cpp @@ -21,14 +21,14 @@ std::vector JavaPathDetectorMac::getPaths() const std::string command = "/usr/libexec/java_home"; std::string output = utility::executeProcess(command.c_str()); - if (output.size()) + if (!output.empty()) { javaPath = FilePath(utility::trim(output) + "/jre/lib/jli/libjli.dylib"); } if (!javaPath.exists()) { - javaPath = FilePath("/usr/lib/libjli.dylib"); + javaPath = FilePath(L"/usr/lib/libjli.dylib"); } if (!javaPath.exists() && output.size()) @@ -38,7 +38,7 @@ std::vector JavaPathDetectorMac::getPaths() const if (!javaPath.exists()) { - javaPath = FilePath("/usr/lib/libjvm.dylib"); + javaPath = FilePath(L"/usr/lib/libjvm.dylib"); } if (javaPath.exists()) diff --git a/src/lib_gui/utility/path_detector/java_runtime/JavaPathDetectorWindows.cpp b/src/lib_gui/utility/path_detector/java_runtime/JavaPathDetectorWindows.cpp index 6ed57606..9117af35 100644 --- a/src/lib_gui/utility/path_detector/java_runtime/JavaPathDetectorWindows.cpp +++ b/src/lib_gui/utility/path_detector/java_runtime/JavaPathDetectorWindows.cpp @@ -29,7 +29,7 @@ std::vector JavaPathDetectorWindows::getPaths() const QSettings expressKey(key, QSettings::NativeFormat); // NativeFormat means from Registry on Windows. QString value = expressKey.value("RuntimeLib").toString(); - FilePath path(value.toStdString()); + FilePath path(value.toStdWString()); std::vector paths; if (path.exists()) diff --git a/src/lib_gui/utility/path_detector/jre_system_library/JreSystemLibraryPathDetector.cpp b/src/lib_gui/utility/path_detector/jre_system_library/JreSystemLibraryPathDetector.cpp index 7c755ff0..e259acc5 100644 --- a/src/lib_gui/utility/path_detector/jre_system_library/JreSystemLibraryPathDetector.cpp +++ b/src/lib_gui/utility/path_detector/jre_system_library/JreSystemLibraryPathDetector.cpp @@ -22,7 +22,7 @@ std::vector JreSystemLibraryPathDetector::getPaths() const for (const FilePath& jrePath: m_javaPathDetector->getPaths()) { const FilePath javaRoot = jrePath.getParentDirectory().getParentDirectory().getParentDirectory(); - for (const FilePath& jarPath : FileSystem::getFilePathsFromDirectory(javaRoot.getConcatenated(FilePath("lib")), {".jar"})) + for (const FilePath& jarPath : FileSystem::getFilePathsFromDirectory(javaRoot.getConcatenated(L"lib"), {".jar"})) { paths.push_back(jarPath); } diff --git a/src/lib_gui/utility/utilityApp.cpp b/src/lib_gui/utility/utilityApp.cpp index c78692e8..cb4c0752 100644 --- a/src/lib_gui/utility/utilityApp.cpp +++ b/src/lib_gui/utility/utilityApp.cpp @@ -165,9 +165,9 @@ bool utility::saveLicense(const License* license) return false; } - std::string appLocation = AppPath::getAppPath(); - appSettings->setLicenseString(license->getLicenseEncodedString(appLocation)); - appSettings->setLicenseCheck(license->hashLocation(FilePath(appLocation).makeAbsolute().str())); + const FilePath appLocation = AppPath::getAppPath(); + appSettings->setLicenseString(license->getLicenseEncodedString(appLocation.str())); + appSettings->setLicenseCheck(license->hashLocation(appLocation.getAbsolute().str())); appSettings->save(); return true; } diff --git a/src/lib_gui/utility/utilityQString.cpp b/src/lib_gui/utility/utilityQString.cpp new file mode 100644 index 00000000..46023f8e --- /dev/null +++ b/src/lib_gui/utility/utilityQString.cpp @@ -0,0 +1,15 @@ +#include "utility/utilityQString.h" + +#include + +std::wstring utility::decodeFromUtf8(std::string s) +{ + QString qs = QString::fromUtf8(s.c_str()); + return qs.toStdWString(); +} + +std::string utility::encodeToUtf8(std::wstring s) +{ + QString qs = QString::fromStdWString(s); + return qs.toUtf8().toStdString(); +} \ No newline at end of file diff --git a/src/lib_gui/utility/utilityQString.h b/src/lib_gui/utility/utilityQString.h new file mode 100644 index 00000000..811e79ce --- /dev/null +++ b/src/lib_gui/utility/utilityQString.h @@ -0,0 +1,13 @@ +#ifndef UTILITY_Q_STRING_H +#define UTILITY_Q_STRING_H + +#include + +namespace utility +{ + std::wstring decodeFromUtf8(std::string s); + std::string encodeToUtf8(std::wstring s); +} + +#endif // UTILITY_Q_STRING_H + diff --git a/src/lib_java/data/parser/java/JavaEnvironmentFactory.cpp b/src/lib_java/data/parser/java/JavaEnvironmentFactory.cpp index ed97d8b8..ded0995d 100644 --- a/src/lib_java/data/parser/java/JavaEnvironmentFactory.cpp +++ b/src/lib_java/data/parser/java/JavaEnvironmentFactory.cpp @@ -27,7 +27,7 @@ void JavaEnvironmentFactory::createInstance(std::string classPath, std::string& } std::function createInstanceFunction; - const FilePath javaPath(ApplicationSettings::getInstance()->getJavaPath()); + const FilePath javaPath = ApplicationSettings::getInstance()->getJavaPath(); createInstanceFunction = utility::loadFunctionFromLibrary( javaPath, "JNI_CreateJavaVM", diff --git a/src/lib_java/project/SourceGroupJava.cpp b/src/lib_java/project/SourceGroupJava.cpp index 66e935e9..27762dce 100644 --- a/src/lib_java/project/SourceGroupJava.cpp +++ b/src/lib_java/project/SourceGroupJava.cpp @@ -11,6 +11,8 @@ #include "utility/text/TextAccess.h" #include "utility/ScopedFunctor.h" #include "utility/utilityJava.h" +#include "utility/utilityQString.h" +#include "utility/utilityString.h" #include "Application.h" SourceGroupJava::SourceGroupJava() @@ -63,7 +65,7 @@ std::shared_ptr SourceGroupJava::getSourceGroupSettin bool SourceGroupJava::prepareJavaEnvironment() { - const std::string errorString = utility::prepareJavaEnvironment(); + const std::wstring errorString = utility::decodeFromUtf8(utility::prepareJavaEnvironment()); if (errorString.size() > 0) { @@ -73,13 +75,13 @@ bool SourceGroupJava::prepareJavaEnvironment() if (!JavaEnvironmentFactory::getInstance()) { - std::string dialogMessage = - "Sourcetrail was unable to locate Java on this machine.\n" + std::wstring dialogMessage = + L"Sourcetrail was unable to locate Java on this machine.\n" "Please make sure to provide the correct Java Path in the preferences."; - if (errorString.size() > 0) + if (!errorString.empty()) { - dialogMessage += "\n\nError: " + errorString; + dialogMessage += L"\n\nError: " + errorString; } MessageStatus(dialogMessage, true, false).dispatch(); @@ -163,7 +165,7 @@ std::set SourceGroupJava::fetchRootDirectories() const const std::vector packageNameParts = utility::splitToVector(packageName, "."); for (std::vector::const_reverse_iterator it = packageNameParts.rbegin(); it != packageNameParts.rend(); it++) { - if (rootPath.fileName() != (*it)) + if (rootPath.wFileName() != utility::decodeFromUtf8(*it)) { success = false; break; diff --git a/src/lib_java/project/SourceGroupJavaMaven.cpp b/src/lib_java/project/SourceGroupJavaMaven.cpp index a2c13373..396028a8 100644 --- a/src/lib_java/project/SourceGroupJavaMaven.cpp +++ b/src/lib_java/project/SourceGroupJavaMaven.cpp @@ -105,8 +105,8 @@ bool SourceGroupJavaMaven::prepareMavenData() if (!success) { - const std::string dialogMessage = - "Sourcetrail was unable to locate Maven on this machine.\n" + const std::wstring dialogMessage = + L"Sourcetrail was unable to locate Maven on this machine.\n" "Please make sure to provide the correct Maven Path in the preferences."; MessageStatus(dialogMessage, true, false).dispatch(); diff --git a/src/lib_java/utility/utilityGradle.cpp b/src/lib_java/utility/utilityGradle.cpp index d0c81dfe..552ffde9 100644 --- a/src/lib_java/utility/utilityGradle.cpp +++ b/src/lib_java/utility/utilityGradle.cpp @@ -18,7 +18,7 @@ namespace { if (getenv("JAVA_HOME") == nullptr) { - const FilePath javaPath(ApplicationSettings::getInstance()->getJavaPath()); + const FilePath javaPath = ApplicationSettings::getInstance()->getJavaPath(); const FilePath javaHomePath = javaPath.getParentDirectory().getParentDirectory().getParentDirectory(); LOG_WARNING("Environment variable \"JAVA_HOME\" not found on system. Setting value to \"" + javaHomePath.str() + "\" for this process."); diff --git a/src/lib_java/utility/utilityJava.cpp b/src/lib_java/utility/utilityJava.cpp index 3fa1d41f..48468cac 100644 --- a/src/lib_java/utility/utilityJava.cpp +++ b/src/lib_java/utility/utilityJava.cpp @@ -6,29 +6,28 @@ namespace utility { - std::vector getRequiredJarNames() + std::vector getRequiredJarNames() { - std::vector jarNames = { - "gradle-tooling-api-4.2.jar", - "java-indexer.jar", - "org.eclipse.core.commands-3.9.0.jar", - "org.eclipse.core.contenttype-3.6.0.jar", - "org.eclipse.core.expressions-3.6.0.jar", - "org.eclipse.core.filesystem-1.7.0.jar", - "org.eclipse.core.jobs-3.9.2.jar", - "org.eclipse.core.resources-3.12.0.jar", - "org.eclipse.core.runtime-3.13.0.jar", - "org.eclipse.equinox.app-1.3.400.jar", - "org.eclipse.equinox.common-3.9.0.jar", - "org.eclipse.equinox.preferences-3.7.0.jar", - "org.eclipse.equinox.registry-3.7.0.jar", - "org.eclipse.jdt.core-3.13.0.jar", - "org.eclipse.osgi-3.12.50.jar", - "org.eclipse.text-3.6.100.jar", - "slf4j-api-1.7.10.jar", - "slf4j-simple-1.7.10.jar" + return { + L"gradle-tooling-api-4.2.jar", + L"java-indexer.jar", + L"org.eclipse.core.commands-3.9.0.jar", + L"org.eclipse.core.contenttype-3.6.0.jar", + L"org.eclipse.core.expressions-3.6.0.jar", + L"org.eclipse.core.filesystem-1.7.0.jar", + L"org.eclipse.core.jobs-3.9.2.jar", + L"org.eclipse.core.resources-3.12.0.jar", + L"org.eclipse.core.runtime-3.13.0.jar", + L"org.eclipse.equinox.app-1.3.400.jar", + L"org.eclipse.equinox.common-3.9.0.jar", + L"org.eclipse.equinox.preferences-3.7.0.jar", + L"org.eclipse.equinox.registry-3.7.0.jar", + L"org.eclipse.jdt.core-3.13.0.jar", + L"org.eclipse.osgi-3.12.50.jar", + L"org.eclipse.text-3.6.100.jar", + L"slf4j-api-1.7.10.jar", + L"slf4j-simple-1.7.10.jar" }; - return jarNames; } std::string prepareJavaEnvironment() @@ -45,14 +44,14 @@ namespace utility std::string classPath = ""; { - const std::vector jarNames = getRequiredJarNames(); + const std::vector jarNames = getRequiredJarNames(); for (size_t i = 0; i < jarNames.size(); i++) { if (i != 0) { classPath += separator; } - classPath += ResourcePaths::getJavaPath().str() + "lib/" + jarNames[i]; + classPath += ResourcePaths::getJavaPath().concatenate(L"lib/" + jarNames[i]).str(); } } diff --git a/src/lib_java/utility/utilityJava.h b/src/lib_java/utility/utilityJava.h index bea49579..688a990e 100644 --- a/src/lib_java/utility/utilityJava.h +++ b/src/lib_java/utility/utilityJava.h @@ -8,7 +8,7 @@ class FilePath; namespace utility { - std::vector getRequiredJarNames(); + std::vector getRequiredJarNames(); std::string prepareJavaEnvironment(); } diff --git a/src/lib_java/utility/utilityMaven.cpp b/src/lib_java/utility/utilityMaven.cpp index e85cb442..1386e20f 100644 --- a/src/lib_java/utility/utilityMaven.cpp +++ b/src/lib_java/utility/utilityMaven.cpp @@ -50,7 +50,7 @@ namespace { if (getenv("JAVA_HOME") == nullptr) { - const FilePath javaPath(ApplicationSettings::getInstance()->getJavaPath()); + const FilePath javaPath = ApplicationSettings::getInstance()->getJavaPath(); const FilePath javaHomePath = javaPath.getParentDirectory().getParentDirectory().getParentDirectory(); LOG_WARNING("Environment variable \"JAVA_HOME\" not found on system. Setting value to \"" + javaHomePath.str() + "\" for this process."); @@ -165,9 +165,9 @@ namespace utility fetchDirectories(uncheckedDirectories, xmlAccess, utility::createVectorFromElements("projects", "project", "build", "sourceDirectory")); fetchDirectories(uncheckedDirectories, xmlAccess, - utility::createVectorFromElements("project", "build", "directory"), FilePath("generated-sources")); + utility::createVectorFromElements("project", "build", "directory"), FilePath(L"generated-sources")); fetchDirectories(uncheckedDirectories, xmlAccess, - utility::createVectorFromElements("projects", "project", "build", "directory"), FilePath("generated-sources")); + utility::createVectorFromElements("projects", "project", "build", "directory"), FilePath(L"generated-sources")); if (addTestDirectories) { @@ -176,9 +176,9 @@ namespace utility fetchDirectories(uncheckedDirectories, xmlAccess, utility::createVectorFromElements("projects", "project", "build", "testSourceDirectory")); fetchDirectories(uncheckedDirectories, xmlAccess, - utility::createVectorFromElements("project", "build", "directory"), FilePath("generated-test-sources")); + utility::createVectorFromElements("project", "build", "directory"), FilePath(L"generated-test-sources")); fetchDirectories(uncheckedDirectories, xmlAccess, - utility::createVectorFromElements("projects", "project", "build", "directory"), FilePath("generated-test-sources")); + utility::createVectorFromElements("projects", "project", "build", "directory"), FilePath(L"generated-test-sources")); } std::vector directories; diff --git a/src/lib_license/utility/Version.cpp b/src/lib_license/utility/Version.cpp index 1f5f7790..ce5c23cc 100644 --- a/src/lib_license/utility/Version.cpp +++ b/src/lib_license/utility/Version.cpp @@ -111,9 +111,12 @@ std::string Version::toString() const std::string Version::toDisplayString() const { - std::stringstream ss; - ss << m_year << '.' << m_minorNumber << '.' << m_commitNumber; - return ss.str(); + return std::to_string(m_year) + '.' + std::to_string(m_minorNumber) + '.' + std::to_string(m_commitNumber); +} + +std::wstring Version::toDisplayWString() const +{ + return std::to_wstring(m_year) + L'.' + std::to_wstring(m_minorNumber) + L'.' + std::to_wstring(m_commitNumber); } bool Version::operator<(const Version& other) const diff --git a/src/lib_license/utility/Version.h b/src/lib_license/utility/Version.h index 0cfc1225..5198fc08 100644 --- a/src/lib_license/utility/Version.h +++ b/src/lib_license/utility/Version.h @@ -19,6 +19,7 @@ public: std::string toString() const; std::string toShortString() const; std::string toDisplayString() const; + std::wstring toDisplayWString() const; bool operator<(const Version& other) const; bool operator>(const Version& other) const; diff --git a/src/test/CommandlineTestSuite.h b/src/test/CommandlineTestSuite.h index 3d103b9d..242b8f36 100644 --- a/src/test/CommandlineTestSuite.h +++ b/src/test/CommandlineTestSuite.h @@ -13,7 +13,7 @@ public: void setUp() { m_appSettingsPath = ApplicationSettings::getInstance()->getFilePath(); - ApplicationSettings::getInstance()->load(FilePath("data/CommandlineTestSuite/settings.xml")); + ApplicationSettings::getInstance()->load(FilePath(L"data/CommandlineTestSuite/settings.xml")); } void tearDown() diff --git a/src/test/ConfigManagerTestSuite.h b/src/test/ConfigManagerTestSuite.h index f659b0ff..fa498ec2 100644 --- a/src/test/ConfigManagerTestSuite.h +++ b/src/test/ConfigManagerTestSuite.h @@ -32,10 +32,10 @@ public: { std::shared_ptr config = ConfigManager::createAndLoad(getConfigTextAccess()); - std::string value; + std::wstring value; config->getValue("path/to/single_value", value); - TS_ASSERT_EQUALS("42", value); + TS_ASSERT_EQUALS(L"42", value); } @@ -114,9 +114,38 @@ public: void test_config_manager_save_and_load_configuration_and_compare() { + const FilePath path(L"data/ConfigManagerTestSuite/temp.xml"); + std::shared_ptr config = ConfigManager::createAndLoad(getConfigTextAccess()); - config->save("data/temp.xml"); - std::shared_ptr config2 = ConfigManager::createAndLoad(TextAccess::createFromFile(FilePath("data/temp.xml"))); + config->save(path.str()); + std::shared_ptr config2 = ConfigManager::createAndLoad(TextAccess::createFromFile(path)); + TS_ASSERT_EQUALS(config->toString(), config2->toString()); + } + + void test_config_manager_loads_special_character() + { + std::shared_ptr config = ConfigManager::createAndLoad( + TextAccess::createFromFile(FilePath(L"data/ConfigManagerTestSuite/test_data.xml")) + ); + std::wstring loadedSpecialCharacter; + config->getValue("path/to/special_character", loadedSpecialCharacter); + + TS_ASSERT_EQUALS(loadedSpecialCharacter.size(), 1); + TS_ASSERT_EQUALS(loadedSpecialCharacter[0], wchar_t(252)); // special character needs to be encoded as ASCII code because + // otherwise python and cxx compiler may be complaining + } + + void test_config_manager_save_and_load_special_character_and_compare() + { + const FilePath path(L"data/ConfigManagerTestSuite/temp.xml"); + std::wstring specialCharacter; + specialCharacter.push_back(wchar_t(252)); + + std::shared_ptr config = ConfigManager::createEmpty(); + config->setValue("path/to/special_character", specialCharacter); + config->save(path.str()); + + std::shared_ptr config2 = ConfigManager::createAndLoad(TextAccess::createFromFile(path)); TS_ASSERT_EQUALS(config->toString(), config2->toString()); } @@ -126,21 +155,20 @@ private: std::string text = "\n" "\n" - "\n" - "\n" - "0\n" - "1\n" - "42\n" - "\n" - "\n" - "\n" - "4\n" - "2\n" - "5\n" - "8\n" - "\n" + " \n" + " \n" + " 0\n" + " 1\n" + " 42\n" + " \n" + " \n" + " \n" + " 4\n" + " 2\n" + " 5\n" + " 8\n" + " \n" "\n"; return TextAccess::createFromString(text); } - }; diff --git a/src/test/CxxIncludeProcessingTestSuite.h b/src/test/CxxIncludeProcessingTestSuite.h index 1415dc8e..afbd8f6f 100644 --- a/src/test/CxxIncludeProcessingTestSuite.h +++ b/src/test/CxxIncludeProcessingTestSuite.h @@ -12,7 +12,7 @@ public: { std::vector includeDirectives = IncludeProcessing::getIncludeDirectives(TextAccess::createFromString( "#include \"foo.h\"", - FilePath("foo.cpp") + FilePath(L"foo.cpp") )); TS_ASSERT(!includeDirectives.empty()); @@ -28,7 +28,7 @@ public: { std::vector includeDirectives = IncludeProcessing::getIncludeDirectives(TextAccess::createFromString( "#include ", - FilePath("foo.cpp") + FilePath(L"foo.cpp") )); TS_ASSERT(!includeDirectives.empty()); @@ -43,7 +43,7 @@ public: { std::vector includeDirectives = IncludeProcessing::getIncludeDirectives(TextAccess::createFromString( "# include \"foo.h\"", - FilePath("foo.cpp") + FilePath(L"foo.cpp") )); TS_ASSERT(!includeDirectives.empty()); @@ -73,8 +73,8 @@ public: void test_header_search_path_detection_does_not_find_path_relative_to_including_file() { std::vector headerSearchDirectories = utility::toVector(IncludeProcessing::getHeaderSearchDirectories( - { FilePath("data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_does_not_find_path_relative_to_including_file/a.cpp") }, - { FilePath("data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_does_not_find_path_relative_to_including_file") }, + { FilePath(L"data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_does_not_find_path_relative_to_including_file/a.cpp") }, + { FilePath(L"data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_does_not_find_path_relative_to_including_file") }, { }, 1, [](float) {} )); @@ -85,65 +85,65 @@ public: void test_header_search_path_detection_finds_path_inside_sub_directory() { std::vector headerSearchDirectories = utility::toVector(IncludeProcessing::getHeaderSearchDirectories( - { FilePath("data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_inside_sub_directory/a.cpp") }, - { FilePath("data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_inside_sub_directory") }, + { FilePath(L"data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_inside_sub_directory/a.cpp") }, + { FilePath(L"data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_inside_sub_directory") }, {}, 1, [](float) {} )); TS_ASSERT(utility::containsElement( headerSearchDirectories, - FilePath("data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_inside_sub_directory/include").makeAbsolute() + FilePath(L"data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_inside_sub_directory/include").makeAbsolute() )); } void test_header_search_path_detection_finds_path_relative_to_sub_directory() { std::vector headerSearchDirectories = utility::toVector(IncludeProcessing::getHeaderSearchDirectories( - { FilePath("data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_relative_to_sub_directory/a.cpp") }, - { FilePath("data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_relative_to_sub_directory") }, + { FilePath(L"data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_relative_to_sub_directory/a.cpp") }, + { FilePath(L"data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_relative_to_sub_directory") }, {}, 1, [](float) {} )); TS_ASSERT(utility::containsElement( headerSearchDirectories, - FilePath("data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_relative_to_sub_directory/include").makeAbsolute() + FilePath(L"data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_relative_to_sub_directory/include").makeAbsolute() )); } void test_header_search_path_detection_finds_path_included_in_header_search_path() { std::vector headerSearchDirectories = utility::toVector(IncludeProcessing::getHeaderSearchDirectories( - { FilePath("data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_included_in_header_search_path/a.cpp") }, - { FilePath("data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_included_in_header_search_path/include_b") }, - { FilePath("data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_included_in_header_search_path/include_a") }, + { FilePath(L"data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_included_in_header_search_path/a.cpp") }, + { FilePath(L"data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_included_in_header_search_path/include_b") }, + { FilePath(L"data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_included_in_header_search_path/include_a") }, 1, [](float) {} )); TS_ASSERT(utility::containsElement( headerSearchDirectories, - FilePath("data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_included_in_header_search_path/include_b").makeAbsolute() + FilePath(L"data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_included_in_header_search_path/include_b").makeAbsolute() )); } void test_header_search_path_detection_finds_path_included_in_future_header_search_path() { std::vector headerSearchDirectories = utility::toVector(IncludeProcessing::getHeaderSearchDirectories( - { FilePath("data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_included_in_future_header_search_path/a.cpp") }, - { FilePath("data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_included_in_future_header_search_path") }, + { FilePath(L"data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_included_in_future_header_search_path/a.cpp") }, + { FilePath(L"data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_included_in_future_header_search_path") }, { }, 1, [](float) {} )); TS_ASSERT(utility::containsElement( headerSearchDirectories, - FilePath("data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_included_in_future_header_search_path/include_a").makeAbsolute() + FilePath(L"data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_included_in_future_header_search_path/include_a").makeAbsolute() )); TS_ASSERT(utility::containsElement( headerSearchDirectories, - FilePath("data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_included_in_future_header_search_path/include_b").makeAbsolute() + FilePath(L"data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_included_in_future_header_search_path/include_b").makeAbsolute() )); } }; diff --git a/src/test/CxxIndexSampleProjectsTestSuite.h b/src/test/CxxIndexSampleProjectsTestSuite.h index 19d923a6..90db677d 100644 --- a/src/test/CxxIndexSampleProjectsTestSuite.h +++ b/src/test/CxxIndexSampleProjectsTestSuite.h @@ -21,52 +21,52 @@ public: { #ifdef _WIN32 #ifdef NDEBUG - processSourceFile("Box2D", FilePath("Box2D/Collision/b2BroadPhase.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Collision/b2CollideCircle.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Collision/b2CollideEdge.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Collision/b2CollidePolygon.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Collision/b2Collision.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Collision/b2Distance.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Collision/b2DynamicTree.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Collision/b2TimeOfImpact.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Collision/Shapes/b2ChainShape.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Collision/Shapes/b2CircleShape.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Collision/Shapes/b2EdgeShape.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Collision/Shapes/b2PolygonShape.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Common/b2BlockAllocator.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Common/b2Draw.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Common/b2Math.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Common/b2Settings.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Common/b2StackAllocator.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Common/b2Timer.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/b2Body.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/b2ContactManager.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/b2Fixture.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/b2Island.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/b2World.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/b2WorldCallbacks.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2CircleContact.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2Contact.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2ContactSolver.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2PolygonContact.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2DistanceJoint.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2FrictionJoint.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2GearJoint.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2Joint.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2MotorJoint.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2MouseJoint.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2PrismaticJoint.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2PulleyJoint.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2RevoluteJoint.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2RopeJoint.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2WeldJoint.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2WheelJoint.cpp")); - processSourceFile("Box2D", FilePath("Box2D/Rope/b2Rope.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Collision/b2BroadPhase.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Collision/b2CollideCircle.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Collision/b2CollideEdge.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Collision/b2CollidePolygon.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Collision/b2Collision.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Collision/b2Distance.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Collision/b2DynamicTree.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Collision/b2TimeOfImpact.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Collision/Shapes/b2ChainShape.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Collision/Shapes/b2CircleShape.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Collision/Shapes/b2EdgeShape.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Collision/Shapes/b2PolygonShape.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Common/b2BlockAllocator.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Common/b2Draw.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Common/b2Math.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Common/b2Settings.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Common/b2StackAllocator.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Common/b2Timer.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/b2Body.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/b2ContactManager.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/b2Fixture.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/b2Island.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/b2World.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/b2WorldCallbacks.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/Contacts/b2CircleContact.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/Contacts/b2Contact.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/Contacts/b2ContactSolver.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/Contacts/b2PolygonContact.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/Joints/b2DistanceJoint.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/Joints/b2FrictionJoint.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/Joints/b2GearJoint.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/Joints/b2Joint.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/Joints/b2MotorJoint.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/Joints/b2MouseJoint.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/Joints/b2PrismaticJoint.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/Joints/b2PulleyJoint.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/Joints/b2RevoluteJoint.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/Joints/b2RopeJoint.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/Joints/b2WeldJoint.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Dynamics/Joints/b2WheelJoint.cpp")); + processSourceFile(L"Box2D", FilePath("Box2D/Rope/b2Rope.cpp")); #endif // NDEBUG #endif // _WIN32 } @@ -75,30 +75,30 @@ public: { #ifdef _WIN32 #ifdef NDEBUG - processSourceFile("Bullet3", FilePath("Bullet3Collision/BroadPhaseCollision/b3DynamicBvh.cpp")); - processSourceFile("Bullet3", FilePath("Bullet3Collision/BroadPhaseCollision/b3DynamicBvhBroadphase.cpp")); - processSourceFile("Bullet3", FilePath("Bullet3Collision/BroadPhaseCollision/b3OverlappingPairCache.cpp")); - processSourceFile("Bullet3", FilePath("Bullet3Collision/NarrowPhaseCollision/b3ConvexUtility.cpp")); - processSourceFile("Bullet3", FilePath("Bullet3Collision/NarrowPhaseCollision/b3CpuNarrowPhase.cpp")); - processSourceFile("Bullet3", FilePath("Bullet3Common/b3AlignedAllocator.cpp")); - processSourceFile("Bullet3", FilePath("Bullet3Common/b3Logging.cpp")); - processSourceFile("Bullet3", FilePath("Bullet3Common/b3Vector3.cpp")); - processSourceFile("Bullet3", FilePath("Bullet3Geometry/b3ConvexHullComputer.cpp")); - processSourceFile("Bullet3", FilePath("Bullet3Geometry/b3GeometryUtil.cpp")); + processSourceFile(L"Bullet3", FilePath("Bullet3Collision/BroadPhaseCollision/b3DynamicBvh.cpp")); + processSourceFile(L"Bullet3", FilePath("Bullet3Collision/BroadPhaseCollision/b3DynamicBvhBroadphase.cpp")); + processSourceFile(L"Bullet3", FilePath("Bullet3Collision/BroadPhaseCollision/b3OverlappingPairCache.cpp")); + processSourceFile(L"Bullet3", FilePath("Bullet3Collision/NarrowPhaseCollision/b3ConvexUtility.cpp")); + processSourceFile(L"Bullet3", FilePath("Bullet3Collision/NarrowPhaseCollision/b3CpuNarrowPhase.cpp")); + processSourceFile(L"Bullet3", FilePath("Bullet3Common/b3AlignedAllocator.cpp")); + processSourceFile(L"Bullet3", FilePath("Bullet3Common/b3Logging.cpp")); + processSourceFile(L"Bullet3", FilePath("Bullet3Common/b3Vector3.cpp")); + processSourceFile(L"Bullet3", FilePath("Bullet3Geometry/b3ConvexHullComputer.cpp")); + processSourceFile(L"Bullet3", FilePath("Bullet3Geometry/b3GeometryUtil.cpp")); #endif // NDEBUG #endif // _WIN32 } private: - void processSourceFile(const std::string& projectName, const FilePath& sourceFilePath) + void processSourceFile(const std::wstring& projectName, const FilePath& sourceFilePath) { - const FilePath projectDataRoot = FilePath("data/CxxIndexSampleProjectsTestSuite/" + projectName).makeAbsolute(); - const FilePath projectDataSrcRoot = projectDataRoot.getConcatenated(FilePath("src")); - const FilePath projectDataExpectedOutputRoot = projectDataRoot.getConcatenated(FilePath("expected_output")); + const FilePath projectDataRoot = FilePath(L"data/CxxIndexSampleProjectsTestSuite/" + projectName).makeAbsolute(); + const FilePath projectDataSrcRoot = projectDataRoot.getConcatenated(L"src"); + const FilePath projectDataExpectedOutputRoot = projectDataRoot.getConcatenated(L"expected_output"); std::shared_ptr output = parseCode(projectDataSrcRoot.getConcatenated(sourceFilePath), projectDataSrcRoot); - FilePath expectedOutputFilePath = projectDataExpectedOutputRoot.getConcatenated(FilePath(utility::replace(sourceFilePath.withoutExtension().str() + ".txt", "/", "_"))); + FilePath expectedOutputFilePath = projectDataExpectedOutputRoot.getConcatenated(utility::replace(sourceFilePath.withoutExtension().wstr() + L".txt", L"/", L"_")); if (s_updateExpectedOutput || !expectedOutputFilePath.exists()) { std::ofstream expectedOutputFile; @@ -109,7 +109,7 @@ private: else { std::shared_ptr expectedOutput = TextAccess::createFromFile(expectedOutputFilePath); - TSM_ASSERT_EQUALS("Output does not match the expected line count for file " + sourceFilePath.str() + " in project " + projectName, expectedOutput->getLineCount(), output->getLineCount()); + TSM_ASSERT_EQUALS(L"Output does not match the expected line count for file " + sourceFilePath.wstr() + L" in project " + projectName, expectedOutput->getLineCount(), output->getLineCount()); if (expectedOutput->getLineCount() == output->getLineCount()) { for (size_t i = 1; i <= expectedOutput->getLineCount(); i++) @@ -124,7 +124,7 @@ private: { const std::set indexedPaths = { projectDataSrcRoot }; const std::set excludedPaths = {}; - const FilePath workingDirectory("."); + const FilePath workingDirectory(L"."); std::shared_ptr fileRegister = std::make_shared( FileRegisterStateData(), diff --git a/src/test/CxxParserTestSuite.h b/src/test/CxxParserTestSuite.h index a78be47a..690e7e7a 100644 --- a/src/test/CxxParserTestSuite.h +++ b/src/test/CxxParserTestSuite.h @@ -3990,12 +3990,12 @@ public: void test_cxx_parser_parses_multiple_files() { - const std::set indexedPaths = { FilePath("data/CxxParserTestSuite/") }; + const std::set indexedPaths = { FilePath(L"data/CxxParserTestSuite/") }; const std::set excludedPaths; - const FilePath workingDirectory("."); + const FilePath workingDirectory(L"."); std::shared_ptr indexerCommand = std::make_shared( - FilePath("data/CxxParserTestSuite/code.cpp"), + FilePath(L"data/CxxParserTestSuite/code.cpp"), indexedPaths, excludedPaths, workingDirectory, diff --git a/src/test/FileManagerTestSuite.h b/src/test/FileManagerTestSuite.h index 78b6ce70..539d57a2 100644 --- a/src/test/FileManagerTestSuite.h +++ b/src/test/FileManagerTestSuite.h @@ -8,8 +8,8 @@ public: void test_file_manager_has_added_file_paths_after_first_fetch() { std::vector sourcePaths; - sourcePaths.push_back(FilePath("./data/FileManagerTestSuite/src/")); - sourcePaths.push_back(FilePath("./data/FileManagerTestSuite/include/")); + sourcePaths.push_back(FilePath(L"./data/FileManagerTestSuite/src/")); + sourcePaths.push_back(FilePath(L"./data/FileManagerTestSuite/include/")); std::vector headerPaths; std::vector excludePaths; std::vector sourceExtensions; diff --git a/src/test/FilePathTestSuite.h b/src/test/FilePathTestSuite.h index ecda69c3..20a6cb55 100644 --- a/src/test/FilePathTestSuite.h +++ b/src/test/FilePathTestSuite.h @@ -9,27 +9,20 @@ public: { const FilePath path; - TS_ASSERT_EQUALS(path.str(), ""); - } - - void test_file_path_gets_created_with_char_array() - { - const FilePath path("data/FilePathTestSuite/main.cpp"); - - TS_ASSERT_EQUALS(path.str(), "data/FilePathTestSuite/main.cpp"); + TS_ASSERT_EQUALS(path.wstr(), L""); } void test_file_path_gets_created_with_string() { - const std::string str("data/FilePathTestSuite/main.cpp"); + const std::wstring str(L"data/FilePathTestSuite/main.cpp"); const FilePath path(str); - TS_ASSERT_EQUALS(path.str(), str); + TS_ASSERT_EQUALS(path.wstr(), str); } void test_file_path_gets_created_other_file_path() { - const FilePath path("data/FilePathTestSuite/main.cpp"); + const FilePath path(L"data/FilePathTestSuite/main.cpp"); const FilePath path2(path); TS_ASSERT_EQUALS(path, path2); @@ -37,7 +30,7 @@ public: void test_file_path_empty() { - const FilePath path1("data/FilePathTestSuite/a.cpp"); + const FilePath path1(L"data/FilePathTestSuite/a.cpp"); const FilePath path2; TS_ASSERT(!path1.empty()); @@ -46,21 +39,21 @@ public: void test_file_path_exists() { - const FilePath path("data/FilePathTestSuite/a.cpp"); + const FilePath path(L"data/FilePathTestSuite/a.cpp"); TS_ASSERT(path.exists()); } void test_file_path_not_exists() { - const FilePath path("data/FilePathTestSuite/a.h"); + const FilePath path(L"data/FilePathTestSuite/a.h"); TS_ASSERT(!path.exists()); } void test_file_path_is_directory() { - const FilePath path("data/FilePathTestSuite/a.cpp"); + const FilePath path(L"data/FilePathTestSuite/a.cpp"); TS_ASSERT(!path.isDirectory()); TS_ASSERT(path.getParentDirectory().isDirectory()); @@ -76,14 +69,14 @@ public: void test_file_path_without_parent_has_empty_parent_directory() { - const FilePath path("a.cpp"); + const FilePath path(L"a.cpp"); TS_ASSERT(path.getParentDirectory().empty()); } void test_file_path_is_absolute() { - const FilePath path("data/FilePathTestSuite/a.cpp"); + const FilePath path(L"data/FilePathTestSuite/a.cpp"); TS_ASSERT(!path.isAbsolute()); TS_ASSERT(path.getAbsolute().isAbsolute()); @@ -91,55 +84,55 @@ public: void test_file_path_parent_directory() { - const FilePath path("data/FilePathTestSuite/a.cpp"); + const FilePath path(L"data/FilePathTestSuite/a.cpp"); - TS_ASSERT(path.getParentDirectory().str() == "data/FilePathTestSuite"); - TS_ASSERT(path.getParentDirectory().getParentDirectory().str() == "data"); + TS_ASSERT(path.getParentDirectory().wstr() == L"data/FilePathTestSuite"); + TS_ASSERT(path.getParentDirectory().getParentDirectory().wstr() == L"data"); } void test_file_path_relative_to_other_path() { - const FilePath pathA("data/FilePathTestSuite/a.cpp"); - const FilePath pathB("data/FilePathTestSuite/test/c.h"); + const FilePath pathA(L"data/FilePathTestSuite/a.cpp"); + const FilePath pathB(L"data/FilePathTestSuite/test/c.h"); - TS_ASSERT_EQUALS(pathA.getRelativeTo(pathB).str(), "../a.cpp"); - TS_ASSERT_EQUALS(pathB.getRelativeTo(pathA).str(), "test/c.h"); + TS_ASSERT_EQUALS(pathA.getRelativeTo(pathB).wstr(), L"../a.cpp"); + TS_ASSERT_EQUALS(pathB.getRelativeTo(pathA).wstr(), L"test/c.h"); } void test_file_path_relative_to_other_directory() { - const FilePath pathA("data/FilePathTestSuite/a.cpp"); - const FilePath pathB("data/FilePathTestSuite/test"); + const FilePath pathA(L"data/FilePathTestSuite/a.cpp"); + const FilePath pathB(L"data/FilePathTestSuite/test"); - TS_ASSERT_EQUALS(pathA.getRelativeTo(pathB).str(), "../a.cpp"); + TS_ASSERT_EQUALS(pathA.getRelativeTo(pathB).wstr(), L"../a.cpp"); } void test_file_path_relative_to_same_directory() { - const FilePath pathA("data/FilePathTestSuite/test"); + const FilePath pathA(L"data/FilePathTestSuite/test"); - TS_ASSERT_EQUALS(pathA.getRelativeTo(pathA).str(), "./"); + TS_ASSERT_EQUALS(pathA.getRelativeTo(pathA).wstr(), L"./"); } void test_file_path_file_name() { - const FilePath path("data/FilePathTestSuite/abc.h"); + const FilePath path(L"data/FilePathTestSuite/abc.h"); - TS_ASSERT_EQUALS(path.fileName(), "abc.h"); + TS_ASSERT_EQUALS(path.wFileName(), L"abc.h"); } void test_file_path_extension() { - const FilePath path("data/FilePathTestSuite/a.h"); + const FilePath path(L"data/FilePathTestSuite/a.h"); TS_ASSERT_EQUALS(path.extension(), ".h"); } void test_file_path_without_extension() { - const FilePath path("data/FilePathTestSuite/a.h"); + const FilePath path(L"data/FilePathTestSuite/a.h"); - TS_ASSERT_EQUALS(path.withoutExtension(), FilePath("data/FilePathTestSuite/a")); + TS_ASSERT_EQUALS(path.withoutExtension(), FilePath(L"data/FilePathTestSuite/a")); } void test_file_path_has_extension() @@ -149,30 +142,30 @@ public: extensions.push_back(".cpp"); extensions.push_back(".cc"); - TS_ASSERT(FilePath("data/FilePathTestSuite/a.h").hasExtension(extensions)); - TS_ASSERT(FilePath("data/FilePathTestSuite/b.cpp").hasExtension(extensions)); - TS_ASSERT(!FilePath("data/FilePathTestSuite/a.m").hasExtension(extensions)); + TS_ASSERT(FilePath(L"data/FilePathTestSuite/a.h").hasExtension(extensions)); + TS_ASSERT(FilePath(L"data/FilePathTestSuite/b.cpp").hasExtension(extensions)); + TS_ASSERT(!FilePath(L"data/FilePathTestSuite/a.m").hasExtension(extensions)); } void test_file_path_equals_file_with_different_relative_paths() { - const FilePath pathA("data/FilePathTestSuite/a.cpp"); - const FilePath pathA2("data/../data/FilePathTestSuite/./a.cpp"); + const FilePath path1(L"data/FilePathTestSuite/a.cpp"); + const FilePath path2(L"data/../data/FilePathTestSuite/./a.cpp"); - TS_ASSERT_EQUALS(pathA, pathA2); + TS_ASSERT_EQUALS(path1, path2); } void test_file_path_equals_relative_and_absolute_paths() { - const FilePath pathA("data/FilePathTestSuite/a.cpp"); - const FilePath pathA2 = pathA.getAbsolute(); + const FilePath path1(L"data/FilePathTestSuite/a.cpp"); + const FilePath path2 = path1.getAbsolute(); - TS_ASSERT_EQUALS(pathA, pathA2); + TS_ASSERT_EQUALS(path1, path2); } void test_file_path_equals_absolute_and_canonical_paths() { - const FilePath path("data/../data/FilePathTestSuite/./a.cpp"); + const FilePath path(L"data/../data/FilePathTestSuite/./a.cpp"); TS_ASSERT_EQUALS(path.getAbsolute(), path.getCanonical()); } @@ -180,8 +173,8 @@ public: void test_file_path_canonical_removes_symlinks() { #ifndef _WIN32 - const FilePath pathA("data/FilePathTestSuite/parent/target/d.cpp"); - const FilePath pathB("data/FilePathTestSuite/target/d.cpp"); + const FilePath pathA(L"data/FilePathTestSuite/parent/target/d.cpp"); + const FilePath pathB(L"data/FilePathTestSuite/target/d.cpp"); TS_ASSERT_EQUALS(pathB.getAbsolute(), pathA.getCanonical()); #endif @@ -190,8 +183,8 @@ public: void test_file_path_compares_paths_with_posix_and_windows_format() { #ifdef _WIN32 - const FilePath pathB("data/FilePathTestSuite/b.cc"); - const FilePath pathB2("data\\FilePathTestSuite\\b.cc"); + const FilePath pathB(L"data/FilePathTestSuite/b.cc"); + const FilePath pathB2(L"data\\FilePathTestSuite\\b.cc"); TS_ASSERT_EQUALS(pathB, pathB2); #endif @@ -199,24 +192,24 @@ public: void test_file_path_differs_for_different_existing_files() { - const FilePath pathA("data/FilePathTestSuite/a.cpp"); - const FilePath pathB("data/FilePathTestSuite/b.cc"); + const FilePath pathA(L"data/FilePathTestSuite/a.cpp"); + const FilePath pathB(L"data/FilePathTestSuite/b.cc"); TS_ASSERT_DIFFERS(pathA, pathB); } void test_file_path_differs_for_different_nonexisting_files() { - const FilePath pathA("data/FilePathTestSuite/a.h"); - const FilePath pathB("data/FilePathTestSuite/b.c"); + const FilePath pathA(L"data/FilePathTestSuite/a.h"); + const FilePath pathB(L"data/FilePathTestSuite/b.c"); TS_ASSERT_DIFFERS(pathA, pathB); } void test_file_path_differs_for_existing_and_nonexisting_files() { - const FilePath pathA("data/FilePathTestSuite/a.h"); - const FilePath pathB("data/FilePathTestSuite/b.cc"); + const FilePath pathA(L"data/FilePathTestSuite/a.h"); + const FilePath pathB(L"data/FilePathTestSuite/b.cc"); TS_ASSERT_DIFFERS(pathA, pathB); } diff --git a/src/test/FileSystemTestSuite.h b/src/test/FileSystemTestSuite.h index c28f008e..4d218cdb 100644 --- a/src/test/FileSystemTestSuite.h +++ b/src/test/FileSystemTestSuite.h @@ -15,16 +15,16 @@ public: std::vector extensions; extensions.push_back(".cpp"); - std::vector cppFiles = utility::convert( - FileSystem::getFilePathsFromDirectory(FilePath("data/FileSystemTestSuite"), extensions), - [](const FilePath& filePath){ return filePath.str(); } + std::vector cppFiles = utility::convert( + FileSystem::getFilePathsFromDirectory(FilePath(L"data/FileSystemTestSuite"), extensions), + [](const FilePath& filePath){ return filePath.wstr(); } ); TS_ASSERT_EQUALS(cppFiles.size(), 4); - TS_ASSERT(isInVector(cppFiles, "data/FileSystemTestSuite/main.cpp")); - TS_ASSERT(isInVector(cppFiles, "data/FileSystemTestSuite/Settings/sample.cpp")); - TS_ASSERT(isInVector(cppFiles, "data/FileSystemTestSuite/src/main.cpp")); - TS_ASSERT(isInVector(cppFiles, "data/FileSystemTestSuite/src/test.cpp")); + TS_ASSERT(utility::containsElement(cppFiles, L"data/FileSystemTestSuite/main.cpp")); + TS_ASSERT(utility::containsElement(cppFiles, L"data/FileSystemTestSuite/Settings/sample.cpp")); + TS_ASSERT(utility::containsElement(cppFiles, L"data/FileSystemTestSuite/src/main.cpp")); + TS_ASSERT(utility::containsElement(cppFiles, L"data/FileSystemTestSuite/src/test.cpp")); } void test_find_h_files() @@ -32,15 +32,15 @@ public: std::vector extensions; extensions.push_back(".h"); - std::vector headerFiles = utility::convert( + std::vector headerFiles = utility::convert( FileSystem::getFilePathsFromDirectory(FilePath("data/FileSystemTestSuite"), extensions), - [](const FilePath& filePath){ return filePath.str(); } + [](const FilePath& filePath){ return filePath.wstr(); } ); TS_ASSERT_EQUALS(headerFiles.size(), 3); - TS_ASSERT(isInVector(headerFiles, "data/FileSystemTestSuite/tictactoe.h")); - TS_ASSERT(isInVector(headerFiles, "data/FileSystemTestSuite/Settings/player.h")); - TS_ASSERT(isInVector(headerFiles, "data/FileSystemTestSuite/src/test.h")); + TS_ASSERT(utility::containsElement(headerFiles, L"data/FileSystemTestSuite/tictactoe.h")); + TS_ASSERT(utility::containsElement(headerFiles, L"data/FileSystemTestSuite/Settings/player.h")); + TS_ASSERT(utility::containsElement(headerFiles, L"data/FileSystemTestSuite/src/test.h")); } void test_find_all_source_files() @@ -51,7 +51,7 @@ public: extensions.push_back(".cpp"); std::vector sourceFiles = utility::convert( - FileSystem::getFilePathsFromDirectory(FilePath("data/FileSystemTestSuite"), extensions), + FileSystem::getFilePathsFromDirectory(FilePath(L"data/FileSystemTestSuite"), extensions), [](const FilePath& filePath){ return filePath.str(); } ); @@ -67,13 +67,13 @@ public: extensions.push_back(".cpp"); std::vector directoryPaths; - directoryPaths.push_back(FilePath("./data/FileSystemTestSuite/src")); + directoryPaths.push_back(FilePath(L"./data/FileSystemTestSuite/src")); std::vector files = FileSystem::getFileInfosFromPaths(directoryPaths, extensions, false); TS_ASSERT_EQUALS(files.size(), 2); - TS_ASSERT(isInFileInfos(files, "./data/FileSystemTestSuite/src/test.cpp")); - TS_ASSERT(isInFileInfos(files, "./data/FileSystemTestSuite/src/test.h")); + TS_ASSERT(isInFileInfos(files, L"./data/FileSystemTestSuite/src/test.cpp")); + TS_ASSERT(isInFileInfos(files, L"./data/FileSystemTestSuite/src/test.h")); #endif } @@ -86,25 +86,25 @@ public: extensions.push_back(".cpp"); std::vector directoryPaths; - directoryPaths.push_back(FilePath("./data/FileSystemTestSuite/src")); + directoryPaths.push_back(FilePath(L"./data/FileSystemTestSuite/src")); std::vector files = FileSystem::getFileInfosFromPaths(directoryPaths, extensions, true); TS_ASSERT_EQUALS(files.size(), 5); - TS_ASSERT(isInFileInfos(files, "./data/FileSystemTestSuite/src/Settings/player.h", - "./data/FileSystemTestSuite/player.h" + TS_ASSERT(isInFileInfos(files, L"./data/FileSystemTestSuite/src/Settings/player.h", + L"./data/FileSystemTestSuite/player.h" )); - TS_ASSERT(isInFileInfos(files, "./data/FileSystemTestSuite/src/Settings/sample.cpp", - "./data/FileSystemTestSuite/sample.cpp" + TS_ASSERT(isInFileInfos(files, L"./data/FileSystemTestSuite/src/Settings/sample.cpp", + L"./data/FileSystemTestSuite/sample.cpp" )); - TS_ASSERT(isInFileInfos(files, "./data/FileSystemTestSuite/src/main.cpp", - "./data/FileSystemTestSuite/src/Settings/src/main.cpp" + TS_ASSERT(isInFileInfos(files, L"./data/FileSystemTestSuite/src/main.cpp", + L"./data/FileSystemTestSuite/src/Settings/src/main.cpp" )); - TS_ASSERT(isInFileInfos(files, "./data/FileSystemTestSuite/src/test.cpp", - "./data/FileSystemTestSuite/src/Settings/src/test.cpp" + TS_ASSERT(isInFileInfos(files, L"./data/FileSystemTestSuite/src/test.cpp", + L"./data/FileSystemTestSuite/src/Settings/src/test.cpp" )); - TS_ASSERT(isInFileInfos(files, "./data/FileSystemTestSuite/src/test.h", - "./data/FileSystemTestSuite/src/Settings/src/test.h" + TS_ASSERT(isInFileInfos(files, L"./data/FileSystemTestSuite/src/test.h", + L"./data/FileSystemTestSuite/src/Settings/src/test.h" )); #endif } @@ -140,21 +140,16 @@ public: } private: - bool isInVector(const std::vector& files, const std::string filename) - { - return std::end(files) != std::find(std::begin(files), std::end(files), filename); - } - bool isInFiles(const std::set& files, const FilePath& filename) { return std::end(files) != files.find(filename); } - bool isInFileInfos(const std::vector& infos, const std::string filename) + bool isInFileInfos(const std::vector& infos, const std::wstring& filename) { for (const FileInfo& info : infos) { - if (info.path.str() == filename) + if (info.path.wstr() == filename) { return true; } @@ -163,11 +158,11 @@ private: return false; } - bool isInFileInfos(const std::vector& infos, const std::string filename, const std::string filename2) + bool isInFileInfos(const std::vector& infos, const std::wstring& filename, const std::wstring& filename2) { for (const FileInfo& info : infos) { - if (info.path.str() == filename || info.path.str() == filename2) + if (info.path.wstr() == filename || info.path.wstr() == filename2) { return true; } diff --git a/src/test/JavaIndexSampleProjectsTestSuite.h b/src/test/JavaIndexSampleProjectsTestSuite.h index bfc7c60e..ee7a7f31 100644 --- a/src/test/JavaIndexSampleProjectsTestSuite.h +++ b/src/test/JavaIndexSampleProjectsTestSuite.h @@ -38,150 +38,150 @@ public: const bool updateExpectedOutput = false; const std::vector& classpath = { - FilePath("data/JavaIndexSampleProjectsTestSuite/JavaSymbolSolver060/lib/guava-21.0.jar").makeAbsolute(), - FilePath("data/JavaIndexSampleProjectsTestSuite/JavaSymbolSolver060/lib/javaparser-core-3.3.0.jar").makeAbsolute(), - FilePath("data/JavaIndexSampleProjectsTestSuite/JavaSymbolSolver060/lib/javaslang-2.0.3.jar").makeAbsolute(), - FilePath("data/JavaIndexSampleProjectsTestSuite/JavaSymbolSolver060/lib/javassist-3.19.0-GA.jar").makeAbsolute(), - FilePath("data/JavaIndexSampleProjectsTestSuite/JavaSymbolSolver060/src/java-symbol-solver-core").makeAbsolute(), - FilePath("data/JavaIndexSampleProjectsTestSuite/JavaSymbolSolver060/src/java-symbol-solver-logic").makeAbsolute(), - FilePath("data/JavaIndexSampleProjectsTestSuite/JavaSymbolSolver060/src/java-symbol-solver-model").makeAbsolute() + FilePath(L"data/JavaIndexSampleProjectsTestSuite/JavaSymbolSolver060/lib/guava-21.0.jar").makeAbsolute(), + FilePath(L"data/JavaIndexSampleProjectsTestSuite/JavaSymbolSolver060/lib/javaparser-core-3.3.0.jar").makeAbsolute(), + FilePath(L"data/JavaIndexSampleProjectsTestSuite/JavaSymbolSolver060/lib/javaslang-2.0.3.jar").makeAbsolute(), + FilePath(L"data/JavaIndexSampleProjectsTestSuite/JavaSymbolSolver060/lib/javassist-3.19.0-GA.jar").makeAbsolute(), + FilePath(L"data/JavaIndexSampleProjectsTestSuite/JavaSymbolSolver060/src/java-symbol-solver-core").makeAbsolute(), + FilePath(L"data/JavaIndexSampleProjectsTestSuite/JavaSymbolSolver060/src/java-symbol-solver-logic").makeAbsolute(), + FilePath(L"data/JavaIndexSampleProjectsTestSuite/JavaSymbolSolver060/src/java-symbol-solver-model").makeAbsolute() }; - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/SourceFileInfoExtractor.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/core/resolution/Context.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/core/resolution/ContextHelper.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/declarations/common/MethodDeclarationCommonLogic.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparser/Navigator.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparser/package-info.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/DefaultVisitorAdapter.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/JavaParserFacade.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/JavaParserFactory.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/LambdaArgumentTypePlaceholder.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/package-info.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/TypeExtractor.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/UnsolvedSymbolException.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AbstractJavaParserContext.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AbstractMethodLikeDeclarationContext.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AnonymousClassDeclarationContext.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/CatchClauseContext.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ClassOrInterfaceDeclarationContext.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/CompilationUnitContext.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ConstructorContext.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ContextHelper.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/EnumDeclarationContext.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/FieldAccessContext.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ForechStatementContext.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ForStatementContext.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/JavaParserTypeDeclarationAdapter.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/LambdaExprContext.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/MethodCallExprContext.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/MethodContext.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/StatementContext.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/SwitchEntryContext.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/TryWithResourceContext.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/DefaultConstructorDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/Helper.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnnotationDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnonymousClassDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserClassDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserConstructorDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserEnumConstantDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserEnumDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserFieldDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserInterfaceDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserMethodDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserParameterDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserSymbolDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeAdapter.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeParameter.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeVariableDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarators/AbstractSymbolDeclarator.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarators/FieldSymbolDeclarator.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarators/NoSymbolDeclarator.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarators/ParameterSymbolDeclarator.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarators/VariableSymbolDeclarator.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistClassDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistConstructorDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistEnumDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistFactory.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistFieldDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistInterfaceDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistMethodDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistParameterDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistTypeDeclarationAdapter.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistTypeParameter.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistUtils.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/package-info.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/model/typesystem/LazyType.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/model/typesystem/ReferenceTypeImpl.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/MyObjectProvider.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/package-info.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassAdapter.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionConstructorDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionEnumDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionFactory.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionFieldDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionInterfaceDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionMethodDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionMethodResolutionLogic.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionParameterDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionTypeParameter.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/comparators/ClassComparator.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/comparators/MethodComparator.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/comparators/ParameterComparator.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/resolution/ConstructorResolutionLogic.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/resolution/MethodResolutionLogic.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/resolution/SymbolDeclarator.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/resolution/SymbolSolver.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/resolution/typesolvers/CombinedTypeSolver.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/resolution/typesolvers/JarTypeSolver.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/resolution/typesolvers/JavaParserTypeSolver.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/resolution/typesolvers/MemoryTypeSolver.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-core/com/github/javaparser/symbolsolver/resolution/typesolvers/ReflectionTypeSolver.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-logic/com/github/javaparser/symbolsolver/logic/AbstractClassDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-logic/com/github/javaparser/symbolsolver/logic/AbstractTypeDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-logic/com/github/javaparser/symbolsolver/logic/ConfilictingGenericTypesException.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-logic/com/github/javaparser/symbolsolver/logic/FunctionalInterfaceLogic.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-logic/com/github/javaparser/symbolsolver/logic/InferenceContext.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-logic/com/github/javaparser/symbolsolver/logic/InferenceVariableType.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-logic/com/github/javaparser/symbolsolver/logic/ObjectProvider.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/AccessLevel.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/AnnotationDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/ClassDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/ConstructorDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/Declaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/EnumDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/FieldDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/HasAccessLevel.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/InterfaceDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/MethodAmbiguityException.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/MethodDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/MethodLikeDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/ParameterDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/ReferenceTypeDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/TypeDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/TypeParameterDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/TypeParametrizable.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/ValueDeclaration.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/methods/MethodUsage.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/resolution/SymbolReference.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/resolution/TypeSolver.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/resolution/UnsolvedSymbolException.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/resolution/Value.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/ArrayType.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/LambdaConstraintType.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/NullType.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/PrimitiveType.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/ReferenceType.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/Type.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/TypeTransformer.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/TypeVariable.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/VoidType.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/Wildcard.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/parametrization/TypeParametersMap.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/parametrization/TypeParameterValueProvider.java"), classpath, updateExpectedOutput); - processSourceFile("JavaSymbolSolver060", FilePath("java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/parametrization/TypeParametrized.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/SourceFileInfoExtractor.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/core/resolution/Context.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/core/resolution/ContextHelper.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/declarations/common/MethodDeclarationCommonLogic.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparser/Navigator.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparser/package-info.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/DefaultVisitorAdapter.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/JavaParserFacade.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/JavaParserFactory.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/LambdaArgumentTypePlaceholder.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/package-info.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/TypeExtractor.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/UnsolvedSymbolException.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AbstractJavaParserContext.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AbstractMethodLikeDeclarationContext.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/AnonymousClassDeclarationContext.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/CatchClauseContext.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ClassOrInterfaceDeclarationContext.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/CompilationUnitContext.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ConstructorContext.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ContextHelper.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/EnumDeclarationContext.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/FieldAccessContext.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ForechStatementContext.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/ForStatementContext.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/JavaParserTypeDeclarationAdapter.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/LambdaExprContext.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/MethodCallExprContext.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/MethodContext.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/StatementContext.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/SwitchEntryContext.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/contexts/TryWithResourceContext.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/DefaultConstructorDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/Helper.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnnotationDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserAnonymousClassDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserClassDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserConstructorDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserEnumConstantDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserEnumDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserFieldDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserInterfaceDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserMethodDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserParameterDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserSymbolDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeAdapter.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeParameter.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarations/JavaParserTypeVariableDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarators/AbstractSymbolDeclarator.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarators/FieldSymbolDeclarator.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarators/NoSymbolDeclarator.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarators/ParameterSymbolDeclarator.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javaparsermodel/declarators/VariableSymbolDeclarator.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistClassDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistConstructorDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistEnumDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistFactory.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistFieldDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistInterfaceDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistMethodDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistParameterDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistTypeDeclarationAdapter.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistTypeParameter.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/JavassistUtils.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/javassistmodel/package-info.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/model/typesystem/LazyType.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/model/typesystem/ReferenceTypeImpl.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/MyObjectProvider.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/package-info.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassAdapter.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionClassDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionConstructorDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionEnumDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionFactory.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionFieldDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionInterfaceDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionMethodDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionMethodResolutionLogic.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionParameterDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/ReflectionTypeParameter.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/comparators/ClassComparator.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/comparators/MethodComparator.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/reflectionmodel/comparators/ParameterComparator.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/resolution/ConstructorResolutionLogic.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/resolution/MethodResolutionLogic.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/resolution/SymbolDeclarator.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/resolution/SymbolSolver.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/resolution/typesolvers/CombinedTypeSolver.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/resolution/typesolvers/JarTypeSolver.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/resolution/typesolvers/JavaParserTypeSolver.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/resolution/typesolvers/MemoryTypeSolver.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-core/com/github/javaparser/symbolsolver/resolution/typesolvers/ReflectionTypeSolver.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-logic/com/github/javaparser/symbolsolver/logic/AbstractClassDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-logic/com/github/javaparser/symbolsolver/logic/AbstractTypeDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-logic/com/github/javaparser/symbolsolver/logic/ConfilictingGenericTypesException.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-logic/com/github/javaparser/symbolsolver/logic/FunctionalInterfaceLogic.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-logic/com/github/javaparser/symbolsolver/logic/InferenceContext.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-logic/com/github/javaparser/symbolsolver/logic/InferenceVariableType.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-logic/com/github/javaparser/symbolsolver/logic/ObjectProvider.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/AccessLevel.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/AnnotationDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/ClassDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/ConstructorDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/Declaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/EnumDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/FieldDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/HasAccessLevel.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/InterfaceDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/MethodAmbiguityException.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/MethodDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/MethodLikeDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/ParameterDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/ReferenceTypeDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/TypeDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/TypeParameterDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/TypeParametrizable.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/declarations/ValueDeclaration.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/methods/MethodUsage.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/resolution/SymbolReference.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/resolution/TypeSolver.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/resolution/UnsolvedSymbolException.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/resolution/Value.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/ArrayType.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/LambdaConstraintType.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/NullType.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/PrimitiveType.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/ReferenceType.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/Type.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/TypeTransformer.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/TypeVariable.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/VoidType.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/Wildcard.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/parametrization/TypeParametersMap.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/parametrization/TypeParameterValueProvider.java"), classpath, updateExpectedOutput); + processSourceFile("JavaSymbolSolver060", FilePath(L"java-symbol-solver-model/com/github/javaparser/symbolsolver/model/typesystem/parametrization/TypeParametrized.java"), classpath, updateExpectedOutput); } private: @@ -197,14 +197,14 @@ private: #endif std::string classPath = ""; { - const std::vector jarNames = utility::getRequiredJarNames(); + const std::vector jarNames = utility::getRequiredJarNames(); for (size_t i = 0; i < jarNames.size(); i++) { if (i != 0) { classPath += separator; } - classPath += "../app/data/java/lib/" + jarNames[i]; + classPath += FilePath(L"../app/data/java/lib/").concatenate(jarNames[i]).str(); } } @@ -218,12 +218,12 @@ private: void processSourceFile(const std::string& projectName, const FilePath& sourceFilePath, const std::vector& classpath, const bool updateExpectedOutput) { const FilePath projectDataRoot = FilePath("data/JavaIndexSampleProjectsTestSuite/" + projectName); - const FilePath projectDataSrcRoot = projectDataRoot.getConcatenated(FilePath("src")); - const FilePath projectDataExpectedOutputRoot = projectDataRoot.getConcatenated(FilePath("expected_output")); + const FilePath projectDataSrcRoot = projectDataRoot.getConcatenated(L"src"); + const FilePath projectDataExpectedOutputRoot = projectDataRoot.getConcatenated(L"expected_output"); std::shared_ptr output = parseCode(projectDataSrcRoot.getConcatenated(sourceFilePath), projectDataSrcRoot, classpath); - const FilePath expectedOutputFilePath = projectDataExpectedOutputRoot.getConcatenated(FilePath(utility::replace(sourceFilePath.withoutExtension().str() + ".txt", "/", "_"))); + const FilePath expectedOutputFilePath = projectDataExpectedOutputRoot.getConcatenated(utility::replace(sourceFilePath.withoutExtension().wstr() + L".txt", L"/", L"_")); if (updateExpectedOutput || !expectedOutputFilePath.exists()) { std::ofstream expectedOutputFile; diff --git a/src/test/JavaParserTestSuite.h b/src/test/JavaParserTestSuite.h index 32f46d46..7a4029d2 100644 --- a/src/test/JavaParserTestSuite.h +++ b/src/test/JavaParserTestSuite.h @@ -19,11 +19,10 @@ public: void test_java_parser_finds_all_jar_dependencies() { - const std::vector jarNames = utility::getRequiredJarNames(); - for (const std::string& jarName : utility::getRequiredJarNames()) + for (const std::wstring& jarName : utility::getRequiredJarNames()) { - FilePath jarPath("../app/data/java/lib/" + jarName); - TSM_ASSERT("Jar dependency path does not exist: " + jarPath.str(), jarPath.exists()); + FilePath jarPath = FilePath(L"../app/data/java/lib/").concatenate(jarName); + TSM_ASSERT(L"Jar dependency path does not exist: " + jarPath.wstr(), jarPath.exists()); } } @@ -1491,14 +1490,14 @@ private: #endif std::string classPath = ""; { - const std::vector jarNames = utility::getRequiredJarNames(); + const std::vector jarNames = utility::getRequiredJarNames(); for (size_t i = 0; i < jarNames.size(); i++) { if (i != 0) { classPath += separator; } - classPath += "../app/data/java/lib/" + jarNames[i]; + classPath += FilePath(L"../app/data/java/lib/").concatenate(jarNames[i]).str(); } } @@ -1518,7 +1517,7 @@ private: setupJavaEnvironmentFactory(); JavaParser parser(parserClient, nullptr); - parser.buildIndex(FilePath("input.cc"), textAccess); + parser.buildIndex(FilePath(L"input.cc"), textAccess); return parserClient; } diff --git a/src/test/SettingsTestSuite.h b/src/test/SettingsTestSuite.h index 59df5ee1..21c0431e 100644 --- a/src/test/SettingsTestSuite.h +++ b/src/test/SettingsTestSuite.h @@ -10,24 +10,25 @@ public: void test_settings_get_loaded_from_file() { TestSettings settings; - TS_ASSERT(settings.load(FilePath("data/SettingsTestSuite/settings.xml"))); + TS_ASSERT(settings.load(FilePath(L"data/SettingsTestSuite/settings.xml"))); } void test_settings_get_not_loaded_from_file() { TestSettings settings; - TS_ASSERT(!settings.load(FilePath("data/SettingsTestSuite/wrong_settings.xml"))); + TS_ASSERT(!settings.load(FilePath(L"data/SettingsTestSuite/wrong_settings.xml"))); } void test_settings_get_loaded_value() { TestSettings settings; - TS_ASSERT(settings.load(FilePath("data/SettingsTestSuite/settings.xml"))); + TS_ASSERT(settings.load(FilePath(L"data/SettingsTestSuite/settings.xml"))); TS_ASSERT_EQUALS(settings.getBool(), true); TS_ASSERT_EQUALS(settings.getInt(), 42); TS_ASSERT_EQUALS(settings.getFloat(), 3.1416f); TS_ASSERT_EQUALS(settings.getString(), "Hello World!"); + TS_ASSERT_EQUALS(settings.getWString(), L"Hello World!"); } void test_settings_get_default_value_when_not_loaded() @@ -37,29 +38,32 @@ public: TS_ASSERT_EQUALS(settings.getInt(), -1); TS_ASSERT_EQUALS(settings.getFloat(), 0.01f); TS_ASSERT_EQUALS(settings.getString(), ""); + TS_ASSERT_EQUALS(settings.getWString(), L""); } void test_settings_get_default_value_when_wrongly_loaded() { TestSettings settings; - TS_ASSERT(!settings.load(FilePath("data/SettingsTestSuite/wrong_settings.xml"))); + TS_ASSERT(!settings.load(FilePath(L"data/SettingsTestSuite/wrong_settings.xml"))); TS_ASSERT_EQUALS(settings.getBool(), false); TS_ASSERT_EQUALS(settings.getInt(), -1); TS_ASSERT_EQUALS(settings.getFloat(), 0.01f); TS_ASSERT_EQUALS(settings.getString(), ""); + TS_ASSERT_EQUALS(settings.getWString(), L""); } void test_settings_get_default_value_after_clearing() { TestSettings settings; - TS_ASSERT(settings.load(FilePath("data/SettingsTestSuite/settings.xml"))); + TS_ASSERT(settings.load(FilePath(L"data/SettingsTestSuite/settings.xml"))); settings.clear(); TS_ASSERT_EQUALS(settings.getBool(), false); TS_ASSERT_EQUALS(settings.getInt(), -1); TS_ASSERT_EQUALS(settings.getFloat(), 0.01f); TS_ASSERT_EQUALS(settings.getString(), ""); + TS_ASSERT_EQUALS(settings.getWString(), L""); } void test_settings_can_be_set_when_not_loaded() @@ -75,14 +79,17 @@ public: TS_ASSERT(settings.setFloat(2.5f)); TS_ASSERT_EQUALS(settings.getFloat(), 2.5f); - TS_ASSERT(settings.setString("foobar")); - TS_ASSERT_EQUALS(settings.getString(), "foobar"); + TS_ASSERT(settings.setString("foo")); + TS_ASSERT_EQUALS(settings.getString(), "foo"); + + TS_ASSERT(settings.setWString(L"bar")); + TS_ASSERT_EQUALS(settings.getWString(), L"bar"); } void test_settings_can_be_replaced_when_loaded() { TestSettings settings; - TS_ASSERT(settings.load(FilePath("data/SettingsTestSuite/settings.xml"))); + TS_ASSERT(settings.load(FilePath(L"data/SettingsTestSuite/settings.xml"))); TS_ASSERT(settings.setBool(false)); TS_ASSERT_EQUALS(settings.getBool(), false); @@ -93,14 +100,17 @@ public: TS_ASSERT(settings.setFloat(2.5f)); TS_ASSERT_EQUALS(settings.getFloat(), 2.5f); - TS_ASSERT(settings.setString("foobar")); - TS_ASSERT_EQUALS(settings.getString(), "foobar"); + TS_ASSERT(settings.setString("foo")); + TS_ASSERT_EQUALS(settings.getString(), "foo"); + + TS_ASSERT(settings.setWString(L"bar")); + TS_ASSERT_EQUALS(settings.getWString(), L"bar"); } void test_settings_can_be_added_when_loaded() { TestSettings settings; - TS_ASSERT(settings.load(FilePath("data/SettingsTestSuite/settings.xml"))); + TS_ASSERT(settings.load(FilePath(L"data/SettingsTestSuite/settings.xml"))); TS_ASSERT_EQUALS(settings.getNewBool(), false); TS_ASSERT(settings.setNewBool(true)); @@ -110,13 +120,13 @@ public: void test_load_project_settings_from_file() { ProjectSettings settings; - TS_ASSERT(settings.load(FilePath("data/SettingsTestSuite/settings.xml"))); + TS_ASSERT(settings.load(FilePath(L"data/SettingsTestSuite/settings.xml"))); } void test_load_source_path_from_file() { ProjectSettings projectSettings; - projectSettings.load(FilePath("data/SettingsTestSuite/settings.xml")); + projectSettings.load(FilePath(L"data/SettingsTestSuite/settings.xml")); std::shared_ptr sourceGroupSettings = std::dynamic_pointer_cast(projectSettings.getAllSourceGroupSettings().front()); std::vector paths = sourceGroupSettings->getSourcePaths(); @@ -127,7 +137,7 @@ public: void test_load_header_search_paths_from_file() { ProjectSettings projectSettings; - projectSettings.load(FilePath("data/SettingsTestSuite/settings.xml")); + projectSettings.load(FilePath(L"data/SettingsTestSuite/settings.xml")); std::shared_ptr sourceGroupSettings = std::dynamic_pointer_cast(projectSettings.getAllSourceGroupSettings().front()); std::vector paths = sourceGroupSettings->getHeaderSearchPaths(); @@ -181,6 +191,16 @@ private: return setValue("String", value); } + std::wstring getWString() const + { + return getValue("WString", L""); + } + + bool setWString(const std::wstring& value) + { + return setValue("WString", value); + } + bool getNewBool() const { return getValue("NewBool", false); diff --git a/src/test/SourceLocationCollectionTestSuite.h b/src/test/SourceLocationCollectionTestSuite.h index 890524a1..4fb499f3 100644 --- a/src/test/SourceLocationCollectionTestSuite.h +++ b/src/test/SourceLocationCollectionTestSuite.h @@ -10,7 +10,7 @@ public: void test_source_locations_get_created_with_other_end() { SourceLocationCollection collection; - const SourceLocation* a = collection.addSourceLocation(LOCATION_TOKEN, 1, {1}, FilePath("file.c"), 2, 3, 4, 5); + const SourceLocation* a = collection.addSourceLocation(LOCATION_TOKEN, 1, {1}, FilePath(L"file.c"), 2, 3, 4, 5); TS_ASSERT(a); TS_ASSERT(a->isStartLocation()); @@ -32,8 +32,8 @@ public: void test_source_locations_do_not_get_created_with_wrong_input() { SourceLocationCollection collection; - SourceLocation* a = collection.addSourceLocation(LOCATION_TOKEN, 1, {1}, FilePath("file.c"), 2, 3, 2, 1); - SourceLocation* b = collection.addSourceLocation(LOCATION_TOKEN, 2, {1}, FilePath("file.c"), 4, 1, 1, 10); + SourceLocation* a = collection.addSourceLocation(LOCATION_TOKEN, 1, {1}, FilePath(L"file.c"), 2, 3, 2, 1); + SourceLocation* b = collection.addSourceLocation(LOCATION_TOKEN, 2, {1}, FilePath(L"file.c"), 4, 1, 1, 10); TS_ASSERT(!a); TS_ASSERT(!b); @@ -42,9 +42,9 @@ public: void test_source_locations_get_unique_id_but_both_ends_have_the_same() { SourceLocationCollection collection; - SourceLocation* a = collection.addSourceLocation(LOCATION_TOKEN, 1, {1}, FilePath("file.c"), 1, 1, 1, 1); - SourceLocation* b = collection.addSourceLocation(LOCATION_TOKEN, 2, {2}, FilePath("file.c"), 1, 1, 1, 1); - SourceLocation* c = collection.addSourceLocation(LOCATION_TOKEN, 3, {3}, FilePath("file.c"), 1, 1, 1, 1); + SourceLocation* a = collection.addSourceLocation(LOCATION_TOKEN, 1, {1}, FilePath(L"file.c"), 1, 1, 1, 1); + SourceLocation* b = collection.addSourceLocation(LOCATION_TOKEN, 2, {2}, FilePath(L"file.c"), 1, 1, 1, 1); + SourceLocation* c = collection.addSourceLocation(LOCATION_TOKEN, 3, {3}, FilePath(L"file.c"), 1, 1, 1, 1); TS_ASSERT_EQUALS(1, collection.getSourceLocationFileCount()); TS_ASSERT_EQUALS(3, collection.getSourceLocationCount()); @@ -65,7 +65,7 @@ public: void test_source_locations_have_right_file_path_line_column_and_token_id() { SourceLocationCollection collection; - SourceLocation* a = collection.addSourceLocation(LOCATION_TOKEN, 1, {1}, FilePath("file.c"), 2, 3, 4, 5); + SourceLocation* a = collection.addSourceLocation(LOCATION_TOKEN, 1, {1}, FilePath(L"file.c"), 2, 3, 4, 5); TS_ASSERT_EQUALS(1, a->getTokenIds()[0]); TS_ASSERT_EQUALS(2, a->getLineNumber()); @@ -78,8 +78,8 @@ public: void test_finding_source_locations_by_id() { SourceLocationCollection collection; - SourceLocation* a = collection.addSourceLocation(LOCATION_TOKEN, 1, {1}, FilePath("file.c"), 2, 3, 4, 5); - SourceLocation* b = collection.addSourceLocation(LOCATION_TOKEN, 2, {6}, FilePath("file.c"), 7, 8, 9, 10); + SourceLocation* a = collection.addSourceLocation(LOCATION_TOKEN, 1, {1}, FilePath(L"file.c"), 2, 3, 4, 5); + SourceLocation* b = collection.addSourceLocation(LOCATION_TOKEN, 2, {6}, FilePath(L"file.c"), 7, 8, 9, 10); TS_ASSERT_EQUALS(a, collection.getSourceLocationById(a->getLocationId())); TS_ASSERT_EQUALS(b, collection.getSourceLocationById(b->getLocationId())); @@ -88,10 +88,10 @@ public: void test_creating_plain_copy_of_all_locations_in_line_range() { SourceLocationCollection collection; - SourceLocation* a = collection.addSourceLocation(LOCATION_TOKEN, 1, {1}, FilePath("file.c"), 2, 3, 4, 5); - SourceLocation* b = collection.addSourceLocation(LOCATION_TOKEN, 2, {1}, FilePath("file.c"), 3, 3, 4, 5); - SourceLocation* c = collection.addSourceLocation(LOCATION_TOKEN, 3, {1}, FilePath("file.c"), 1, 3, 5, 5); - SourceLocation* d = collection.addSourceLocation(LOCATION_TOKEN, 4, {1}, FilePath("file.c"), 1, 5, 4, 5); + SourceLocation* a = collection.addSourceLocation(LOCATION_TOKEN, 1, {1}, FilePath(L"file.c"), 2, 3, 4, 5); + SourceLocation* b = collection.addSourceLocation(LOCATION_TOKEN, 2, {1}, FilePath(L"file.c"), 3, 3, 4, 5); + SourceLocation* c = collection.addSourceLocation(LOCATION_TOKEN, 3, {1}, FilePath(L"file.c"), 1, 3, 5, 5); + SourceLocation* d = collection.addSourceLocation(LOCATION_TOKEN, 4, {1}, FilePath(L"file.c"), 1, 5, 4, 5); Id ida = a->getLocationId(); Id idb = b->getLocationId(); @@ -135,13 +135,13 @@ public: void test_get_source_locations_filtered_by_lines() { SourceLocationCollection collection; - SourceLocation* a = collection.addSourceLocation(LOCATION_TOKEN, 1, {1}, FilePath("file.c"), 1, 3, 1, 5); - SourceLocation* b = collection.addSourceLocation(LOCATION_TOKEN, 2, {1}, FilePath("file.c"), 1, 3, 2, 5); - SourceLocation* c = collection.addSourceLocation(LOCATION_TOKEN, 3, {1}, FilePath("file.c"), 2, 3, 2, 5); - SourceLocation* d = collection.addSourceLocation(LOCATION_TOKEN, 4, {1}, FilePath("file.c"), 3, 3, 4, 5); - SourceLocation* e = collection.addSourceLocation(LOCATION_TOKEN, 5, {1}, FilePath("file.c"), 3, 5, 5, 5); - SourceLocation* f = collection.addSourceLocation(LOCATION_TOKEN, 6, {1}, FilePath("file.c"), 1, 5, 5, 5); - SourceLocation* g = collection.addSourceLocation(LOCATION_TOKEN, 7, {1}, FilePath("file.c"), 5, 5, 5, 5); + SourceLocation* a = collection.addSourceLocation(LOCATION_TOKEN, 1, {1}, FilePath(L"file.c"), 1, 3, 1, 5); + SourceLocation* b = collection.addSourceLocation(LOCATION_TOKEN, 2, {1}, FilePath(L"file.c"), 1, 3, 2, 5); + SourceLocation* c = collection.addSourceLocation(LOCATION_TOKEN, 3, {1}, FilePath(L"file.c"), 2, 3, 2, 5); + SourceLocation* d = collection.addSourceLocation(LOCATION_TOKEN, 4, {1}, FilePath(L"file.c"), 3, 3, 4, 5); + SourceLocation* e = collection.addSourceLocation(LOCATION_TOKEN, 5, {1}, FilePath(L"file.c"), 3, 5, 5, 5); + SourceLocation* f = collection.addSourceLocation(LOCATION_TOKEN, 6, {1}, FilePath(L"file.c"), 1, 5, 5, 5); + SourceLocation* g = collection.addSourceLocation(LOCATION_TOKEN, 7, {1}, FilePath(L"file.c"), 5, 5, 5, 5); SourceLocationCollection copy; copy.addSourceLocationFile( diff --git a/src/test/SqliteBookmarkStorageTestSuite.h b/src/test/SqliteBookmarkStorageTestSuite.h index 5ad77ac2..5cd6160a 100644 --- a/src/test/SqliteBookmarkStorageTestSuite.h +++ b/src/test/SqliteBookmarkStorageTestSuite.h @@ -9,7 +9,7 @@ class SqliteBookmarkStorageTestSuite: public CxxTest::TestSuite public: void test_add_bookmarks() { - FilePath databasePath("data/SQLiteTestSuite/bookmarkTest.sqlite"); + FilePath databasePath(L"data/SQLiteTestSuite/bookmarkTest.sqlite"); size_t bookmarkCount = 4; int result = -1; { @@ -33,7 +33,7 @@ public: void test_add_bookmarked_node() { - FilePath databasePath("data/SQLiteTestSuite/bookmarkTest.sqlite"); + FilePath databasePath(L"data/SQLiteTestSuite/bookmarkTest.sqlite"); size_t bookmarkCount = 4; int result = -1; { @@ -59,7 +59,7 @@ public: void test_remove_bookmark_also_removes_bookmarked_node() { - FilePath databasePath("data/SQLiteTestSuite/bookmarkTest.sqlite"); + FilePath databasePath(L"data/SQLiteTestSuite/bookmarkTest.sqlite"); int result = -1; { FileSystem::remove(databasePath); @@ -82,7 +82,7 @@ public: void test_edit_nodeBookmark() { - FilePath databasePath("data/SQLiteTestSuite/bookmarkTest.sqlite"); + FilePath databasePath(L"data/SQLiteTestSuite/bookmarkTest.sqlite"); const std::string updatedName = "updated name"; const std::string updatedComment = "updated comment"; diff --git a/src/test/SqliteIndexStorageTestSuite.h b/src/test/SqliteIndexStorageTestSuite.h index 3c40d8c7..7438359b 100644 --- a/src/test/SqliteIndexStorageTestSuite.h +++ b/src/test/SqliteIndexStorageTestSuite.h @@ -9,7 +9,7 @@ class SqliteIndexStorageTestSuite: public CxxTest::TestSuite public: void test_storage_adds_node_successfully() { - FilePath databasePath("data/SQLiteTestSuite/test.sqlite"); + FilePath databasePath(L"data/SQLiteTestSuite/test.sqlite"); int nodeCount = -1; { SqliteIndexStorage storage(databasePath); @@ -26,7 +26,7 @@ public: void test_storage_removes_node_successfully() { - FilePath databasePath("data/SQLiteTestSuite/test.sqlite"); + FilePath databasePath(L"data/SQLiteTestSuite/test.sqlite"); int nodeCount = -1; { SqliteIndexStorage storage(databasePath); @@ -44,7 +44,7 @@ public: void test_storage_adds_edge_successfully() { - FilePath databasePath("data/SQLiteTestSuite/test.sqlite"); + FilePath databasePath(L"data/SQLiteTestSuite/test.sqlite"); int edgeCount = -1; { SqliteIndexStorage storage(databasePath); @@ -63,7 +63,7 @@ public: void test_storage_removes_edge_successfully() { - FilePath databasePath("data/SQLiteTestSuite/test.sqlite"); + FilePath databasePath(L"data/SQLiteTestSuite/test.sqlite"); int edgeCount = -1; { SqliteIndexStorage storage(databasePath); diff --git a/src/test/StorageTestSuite.h b/src/test/StorageTestSuite.h index caa2379c..1959126c 100644 --- a/src/test/StorageTestSuite.h +++ b/src/test/StorageTestSuite.h @@ -11,7 +11,7 @@ class StorageTestSuite: public CxxTest::TestSuite public: void setUp() { - m_filePath = FilePath("file.cpp"); + m_filePath = FilePath(L"file.cpp"); } void test_storage_saves_file() @@ -230,7 +230,7 @@ private: { public: TestStorage() - : PersistentStorage(FilePath("data/test.sqlite"), FilePath("data/testBookmarks.sqlite")) + : PersistentStorage(FilePath(L"data/test.sqlite"), FilePath(L"data/testBookmarks.sqlite")) { clear(); } diff --git a/src/test/TestSuiteFixture.cpp b/src/test/TestSuiteFixture.cpp index f5179a47..9a9a28c7 100644 --- a/src/test/TestSuiteFixture.cpp +++ b/src/test/TestSuiteFixture.cpp @@ -34,7 +34,7 @@ bool TestSuiteFixture::setUpWorld() } #else - ApplicationSettings::getInstance()->load(FilePath("data/TestSettings.xml")); + ApplicationSettings::getInstance()->load(FilePath(L"data/TestSettings.xml")); #endif return true; diff --git a/src/test/TextAccessTestSuite.h b/src/test/TextAccessTestSuite.h index 6829baaf..8e1533c0 100644 --- a/src/test/TextAccessTestSuite.h +++ b/src/test/TextAccessTestSuite.h @@ -87,7 +87,7 @@ public: void test_textAccessFile_constructor() { - FilePath filePath("data/TextAccessTestSuite/text.txt"); + FilePath filePath(L"data/TextAccessTestSuite/text.txt"); std::shared_ptr textAccess = TextAccess::createFromFile(filePath); @@ -96,7 +96,7 @@ public: void test_textAccessFile_lines_count() { - FilePath filePath("data/TextAccessTestSuite/text.txt"); + FilePath filePath(L"data/TextAccessTestSuite/text.txt"); unsigned int lineCount = 7; std::shared_ptr textAccess = TextAccess::createFromFile(filePath); @@ -106,7 +106,7 @@ public: void test_textAccessFile_lines_content() { - FilePath filePath("data/TextAccessTestSuite/text.txt"); + FilePath filePath(L"data/TextAccessTestSuite/text.txt"); std::shared_ptr textAccess = TextAccess::createFromFile(filePath); std::vector lines = textAccess->getLines(1, 4); @@ -120,7 +120,7 @@ public: void test_textAccessFile_get_filePath() { - FilePath filePath("data/TextAccessTestSuite/text.txt"); + FilePath filePath(L"data/TextAccessTestSuite/text.txt"); std::shared_ptr textAccess = TextAccess::createFromFile(filePath); TS_ASSERT_EQUALS(textAccess->getFilePath(), filePath); diff --git a/src/test/UtilityMavenTestSuite.h b/src/test/UtilityMavenTestSuite.h index c42b8427..781666a3 100644 --- a/src/test/UtilityMavenTestSuite.h +++ b/src/test/UtilityMavenTestSuite.h @@ -21,15 +21,15 @@ public: if (!mavenPathDetector->getPaths().empty()) { std::vector result = utility::mavenGetAllDirectoriesFromEffectivePom( - mavenPathDetector->getPaths().front(), FilePath("data/UtilityMavenTestSuite/simple_maven_project"), false + mavenPathDetector->getPaths().front(), FilePath(L"data/UtilityMavenTestSuite/simple_maven_project"), false ); TS_ASSERT(utility::containsElement( - result, FilePath("data/UtilityMavenTestSuite/simple_maven_project/src/main/java").makeAbsolute() + result, FilePath(L"data/UtilityMavenTestSuite/simple_maven_project/src/main/java").makeAbsolute() )); TS_ASSERT(!utility::containsElement( - result, FilePath("data/UtilityMavenTestSuite/simple_maven_project/src/test/java").makeAbsolute() + result, FilePath(L"data/UtilityMavenTestSuite/simple_maven_project/src/test/java").makeAbsolute() )); } } @@ -42,15 +42,15 @@ public: if (!mavenPathDetector->getPaths().empty()) { std::vector result = utility::mavenGetAllDirectoriesFromEffectivePom( - mavenPathDetector->getPaths().front(), FilePath("data/UtilityMavenTestSuite/simple_maven_project"), true + mavenPathDetector->getPaths().front(), FilePath(L"data/UtilityMavenTestSuite/simple_maven_project"), true ); TS_ASSERT(utility::containsElement( - result, FilePath("data/UtilityMavenTestSuite/simple_maven_project/src/main/java").makeAbsolute() + result, FilePath(L"data/UtilityMavenTestSuite/simple_maven_project/src/main/java").makeAbsolute() )); TS_ASSERT(utility::containsElement( - result, FilePath("data/UtilityMavenTestSuite/simple_maven_project/src/test/java").makeAbsolute() + result, FilePath(L"data/UtilityMavenTestSuite/simple_maven_project/src/test/java").makeAbsolute() )); } } @@ -63,23 +63,23 @@ public: if (!mavenPathDetector->getPaths().empty()) { std::vector result = utility::mavenGetAllDirectoriesFromEffectivePom( - mavenPathDetector->getPaths().front(), FilePath("data/UtilityMavenTestSuite/nested_maven_project"), false + mavenPathDetector->getPaths().front(), FilePath(L"data/UtilityMavenTestSuite/nested_maven_project"), false ); TS_ASSERT(utility::containsElement( - result, FilePath("data/UtilityMavenTestSuite/nested_maven_project/module_1/src/main/java").makeAbsolute() + result, FilePath(L"data/UtilityMavenTestSuite/nested_maven_project/module_1/src/main/java").makeAbsolute() )); TS_ASSERT(utility::containsElement( - result, FilePath("data/UtilityMavenTestSuite/nested_maven_project/module_2/src/main/java").makeAbsolute() + result, FilePath(L"data/UtilityMavenTestSuite/nested_maven_project/module_2/src/main/java").makeAbsolute() )); TS_ASSERT(!utility::containsElement( - result, FilePath("data/UtilityMavenTestSuite/nested_maven_project/module_1/src/test/java").makeAbsolute() + result, FilePath(L"data/UtilityMavenTestSuite/nested_maven_project/module_1/src/test/java").makeAbsolute() )); TS_ASSERT(!utility::containsElement( - result, FilePath("data/UtilityMavenTestSuite/nested_maven_project/module_2/src/test/java").makeAbsolute() + result, FilePath(L"data/UtilityMavenTestSuite/nested_maven_project/module_2/src/test/java").makeAbsolute() )); } } @@ -92,23 +92,23 @@ public: if (!mavenPathDetector->getPaths().empty()) { std::vector result = utility::mavenGetAllDirectoriesFromEffectivePom( - mavenPathDetector->getPaths().front(), FilePath("data/UtilityMavenTestSuite/nested_maven_project"), true + mavenPathDetector->getPaths().front(), FilePath(L"data/UtilityMavenTestSuite/nested_maven_project"), true ); TS_ASSERT(utility::containsElement( - result, FilePath("data/UtilityMavenTestSuite/nested_maven_project/module_1/src/main/java").makeAbsolute() + result, FilePath(L"data/UtilityMavenTestSuite/nested_maven_project/module_1/src/main/java").makeAbsolute() )); TS_ASSERT(utility::containsElement( - result, FilePath("data/UtilityMavenTestSuite/nested_maven_project/module_2/src/main/java").makeAbsolute() + result, FilePath(L"data/UtilityMavenTestSuite/nested_maven_project/module_2/src/main/java").makeAbsolute() )); TS_ASSERT(utility::containsElement( - result, FilePath("data/UtilityMavenTestSuite/nested_maven_project/module_1/src/test/java").makeAbsolute() + result, FilePath(L"data/UtilityMavenTestSuite/nested_maven_project/module_1/src/test/java").makeAbsolute() )); TS_ASSERT(utility::containsElement( - result, FilePath("data/UtilityMavenTestSuite/nested_maven_project/module_2/src/test/java").makeAbsolute() + result, FilePath(L"data/UtilityMavenTestSuite/nested_maven_project/module_2/src/test/java").makeAbsolute() )); } }