logic: used wstring in FilePath constructor

* used wstring in FilePath constructor where easily possible
* added FilePath concatenate method that accepts string parameter
* implemented using only wstring in MessageStatus
* used wstring in config
This commit is contained in:
mlangkabel
2018-01-30 11:00:23 +01:00
parent 143cf6a02d
commit 0dda63f7ae
157 changed files with 1230 additions and 945 deletions
+1 -1
View File
@@ -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.");
+22 -23
View File
@@ -6,29 +6,28 @@
namespace utility
{
std::vector<std::string> getRequiredJarNames()
std::vector<std::wstring> getRequiredJarNames()
{
std::vector<std::string> 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<std::string> jarNames = getRequiredJarNames();
const std::vector<std::wstring> 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();
}
}
+1 -1
View File
@@ -8,7 +8,7 @@ class FilePath;
namespace utility
{
std::vector<std::string> getRequiredJarNames();
std::vector<std::wstring> getRequiredJarNames();
std::string prepareJavaEnvironment();
}
+5 -5
View File
@@ -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<std::string>("projects", "project", "build", "sourceDirectory"));
fetchDirectories(uncheckedDirectories, xmlAccess,
utility::createVectorFromElements<std::string>("project", "build", "directory"), FilePath("generated-sources"));
utility::createVectorFromElements<std::string>("project", "build", "directory"), FilePath(L"generated-sources"));
fetchDirectories(uncheckedDirectories, xmlAccess,
utility::createVectorFromElements<std::string>("projects", "project", "build", "directory"), FilePath("generated-sources"));
utility::createVectorFromElements<std::string>("projects", "project", "build", "directory"), FilePath(L"generated-sources"));
if (addTestDirectories)
{
@@ -176,9 +176,9 @@ namespace utility
fetchDirectories(uncheckedDirectories, xmlAccess,
utility::createVectorFromElements<std::string>("projects", "project", "build", "testSourceDirectory"));
fetchDirectories(uncheckedDirectories, xmlAccess,
utility::createVectorFromElements<std::string>("project", "build", "directory"), FilePath("generated-test-sources"));
utility::createVectorFromElements<std::string>("project", "build", "directory"), FilePath(L"generated-test-sources"));
fetchDirectories(uncheckedDirectories, xmlAccess,
utility::createVectorFromElements<std::string>("projects", "project", "build", "directory"), FilePath("generated-test-sources"));
utility::createVectorFromElements<std::string>("projects", "project", "build", "directory"), FilePath(L"generated-test-sources"));
}
std::vector<FilePath> directories;