// -*- C++ -*-
/**
- * \file package.C
+ * \file package.cpp
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
#include "support/Package.h"
-#include "debug.h"
-#include "gettext.h"
-
+#include "support/debug.h"
#include "support/environment.h"
+#include "support/ExceptionMessage.h"
#include "support/filetools.h"
+#include "support/gettext.h"
#include "support/lstrings.h"
-#include "support/ExceptionMessage.h"
#include "support/os.h"
#if defined (USE_WINDOWS_PACKAGING)
# include <CoreServices/CoreServices.h> // FSFindFolder, FSRefMakePath
#endif
-using std::string;
+using namespace std;
namespace lyx {
namespace support {
quoteName(configure_script.toFilesystemEncoding()) +
with_version_suffix();
- lyxerr[Debug::INIT]
- << "<package>\n"
+ LYXERR(Debug::INIT, "<package>\n"
<< "\tbinary_dir " << binary_dir().absFilename() << '\n'
<< "\tsystem_support " << system_support().absFilename() << '\n'
<< "\tbuild_support " << build_support().absFilename() << '\n'
<< "\tdocument_dir " << document_dir().absFilename() << '\n'
<< "\ttemp_dir " << temp_dir().absFilename() << '\n'
<< "\thome_dir " << home_dir().absFilename() << '\n'
- << "</package>\n" << std::endl;
+ << "</package>\n");
}
indirection = "../../lib";
break;
}
- return FileName(normalizePath(addPath(binary_dir, indirection)));
+ return FileName(addPath(binary_dir, indirection));
}
FileName(addPath(Package::top_srcdir().absFilename(), "lib"));
if (!fileSearch(system_support_dir.absFilename(), "chkconfig.ltx").empty()) {
- lyxerr[Debug::INIT] << check_text << " yes"
- << std::endl;
+ LYXERR(Debug::INIT, check_text << " yes");
return;
}
}
}
}
- lyxerr[Debug::INIT] << check_text << " no" << std::endl;
+ LYXERR(Debug::INIT, check_text << " no");
system_support_dir = FileName();
build_support_dir = FileName();
}
// 2. Search for system_support_dir / <relative locale dir>
// The <relative locale dir> is OS-dependent. (On Unix, it will
// be "../locale/".)
- FileName path(normalizePath(addPath(system_support_dir.absFilename(),
- relative_locale_dir())));
+ FileName path(addPath(system_support_dir.absFilename(),
+ relative_locale_dir()));
if (path.exists() && path.isDirectory())
return path;
// Typical example: C:/TEMP/.
char path[MAX_PATH];
GetTempPath(MAX_PATH, path);
- return FileName(os::internal_path(to_utf8(from_local8bit(path))));
+ return FileName(to_utf8(from_local8bit(path)));
#else // Posix-like.
return FileName("/tmp");
#endif
if (command_line.empty())
return FileName();
- string const path = fix_dir_name(command_line);
- return os::is_absolute_path(path) ? FileName(path) : makeAbsPath(path);
+ string const str_path = fix_dir_name(command_line);
+ FileName path(str_path);
+ return path.isAbsolute() ? path : makeAbsPath(str_path);
}
#else
string const exe_path = os::internal_path(exe);
#endif
- if (os::is_absolute_path(exe_path))
- return FileName(exe_path);
+ FileName exepath(exe_path);
+ if (exepath.isAbsolute())
+ return exepath;
// Two possibilities present themselves.
// 1. The binary is relative to the CWD.
if (exe_name != exe_path)
return FileName();
- std::vector<string> const path = getEnvPath("PATH");
- std::vector<string>::const_iterator it = path.begin();
- std::vector<string>::const_iterator const end = path.end();
+ vector<string> const path = getEnvPath("PATH");
+ vector<string>::const_iterator it = path.begin();
+ vector<string>::const_iterator const end = path.end();
for (; it != end; ++it) {
// This will do nothing if *it is already absolute.
string const exe_dir = makeAbsPath(*it).absFilename();
// searched_dirs is used for diagnostic purposes only in the case
// that "chkconfig.ltx" is not found.
- std::list<FileName> searched_dirs;
+ list<FileName> searched_dirs;
// 1. Use the -sysdir command line parameter.
FileName path = abs_path_from_command_line(command_line_system_support_dir);
// Try and find "chkconfig.ltx".
string const binary_dir = onlyPath(binary.absFilename());
- FileName const lyxdir(
- normalizePath(addPath(binary_dir, relative_lyxdir)));
+ FileName const lyxdir(addPath(binary_dir, relative_lyxdir));
searched_dirs.push_back(lyxdir);
if (!fileSearch(lyxdir.absFilename(), chkconfig_ltx).empty()) {
}
// Try and find "chkconfig.ltx".
- FileName const lyxdir(
- normalizePath(addPath(binary_dir.absFilename(), relative_lyxdir)));
+ FileName const lyxdir(addPath(binary_dir.absFilename(),
+ relative_lyxdir));
searched_dirs.push_back(lyxdir);
if (!fileSearch(lyxdir.absFilename(), chkconfig_ltx).empty()) {
// Everything has failed :-(
// So inform the user and exit.
string searched_dirs_str;
- typedef std::list<FileName>::const_iterator iterator;
+ typedef list<FileName>::const_iterator iterator;
iterator const begin = searched_dirs.begin();
iterator const end = searched_dirs.end();
for (iterator it = begin; it != end; ++it) {