diff --git a/src/lib/Application.cpp b/src/lib/Application.cpp index 97a83ed4..8cee65db 100644 --- a/src/lib/Application.cpp +++ b/src/lib/Application.cpp @@ -448,7 +448,7 @@ void Application::updateTitle() if (!projectPath.empty()) { - title += L" - " + projectPath.wFileName(); + title += L" - " + projectPath.fileName(); } } diff --git a/src/lib/component/controller/BookmarkController.cpp b/src/lib/component/controller/BookmarkController.cpp index 3042e4b6..d3be4d23 100644 --- a/src/lib/component/controller/BookmarkController.cpp +++ b/src/lib/component/controller/BookmarkController.cpp @@ -505,7 +505,7 @@ std::wstring BookmarkController::getNodeDisplayName(const Id nodeId) const if (type.isFile()) { - return FilePath(nameHierarchy.getQualifiedName()).wFileName(); + return FilePath(nameHierarchy.getQualifiedName()).fileName(); } return nameHierarchy.getQualifiedName(); diff --git a/src/lib/component/controller/CodeController.cpp b/src/lib/component/controller/CodeController.cpp index ada0ac7c..f483c443 100644 --- a/src/lib/component/controller/CodeController.cpp +++ b/src/lib/component/controller/CodeController.cpp @@ -40,7 +40,7 @@ void CodeController::handleMessage(MessageActivateAll* message) } CodeSnippetParams statsSnippet; - statsSnippet.title = currentProject->getProjectSettingsFilePath().withoutExtension().wFileName(); + statsSnippet.title = currentProject->getProjectSettingsFilePath().withoutExtension().fileName(); statsSnippet.startLineNumber = 1; statsSnippet.endLineNumber = 1; diff --git a/src/lib/component/view/helper/CodeSnippetParams.cpp b/src/lib/component/view/helper/CodeSnippetParams.cpp index 84c31459..535beeb0 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().wFileName() < bFilePath.withoutExtension().wFileName(); + return aFilePath.withoutExtension().fileName() < bFilePath.withoutExtension().fileName(); } } diff --git a/src/lib/data/storage/PersistentStorage.cpp b/src/lib/data/storage/PersistentStorage.cpp index a68fc031..2ee22674 100644 --- a/src/lib/data/storage/PersistentStorage.cpp +++ b/src/lib/data/storage/PersistentStorage.cpp @@ -702,7 +702,7 @@ std::vector PersistentStorage::getAutocompletionFileMatches(const s match.tokenIds = utility::toVector(result.elementIds); const FilePath path(match.name); - match.text = path.wFileName(); + match.text = path.fileName(); match.subtext = path.wstr(); match.delimiter = NAME_DELIMITER_FILE; @@ -797,7 +797,7 @@ std::vector PersistentStorage::getSearchMatchesForTokenIds(const st if (match.nodeType.isFile()) { - match.text = FilePath(match.text).wFileName(); + match.text = FilePath(match.text).fileName(); } matches.push_back(match); @@ -2182,7 +2182,7 @@ void PersistentStorage::addNodesToGraph(const std::vector& newNodeIds, Graph Node* node = graph->createNode( storageNode.id, type, - NameHierarchy(filePath.wFileName(), NAME_DELIMITER_FILE), + NameHierarchy(filePath.fileName(), NAME_DELIMITER_FILE), defined ); node->addComponentFilePath(std::make_shared(filePath)); @@ -2513,7 +2513,7 @@ void PersistentStorage::buildFilePathMaps() m_fileNodePaths.emplace(file.id, path); m_fileNodeComplete.emplace(file.id, file.complete); - if (!m_hasJavaFiles && path.extension() == ".java") + if (!m_hasJavaFiles && path.extension() == L".java") { m_hasJavaFiles = true; } @@ -2622,7 +2622,7 @@ void PersistentStorage::buildMemberEdgeIdOrderMap() } const FilePath path(m_fileNodePaths[location.fileNodeId]); - if (path.extension() == ".java") + if (path.extension() == L".java") { collection.addSourceLocation( intToLocationType(location.type), diff --git a/src/lib/project/Project.cpp b/src/lib/project/Project.cpp index 5b00a440..a63eee73 100644 --- a/src/lib/project/Project.cpp +++ b/src/lib/project/Project.cpp @@ -85,9 +85,9 @@ void Project::load() const FilePath projectSettingsPath = m_settings->getFilePath(); - const std::string dbExtension = (projectSettingsPath.extension() == ".coatiproject" ? "coatidb" : "srctrldb"); + const std::wstring dbExtension = (projectSettingsPath.extension() == L".coatiproject" ? L"coatidb" : L"srctrldb"); const FilePath dbPath = FilePath(projectSettingsPath).replaceExtension(dbExtension); - const FilePath bookmarkPath = FilePath(projectSettingsPath).replaceExtension("srctrlbm"); + const FilePath bookmarkPath = FilePath(projectSettingsPath).replaceExtension(L"srctrlbm"); m_storage = std::make_shared(dbPath, bookmarkPath); diff --git a/src/lib/settings/ProjectSettings.cpp b/src/lib/settings/ProjectSettings.cpp index b21f6b81..3cd2048c 100644 --- a/src/lib/settings/ProjectSettings.cpp +++ b/src/lib/settings/ProjectSettings.cpp @@ -116,7 +116,7 @@ void ProjectSettings::setProjectFilePath(std::wstring projectName, const FilePat std::wstring ProjectSettings::getProjectName() const { - return getFilePath().withoutExtension().wFileName(); + return getFilePath().withoutExtension().fileName(); } FilePath ProjectSettings::getProjectDirectoryPath() const diff --git a/src/lib/utility/commandline/CommandLineParser.cpp b/src/lib/utility/commandline/CommandLineParser.cpp index 06dd02f8..a0434bc5 100644 --- a/src/lib/utility/commandline/CommandLineParser.cpp +++ b/src/lib/utility/commandline/CommandLineParser.cpp @@ -221,7 +221,7 @@ void CommandLineParser::processProjectfile() m_projectFile.makeAbsolute(); const std::wstring errorstring = - L"Provided Projectfile is not valid:\n* Provided Projectfile('" + m_projectFile.wFileName() + L"') "; + L"Provided Projectfile is not valid:\n* Provided Projectfile('" + m_projectFile.fileName() + L"') "; if (!m_projectFile.exists()) { m_errorString = errorstring + L" does not exist"; @@ -229,7 +229,7 @@ void CommandLineParser::processProjectfile() return; } - if (m_projectFile.extension() != ".srctrlprj" && m_projectFile.extension() != ".coatiproject") + if (m_projectFile.extension() != L".srctrlprj" && m_projectFile.extension() != L".coatiproject") { m_errorString = errorstring + L" has a wrong file ending"; m_projectFile = FilePath(); diff --git a/src/lib/utility/file/FilePath.cpp b/src/lib/utility/file/FilePath.cpp index 32dd3b3a..6266e4a0 100644 --- a/src/lib/utility/file/FilePath.cpp +++ b/src/lib/utility/file/FilePath.cpp @@ -381,22 +381,12 @@ std::string FilePath::getBackslashedString() const return utility::replace(str(), "/", "\\"); } -std::string FilePath::fileName() const -{ - return m_path->filename().generic_string(); -} - -std::wstring FilePath::wFileName() const +std::wstring FilePath::fileName() const { return m_path->filename().generic_wstring(); } -std::string FilePath::extension() const -{ - return m_path->extension().generic_string(); -} - -std::wstring FilePath::wExtension() const +std::wstring FilePath::extension() const { return m_path->extension().generic_wstring(); } @@ -406,15 +396,15 @@ FilePath FilePath::withoutExtension() const return FilePath(getPath().replace_extension().wstring()); } -FilePath FilePath::replaceExtension(const std::string& extension) const +FilePath FilePath::replaceExtension(const std::wstring& extension) const { return FilePath(getPath().replace_extension(extension).wstring()); } -bool FilePath::hasExtension(const std::vector& extensions) const +bool FilePath::hasExtension(const std::vector& extensions) const { - std::string e = extension(); - for (const std::string& ext : extensions) + const std::wstring e = extension(); + for (const std::wstring& ext : extensions) { if (e == ext) { diff --git a/src/lib/utility/file/FilePath.h b/src/lib/utility/file/FilePath.h index 054b41b1..5ebac30f 100644 --- a/src/lib/utility/file/FilePath.h +++ b/src/lib/utility/file/FilePath.h @@ -51,14 +51,12 @@ public: std::string str() const; std::wstring wstr() const; std::string getBackslashedString() const; - std::string fileName() const; - std::wstring wFileName() const; + std::wstring fileName() const; - std::string extension() const; - std::wstring wExtension() const; + std::wstring extension() const; FilePath withoutExtension() const; - FilePath replaceExtension(const std::string& extension) const; - bool hasExtension(const std::vector& extensions) const; + FilePath replaceExtension(const std::wstring& extension) const; + bool hasExtension(const std::vector& extensions) const; FilePath& operator=(const FilePath& other); FilePath& operator=(FilePath&& other); diff --git a/src/lib/utility/file/FileSystem.cpp b/src/lib/utility/file/FileSystem.cpp index 85d7b868..709a40f5 100644 --- a/src/lib/utility/file/FileSystem.cpp +++ b/src/lib/utility/file/FileSystem.cpp @@ -116,7 +116,7 @@ std::vector FileSystem::getFileInfosFromPaths( } } } - else if (path.exists() && (ext.empty() || ext.find(utility::toLowerCase(path.wExtension())) != ext.end())) + else if (path.exists() && (ext.empty() || ext.find(utility::toLowerCase(path.extension())) != ext.end())) { const FilePath canonicalPath = path.getCanonical(); boost::filesystem::path p = canonicalPath.getPath(); diff --git a/src/lib/utility/file/FileTree.cpp b/src/lib/utility/file/FileTree.cpp index 9b26f708..f8d0e192 100644 --- a/src/lib/utility/file/FileTree.cpp +++ b/src/lib/utility/file/FileTree.cpp @@ -40,7 +40,7 @@ std::vector FileTree::doGetAbsoluteRootPathsForRelativeFilePath(const { std::vector rootPaths; - std::unordered_map>::const_iterator it = m_files.find(relativeFilePath.fileName()); + std::unordered_map>::const_iterator it = m_files.find(relativeFilePath.fileName()); if (it != m_files.end()) { for (FilePath existingFilePath : it->second) @@ -51,7 +51,7 @@ std::vector FileTree::doGetAbsoluteRootPathsForRelativeFilePath(const FilePath temp = relativeFilePath.getParentDirectory(); while (!temp.empty()) { - if (temp.fileName() == "..") + if (temp.fileName() == L"..") { std::vector subDirectories = FileSystem::getDirectSubDirectories(existingFilePath); if (!subDirectories.empty()) diff --git a/src/lib/utility/file/FileTree.h b/src/lib/utility/file/FileTree.h index d9bb8747..dc288d19 100644 --- a/src/lib/utility/file/FileTree.h +++ b/src/lib/utility/file/FileTree.h @@ -19,7 +19,7 @@ private: std::vector doGetAbsoluteRootPathsForRelativeFilePath(const FilePath& relativeFilePath, bool allowMultipleResults); FilePath m_rootPath; - std::unordered_map> m_files; + std::unordered_map> m_files; }; #endif // FILE_TREE_H diff --git a/src/lib/utility/tracing.h b/src/lib/utility/tracing.h index 1e9d423a..61dd0dba 100644 --- a/src/lib/utility/tracing.h +++ b/src/lib/utility/tracing.h @@ -119,7 +119,7 @@ ScopedTrace::ScopedTrace( { m_event = TracerType::getInstance()->startEvent(eventName); m_event->functionName = functionName; - m_event->locationName = FilePath(fileName).fileName() + ":" + std::to_string(lineNumber); + m_event->locationName = utility::encodeToUtf8(FilePath(fileName).fileName()) + ":" + std::to_string(lineNumber); m_timeStamp = utility::durationStart(); } diff --git a/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentIndexer.cpp b/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentIndexer.cpp index 7d2a0def..ed96fa0d 100644 --- a/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentIndexer.cpp +++ b/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentIndexer.cpp @@ -147,7 +147,7 @@ void CxxAstVisitorComponentIndexer::beginTraverseLambdaCapture(clang::LambdaExpr { ParseLocation declLocation = getParseLocation(d->getLocation()); std::wstring name = - declLocation.filePath.wFileName() + L"<" + + declLocation.filePath.fileName() + L"<" + std::to_wstring(declLocation.startLineNumber) + L":" + std::to_wstring(declLocation.startColumnNumber) + L">"; m_client->recordLocalSymbol(name, getParseLocation(capture->getLocation())); @@ -234,7 +234,7 @@ void CxxAstVisitorComponentIndexer::visitVarDecl(clang::VarDecl* d) { ParseLocation declLocation = getParseLocation(d->getLocation()); std::wstring name = - declLocation.filePath.wFileName() + L"<" + + declLocation.filePath.fileName() + L"<" + std::to_wstring(declLocation.startLineNumber) + L":" + std::to_wstring(declLocation.startColumnNumber) + L">"; m_client->recordLocalSymbol(name, getParseLocation(d->getLocation())); @@ -575,7 +575,7 @@ void CxxAstVisitorComponentIndexer::visitDeclRefExpr(clang::DeclRefExpr* s) (clang::isa(decl) && decl->getParentFunctionOrMethod() != NULL) ) { ParseLocation declLocation = getParseLocation(decl->getLocation()); - std::wstring name = declLocation.filePath.wFileName() + L"<" + + std::wstring name = declLocation.filePath.fileName() + L"<" + std::to_wstring(declLocation.startLineNumber) + L":" + std::to_wstring(declLocation.startColumnNumber) + L">"; diff --git a/src/lib_cxx/data/parser/cxx/name_resolver/CxxDeclNameResolver.cpp b/src/lib_cxx/data/parser/cxx/name_resolver/CxxDeclNameResolver.cpp index cbbd49b2..ea43bb83 100644 --- a/src/lib_cxx/data/parser/cxx/name_resolver/CxxDeclNameResolver.cpp +++ b/src/lib_cxx/data/parser/cxx/name_resolver/CxxDeclNameResolver.cpp @@ -438,7 +438,7 @@ std::wstring CxxDeclNameResolver::getTranslationUnitMainFileName(const clang::De if (fileId.isValid()) { const clang::FileEntry* fileEntry = sourceManager.getFileEntryForID(fileId); - return getCanonicalFilePathCache()->getCanonicalFilePath(fileEntry).wFileName(); + return getCanonicalFilePathCache()->getCanonicalFilePath(fileEntry).fileName(); } return L""; } @@ -449,9 +449,9 @@ std::wstring CxxDeclNameResolver::getDeclarationFileName(const clang::Decl* decl const clang::FileEntry* fileEntry = sourceManager.getFileEntryForID(sourceManager.getFileID(declaration->getLocStart())); if (fileEntry != nullptr && fileEntry->isValid()) { - return getCanonicalFilePathCache()->getCanonicalFilePath(fileEntry).wFileName(); + return getCanonicalFilePathCache()->getCanonicalFilePath(fileEntry).fileName(); } - return getCanonicalFilePathCache()->getCanonicalFilePath(utility::decodeFromUtf8(sourceManager.getPresumedLoc(declaration->getLocStart()).getFilename())).wFileName(); + return getCanonicalFilePathCache()->getCanonicalFilePath(utility::decodeFromUtf8(sourceManager.getPresumedLoc(declaration->getLocStart()).getFilename())).fileName(); } std::wstring CxxDeclNameResolver::getNameForAnonymousSymbol(const std::wstring& symbolKindName, const clang::Decl* declaration) diff --git a/src/lib_cxx/data/parser/cxx/utilityClang.cpp b/src/lib_cxx/data/parser/cxx/utilityClang.cpp index cf4d18eb..591229b4 100644 --- a/src/lib_cxx/data/parser/cxx/utilityClang.cpp +++ b/src/lib_cxx/data/parser/cxx/utilityClang.cpp @@ -121,7 +121,7 @@ std::wstring utility::getFileNameOfFileEntry(const clang::FileEntry* entry) } else { - fileName = FilePath(utility::decodeFromUtf8(entry->getName().str())).getParentDirectory().concatenate(FilePath(fileName).wFileName()).wstr(); + fileName = FilePath(utility::decodeFromUtf8(entry->getName().str())).getParentDirectory().concatenate(FilePath(fileName).fileName()).wstr(); } } return fileName; diff --git a/src/lib_gui/qt/QtApplication.cpp b/src/lib_gui/qt/QtApplication.cpp index 7be4e797..eb7397e2 100644 --- a/src/lib_gui/qt/QtApplication.cpp +++ b/src/lib_gui/qt/QtApplication.cpp @@ -28,7 +28,7 @@ bool QtApplication::event(QEvent *event) FilePath path(fileEvent->file().toStdWString()); - if (path.exists() && (path.extension() == ".srctrlprj" || path.extension() == ".coatiproject")) + if (path.exists() && (path.extension() == L".srctrlprj" || path.extension() == L".coatiproject")) { MessageLoadProject(path).dispatch(); return true; diff --git a/src/lib_gui/qt/element/QtCodeField.cpp b/src/lib_gui/qt/element/QtCodeField.cpp index 991a30c9..4ad177a0 100644 --- a/src/lib_gui/qt/element/QtCodeField.cpp +++ b/src/lib_gui/qt/element/QtCodeField.cpp @@ -74,7 +74,7 @@ QtCodeField::QtCodeField( LanguageType language = LANGUAGE_UNKNOWN; if (!path.empty()) { - language = (path.extension() == ".java" ? LANGUAGE_JAVA : LANGUAGE_CPP); + language = (path.extension() == L".java" ? LANGUAGE_JAVA : LANGUAGE_CPP); } m_highlighter = new QtHighlighter(document(), language); diff --git a/src/lib_gui/qt/element/QtCodeFileTitleButton.cpp b/src/lib_gui/qt/element/QtCodeFileTitleButton.cpp index bdbb699e..8f9de62d 100644 --- a/src/lib_gui/qt/element/QtCodeFileTitleButton.cpp +++ b/src/lib_gui/qt/element/QtCodeFileTitleButton.cpp @@ -102,7 +102,7 @@ void QtCodeFileTitleButton::updateTexts() return; } - std::wstring title = m_filePath.wFileName(); + std::wstring title = m_filePath.fileName(); std::wstring toolTip = L"file: " + m_filePath.wstr(); if ((!m_filePath.recheckExists()) || diff --git a/src/lib_gui/qt/element/QtCodeSnippet.cpp b/src/lib_gui/qt/element/QtCodeSnippet.cpp index 09ce52ad..f4aa14fe 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(QString::fromStdWString(FilePath(m_titleString).wFileName())); + m_title->setText(QString::fromStdWString(FilePath(m_titleString).fileName())); } 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(QString::fromStdWString(FilePath(m_footerString).wFileName())); + m_footer->setText(QString::fromStdWString(FilePath(m_footerString).fileName())); } else { diff --git a/src/lib_gui/qt/window/QtMainWindow.cpp b/src/lib_gui/qt/window/QtMainWindow.cpp index 9b76aed0..1c800cf1 100644 --- a/src/lib_gui/qt/window/QtMainWindow.cpp +++ b/src/lib_gui/qt/window/QtMainWindow.cpp @@ -711,7 +711,7 @@ void QtMainWindow::updateRecentProjectMenu() { FilePath project = recentProjects[i]; m_recentProjectAction[i]->setVisible(true); - m_recentProjectAction[i]->setText(QString::fromStdWString(project.wFileName())); + m_recentProjectAction[i]->setText(QString::fromStdWString(project.fileName())); m_recentProjectAction[i]->setData(QString::fromStdWString(project.wstr())); } else diff --git a/src/lib_gui/qt/window/QtStartScreen.cpp b/src/lib_gui/qt/window/QtStartScreen.cpp index 7a42ba3c..589c5ef7 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(QString::fromStdWString(m_projectFilePath.withoutExtension().wFileName())); + this->setText(QString::fromStdWString(m_projectFilePath.withoutExtension().fileName())); if (m_projectExists) { this->setToolTip(m_projectFilePath.str().c_str()); diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzard.cpp b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzard.cpp index fa8bd348..21b6d4a0 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzard.cpp +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzard.cpp @@ -74,7 +74,7 @@ void QtProjectWizzard::newProjectFromCDB(const FilePath& filePath) if (m_projectSettings->getProjectFilePath().empty()) { - m_projectSettings->setProjectFilePath(filePath.withoutExtension().wFileName(), filePath.getParentDirectory()); + m_projectSettings->setProjectFilePath(filePath.withoutExtension().fileName(), filePath.getParentDirectory()); } if (!m_contentWidget) diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPath.cpp b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPath.cpp index c1dd55fd..805303b9 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPath.cpp +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPath.cpp @@ -103,7 +103,7 @@ void QtProjectWizzardContentPath::setHelpString(const QString& help) m_helpString = help; } -void QtProjectWizzardContentPath::setFileEndings(const std::set& fileEndings) +void QtProjectWizzardContentPath::setFileEndings(const std::set& fileEndings) { m_fileEndings = fileEndings; } @@ -122,7 +122,7 @@ QtProjectWizzardContentPathCDB::QtProjectWizzardContentPathCDB( "
" "You can make use of environment variables with ${ENV_VAR}." ); - setFileEndings({ ".json" }); + setFileEndings({ L".json" }); } void QtProjectWizzardContentPathCDB::populate(QGridLayout* layout, int& row) @@ -179,7 +179,7 @@ QtProjectWizzardContentPathSourceMaven::QtProjectWizzardContentPathSourceMaven( "
" "You can make use of environment variables with ${ENV_VAR}." ); - setFileEndings({ ".xml" }); + setFileEndings({ L".xml" }); } void QtProjectWizzardContentPathSourceMaven::populate(QGridLayout* layout, int& row) @@ -324,7 +324,7 @@ QtProjectWizzardContentPathSourceGradle::QtProjectWizzardContentPathSourceGradle "
" "You can make use of environment variables with ${ENV_VAR}." ); - setFileEndings({ ".gradle" }); + setFileEndings({ L".gradle" }); } void QtProjectWizzardContentPathSourceGradle::populate(QGridLayout* layout, int& row) diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPath.h b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPath.h index 3d57d881..ce31e441 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPath.h +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPath.h @@ -29,7 +29,7 @@ protected: void setTitleString(const QString& title); void setHelpString(const QString& help); - void setFileEndings(const std::set& fileEndings); + void setFileEndings(const std::set& fileEndings); std::shared_ptr m_settings; @@ -40,7 +40,7 @@ protected: private: QString m_titleString; QString m_helpString; - std::set m_fileEndings; + std::set m_fileEndings; }; diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPreferences.cpp b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPreferences.cpp index 106c619a..d0a31e19 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPreferences.cpp +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPreferences.cpp @@ -89,7 +89,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, QString::fromStdWString(m_colorSchemePaths[i].withoutExtension().wFileName())); + m_colorSchemes->insertItem(i, QString::fromStdWString(m_colorSchemePaths[i].withoutExtension().fileName())); } connect(m_colorSchemes, static_cast(&QComboBox::activated), this, &QtProjectWizzardContentPreferences::colorSchemeChanged); diff --git a/src/lib_java/project/SourceGroupJava.cpp b/src/lib_java/project/SourceGroupJava.cpp index 1e97fa18..10724bfb 100644 --- a/src/lib_java/project/SourceGroupJava.cpp +++ b/src/lib_java/project/SourceGroupJava.cpp @@ -164,7 +164,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.wFileName() != utility::decodeFromUtf8(*it)) + if (rootPath.fileName() != utility::decodeFromUtf8(*it)) { success = false; break; diff --git a/src/test/FilePathTestSuite.h b/src/test/FilePathTestSuite.h index 20a6cb55..193212f6 100644 --- a/src/test/FilePathTestSuite.h +++ b/src/test/FilePathTestSuite.h @@ -118,14 +118,14 @@ public: { const FilePath path(L"data/FilePathTestSuite/abc.h"); - TS_ASSERT_EQUALS(path.wFileName(), L"abc.h"); + TS_ASSERT_EQUALS(path.fileName(), L"abc.h"); } void test_file_path_extension() { const FilePath path(L"data/FilePathTestSuite/a.h"); - TS_ASSERT_EQUALS(path.extension(), ".h"); + TS_ASSERT_EQUALS(path.extension(), L".h"); } void test_file_path_without_extension() @@ -137,10 +137,10 @@ public: void test_file_path_has_extension() { - std::vector extensions; - extensions.push_back(".h"); - extensions.push_back(".cpp"); - extensions.push_back(".cc"); + std::vector extensions; + extensions.push_back(L".h"); + extensions.push_back(L".cpp"); + extensions.push_back(L".cc"); TS_ASSERT(FilePath(L"data/FilePathTestSuite/a.h").hasExtension(extensions)); TS_ASSERT(FilePath(L"data/FilePathTestSuite/b.cpp").hasExtension(extensions)); diff --git a/src/test/helper/DumpParserClient.h b/src/test/helper/DumpParserClient.h index c11b2a88..1a5d3e33 100644 --- a/src/test/helper/DumpParserClient.h +++ b/src/test/helper/DumpParserClient.h @@ -27,7 +27,7 @@ public: const ParseLocation& location, AccessKind access, DefinitionKind definitionKind) override { - recordLine(symbolKindToString(symbolKind) + L" " + addLocationSuffix(addAccessPrefix(symbolName.getQualifiedNameWithSignature(), access) + L" [" + location.filePath.wFileName(), location) + L"]\n"); + recordLine(symbolKindToString(symbolKind) + L" " + addLocationSuffix(addAccessPrefix(symbolName.getQualifiedNameWithSignature(), access) + L" [" + location.filePath.fileName(), location) + L"]\n"); return 0; } @@ -36,7 +36,7 @@ public: const ParseLocation& location, const ParseLocation& scopeLocation, AccessKind access, DefinitionKind definitionKind) override { - recordLine(symbolKindToString(symbolKind) + L" " + addLocationSuffix(addAccessPrefix(symbolName.getQualifiedNameWithSignature(), access) + L" [" + location.filePath.wFileName(), location, scopeLocation) + L"]\n"); + recordLine(symbolKindToString(symbolKind) + L" " + addLocationSuffix(addAccessPrefix(symbolName.getQualifiedNameWithSignature(), access) + L" [" + location.filePath.fileName(), location, scopeLocation) + L"]\n"); return 0; } @@ -49,7 +49,7 @@ public: { if (FilePath(referencedNameString).exists()) { - referencedNameString = FilePath(referencedNameString).wFileName(); + referencedNameString = FilePath(referencedNameString).fileName(); } } catch (const boost::filesystem::filesystem_error& e) @@ -62,7 +62,7 @@ public: { if (FilePath(contextNameString).exists()) { - contextNameString = FilePath(contextNameString).wFileName(); + contextNameString = FilePath(contextNameString).fileName(); } } catch (const boost::filesystem::filesystem_error& e) @@ -70,27 +70,27 @@ public: // do nothing and use the old contectNameString } - recordLine(referenceKindToString(referenceKind) + L" " + addLocationSuffix(contextNameString + L" -> " + referencedNameString + L" [" + location.filePath.wFileName(), location) + L"]\n"); + recordLine(referenceKindToString(referenceKind) + L" " + addLocationSuffix(contextNameString + L" -> " + referencedNameString + L" [" + location.filePath.fileName(), location) + L"]\n"); } void recordQualifierLocation(const NameHierarchy& qualifierName, const ParseLocation& location) override { - recordLine(L"QUALIFIER: " + addLocationSuffix(qualifierName.getQualifiedNameWithSignature() + L" [" + location.filePath.wFileName(), location) + L"]\n"); + recordLine(L"QUALIFIER: " + addLocationSuffix(qualifierName.getQualifiedNameWithSignature() + L" [" + location.filePath.fileName(), location) + L"]\n"); } virtual void recordLocalSymbol(const std::wstring& name, const ParseLocation& location) override { - recordLine(L"LOCAL_SYMBOL: " + addLocationSuffix(name + L" [" + location.filePath.wFileName(), location) + L"]\n"); + recordLine(L"LOCAL_SYMBOL: " + addLocationSuffix(name + L" [" + location.filePath.fileName(), location) + L"]\n"); } virtual void recordFile(const FileInfo& fileInfo) override { - recordLine(L"FILE: " + fileInfo.path.wFileName() + L"\n"); + recordLine(L"FILE: " + fileInfo.path.fileName() + L"\n"); } virtual void recordComment(const ParseLocation& location) override { - recordLine(L"COMMENT: " + addLocationSuffix(L"comment [" + location.filePath.wFileName(), location) + L"]\n"); + recordLine(L"COMMENT: " + addLocationSuffix(L"comment [" + location.filePath.fileName(), location) + L"]\n"); } std::wstring m_lines; @@ -99,7 +99,7 @@ private: virtual void doRecordError(const ParseLocation& location, const std::wstring& message, bool fatal, bool indexed) override { - recordLine(L"ERROR: " + addLocationSuffix(message + L" [" + location.filePath.wFileName(), location) + L"]\n"); + recordLine(L"ERROR: " + addLocationSuffix(message + L" [" + location.filePath.fileName(), location) + L"]\n"); } void recordLine(const std::wstring& message)