getting rid of superfluous lyx::support:: statements.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22106 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-12-12 19:57:42 +00:00
parent 430a2c1adb
commit 7c392af6ea
57 changed files with 208 additions and 227 deletions

View File

@ -1253,7 +1253,7 @@ int Buffer::runChktex()
string const name = addName(path.absFilename(), latexName());
string const org_path = filePath();
support::PathChanger p(path); // path to LaTeX file
PathChanger p(path); // path to LaTeX file
message(_("Running chktex..."));
// Generate the LaTeX file if neccessary
@ -1942,7 +1942,7 @@ void Buffer::setGuiDelegate(frontend::GuiBufferDelegate * gui)
namespace {
class AutoSaveBuffer : public support::ForkedProcess {
class AutoSaveBuffer : public ForkedProcess {
public:
///
AutoSaveBuffer(Buffer const & buffer, FileName const & fname)
@ -2149,7 +2149,7 @@ bool Buffer::doExport(string const & format, bool put_in_tempdir,
if (!makeLaTeXFile(FileName(filename), string(), runparams))
return false;
} else if (!lyxrc.tex_allows_spaces
&& support::contains(filePath(), ' ')) {
&& contains(filePath(), ' ')) {
Alert::error(_("File name error"),
_("The directory path to the document cannot contain spaces."));
return false;

View File

@ -287,7 +287,7 @@ bool Converters::convert(Buffer const * buffer,
formats.extension(from_format);
string const to_ext = formats.extension(to_format);
string const command =
support::os::python() + ' ' +
os::python() + ' ' +
quoteName(libFileSearch("scripts", "convertDefault.py").toFilesystemEncoding()) +
' ' +
quoteName(from_ext + ':' + from_file.toFilesystemEncoding()) +
@ -325,7 +325,7 @@ bool Converters::convert(Buffer const * buffer,
string const path(onlyPath(from_file.absFilename()));
// Prevent the compiler from optimizing away p
FileName pp(path);
support::PathChanger p(pp);
PathChanger p(pp);
// empty the error list before any new conversion takes place.
errorList.clear();

View File

@ -169,7 +169,7 @@ void ConverterCache::Impl::writeIndex()
FileName const index(addName(cache_dir.absFilename(), "index"));
ofstream os(index.toFilesystemEncoding().c_str());
os.close();
if (!lyx::support::chmod(index, 0600))
if (!chmod(index, 0600))
return;
os.open(index.toFilesystemEncoding().c_str());
CacheType::iterator it1 = cache.begin();
@ -238,7 +238,7 @@ void ConverterCache::init()
return;
// We do this here and not in the constructor because package() gets
// initialized after all static variables.
cache_dir = FileName(addName(support::package().user_support().absFilename(), "cache"));
cache_dir = FileName(addName(package().user_support().absFilename(), "cache"));
if (!cache_dir.exists())
if (support::mkdir(cache_dir, 0700) != 0) {
lyxerr << "Could not create cache directory `"
@ -260,10 +260,10 @@ void ConverterCache::add(FileName const & orig_from, string const & to_format,
// FIXME: Should not hardcode this (see bug 3819 for details)
if (to_format == "pstex") {
FileName const converted_eps(support::changeExtension(converted_file.absFilename(), "eps"));
FileName const converted_eps(changeExtension(converted_file.absFilename(), "eps"));
add(orig_from, "eps", converted_eps);
} else if (to_format == "pdftex") {
FileName const converted_pdf(support::changeExtension(converted_file.absFilename(), "pdf"));
FileName const converted_pdf(changeExtension(converted_file.absFilename(), "pdf"));
add(orig_from, "pdf", converted_pdf);
}
@ -289,7 +289,7 @@ void ConverterCache::add(FileName const & orig_from, string const & to_format,
}
item->checksum = checksum;
if (!mover.copy(converted_file, item->cache_name,
support::onlyFilename(item->cache_name.absFilename()), 0600)) {
onlyFilename(item->cache_name.absFilename()), 0600)) {
LYXERR(Debug::FILES, "ConverterCache::add(" << orig_from << "):\n"
"Could not copy file.");
}
@ -297,7 +297,7 @@ void ConverterCache::add(FileName const & orig_from, string const & to_format,
CacheItem new_item(orig_from, to_format, timestamp,
orig_from.checksum());
if (mover.copy(converted_file, new_item.cache_name,
support::onlyFilename(new_item.cache_name.absFilename()), 0600)) {
onlyFilename(new_item.cache_name.absFilename()), 0600)) {
FormatCache & format_cache = pimpl_->cache[orig_from];
if (format_cache.from_format.empty())
format_cache.from_format =
@ -417,11 +417,11 @@ bool ConverterCache::copy(FileName const & orig_from, string const & to_format,
// FIXME: Should not hardcode this (see bug 3819 for details)
if (to_format == "pstex") {
FileName const dest_eps(support::changeExtension(dest.absFilename(), "eps"));
FileName const dest_eps(changeExtension(dest.absFilename(), "eps"));
if (!copy(orig_from, "eps", dest_eps))
return false;
} else if (to_format == "pdftex") {
FileName const dest_pdf(support::changeExtension(dest.absFilename(), "pdf"));
FileName const dest_pdf(changeExtension(dest.absFilename(), "pdf"));
if (!copy(orig_from, "pdf", dest_pdf))
return false;
}
@ -430,7 +430,7 @@ bool ConverterCache::copy(FileName const & orig_from, string const & to_format,
BOOST_ASSERT(item);
Mover const & mover = getMover(to_format);
return mover.copy(item->cache_name, dest,
support::onlyFilename(dest.absFilename()));
onlyFilename(dest.absFilename()));
}
} // namespace lyx

View File

@ -485,7 +485,7 @@ void Encodings::read(FileName const & encfile, FileName const & symbolsfile)
info.force = false;
while (!flags.empty()) {
string flag;
flags = support::split(flags, flag, ',');
flags = split(flags, flag, ',');
if (flag == "combining")
info.combining = true;
else if (flag == "force")

View File

@ -129,7 +129,7 @@ string Formats::getFormatFromFile(FileName const & filename) const
return format;
// try to find a format from the file extension.
string const ext = support::getExtension(filename.absFilename());
string const ext = getExtension(filename.absFilename());
if (!ext.empty()) {
// this is ambigous if two formats have the same extension,
// but better than nothing

View File

@ -63,7 +63,7 @@ public:
///
void popTable();
///
bool setFile(support::FileName const & filename);
bool setFile(FileName const & filename);
///
void setStream(istream & i);
///
@ -669,7 +669,7 @@ void Lexer::printError(string const & message) const
}
bool Lexer::setFile(support::FileName const & filename)
bool Lexer::setFile(FileName const & filename)
{
return pimpl_->setFile(filename);
}

View File

@ -110,7 +110,7 @@ void reconfigureUserLyXDir()
string const configure_command = package().configure_command();
lyxerr << to_utf8(_("LyX: reconfiguring user directory")) << endl;
support::PathChanger p(package().user_support());
PathChanger p(package().user_support());
Systemcall one;
one.startscript(Systemcall::Wait, configure_command);
lyxerr << "LyX: " << to_utf8(_("Done!")) << endl;
@ -351,14 +351,14 @@ int LyX::exec(int & argc, char * argv[])
easyParse(argc, argv);
try {
support::init_package(to_utf8(from_local8bit(argv[0])),
init_package(to_utf8(from_local8bit(argv[0])),
cl_system_support, cl_user_support,
support::top_build_dir_is_one_level_up);
} catch (support::ExceptionMessage const & message) {
if (message.type_ == support::ErrorException) {
top_build_dir_is_one_level_up);
} catch (ExceptionMessage const & message) {
if (message.type_ == ErrorException) {
Alert::error(message.title_, message.details_);
exit(1);
} else if (message.type_ == support::WarningException) {
} else if (message.type_ == WarningException) {
Alert::warning(message.title_, message.details_);
}
}
@ -510,7 +510,7 @@ int LyX::init(int & argc, char * argv[])
// the filename if necessary
pimpl_->files_to_load_.push_back(fileSearch(string(),
os::internal_path(to_utf8(from_local8bit(argv[argi]))),
"lyx", support::allow_unreadable));
"lyx", allow_unreadable));
}
if (first_start)

View File

@ -185,7 +185,7 @@ void reconfigure(LyXView & lv, string const & option)
lv.message(_("Running configure..."));
// Run configure in user lyx directory
support::PathChanger p(package().user_support());
PathChanger p(package().user_support());
string configure_command = package().configure_command();
configure_command += option;
Systemcall one;
@ -193,7 +193,7 @@ void reconfigure(LyXView & lv, string const & option)
p.pop();
// emit message signal.
lv.message(_("Reloading configuration..."));
lyxrc.read(support::libFileSearch(string(), "lyxrc.defaults"));
lyxrc.read(libFileSearch(string(), "lyxrc.defaults"));
// Re-read packages.lst
LaTeXFeatures::getAvailable();
@ -1011,7 +1011,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
string const path = buffer->temppath();
// Prevent the compiler from optimizing away p
FileName pp(path);
support::PathChanger p(pp);
PathChanger p(pp);
// there are three cases here:
// 1. we print to a file
@ -2170,7 +2170,7 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
if (lyxrc_orig.document_path != lyxrc_new.document_path) {
FileName path(lyxrc_new.document_path);
if (path.exists() && path.isDirectory())
support::package().document_dir() = FileName(lyxrc.document_path);
package().document_dir() = FileName(lyxrc.document_path);
}
case LyXRC::RC_ESC_CHARS:
case LyXRC::RC_EXAMPLEPATH:
@ -2195,7 +2195,7 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
case LyXRC::RC_NUMLASTFILES:
case LyXRC::RC_PATH_PREFIX:
if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
support::prependEnvPath("PATH", lyxrc.path_prefix);
prependEnvPath("PATH", lyxrc.path_prefix);
}
case LyXRC::RC_PERS_DICT:
case LyXRC::RC_PREVIEW:
@ -2240,7 +2240,7 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
case LyXRC::RC_TEX_ALLOWS_SPACES:
case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
support::os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
}
case LyXRC::RC_UIFILE:
case LyXRC::RC_USER_EMAIL:

View File

@ -1061,7 +1061,7 @@ int LyXRC::read(Lexer & lexrc)
int flgs = Format::none;
while (!flags.empty()) {
string flag;
flags = support::split(flags, flag, ',');
flags = split(flags, flag, ',');
if (flag == "document")
flgs |= Format::document;
else if (flag == "vector")
@ -2220,7 +2220,7 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
flags.push_back("document");
if (cit->vectorFormat())
flags.push_back("vector");
os << support::getStringFromVector(flags);
os << getStringFromVector(flags);
os << "\"\n";
}
}

View File

@ -46,7 +46,7 @@ public:
//Much of this is borrowed from TextClassList::read()
bool ModuleList::load()
{
support::FileName const real_file = libFileSearch("", "lyxmodules.lst");
FileName const real_file = libFileSearch("", "lyxmodules.lst");
LYXERR(Debug::TCLASS, "Reading modules from `" << real_file << '\'');
if (real_file.empty()) {
@ -102,7 +102,7 @@ bool ModuleList::load()
vector<string> pkgs;
while (!packages.empty()) {
string p;
packages = support::split(packages, p, ',');
packages = split(packages, p, ',');
pkgs.push_back(p);
}
// This code is run when we have

View File

@ -26,35 +26,35 @@ using namespace lyx::support;
namespace lyx {
bool Mover::copy(support::FileName const & from, support::FileName const & to,
bool Mover::copy(FileName const & from, FileName const & to,
unsigned long int mode) const
{
return do_copy(from, to, to.absFilename(), mode);
}
bool Mover::do_copy(support::FileName const & from, support::FileName const & to,
bool Mover::do_copy(FileName const & from, FileName const & to,
string const &, unsigned long int mode) const
{
return support::copy(from, to, mode);
return copy(from, to, mode);
}
bool Mover::rename(support::FileName const & from,
support::FileName const & to) const
bool Mover::rename(FileName const & from,
FileName const & to) const
{
return do_rename(from, to, to.absFilename());
}
bool Mover::do_rename(support::FileName const & from, support::FileName const & to,
bool Mover::do_rename(FileName const & from, FileName const & to,
string const &) const
{
return support::rename(from, to);
return rename(from, to);
}
bool SpecialisedMover::do_copy(support::FileName const & from, support::FileName const & to,
bool SpecialisedMover::do_copy(FileName const & from, FileName const & to,
string const & latex, unsigned long int mode) const
{
if (command_.empty())
@ -65,21 +65,21 @@ bool SpecialisedMover::do_copy(support::FileName const & from, support::FileName
if (!ofs)
return false;
ofs.close();
if (!support::chmod(to, mode))
if (!chmod(to, mode))
return false;
}
string command = support::libScriptSearch(command_);
command = support::subst(command, "$$i", quoteName(from.toFilesystemEncoding()));
command = support::subst(command, "$$o", quoteName(to.toFilesystemEncoding()));
command = support::subst(command, "$$l", quoteName(latex));
string command = libScriptSearch(command_);
command = subst(command, "$$i", quoteName(from.toFilesystemEncoding()));
command = subst(command, "$$o", quoteName(to.toFilesystemEncoding()));
command = subst(command, "$$l", quoteName(latex));
support::Systemcall one;
return one.startscript(support::Systemcall::Wait, command) == 0;
Systemcall one;
return one.startscript(Systemcall::Wait, command) == 0;
}
bool SpecialisedMover::do_rename(support::FileName const & from, support::FileName const & to,
bool SpecialisedMover::do_rename(FileName const & from, FileName const & to,
string const & latex) const
{
if (command_.empty())

View File

@ -1519,7 +1519,7 @@ void Paragraph::setLabelWidthString(docstring const & s)
docstring const Paragraph::translateIfPossible(docstring const & s,
BufferParams const & bparams) const
{
if (!support::isAscii(s) || s.empty()) {
if (!isAscii(s) || s.empty()) {
// This must be a user defined layout. We cannot translate
// this, since gettext accepts only ascii keys.
return s;

View File

@ -229,7 +229,7 @@ void ParagraphParameters::read(Lexer & lex, bool merge)
}
} else if (token == "\\align") {
lex.next();
int tmpret = support::findToken(string_align, lex.getString());
int tmpret = findToken(string_align, lex.getString());
if (tmpret == -1)
++tmpret;
align(LyXAlignment(1 << tmpret));

View File

@ -37,18 +37,19 @@
# include <io.h>
#endif
using boost::shared_ptr;
using namespace std;
using namespace lyx::support;
using boost::shared_ptr;
namespace lyx {
// Address is the unix address for the socket.
// MAX_CLIENTS is the maximum number of clients
// that can connect at the same time.
ServerSocket::ServerSocket(LyXFunc * f, support::FileName const & addr)
ServerSocket::ServerSocket(LyXFunc * f, FileName const & addr)
: func(f),
fd_(support::socktools::listen(addr, 3)),
fd_(socktools::listen(addr, 3)),
address_(addr)
{
if (fd_ == -1) {
@ -58,9 +59,9 @@ ServerSocket::ServerSocket(LyXFunc * f, support::FileName const & addr)
// These env vars are used by DVI inverse search
// Needed by xdvi
support::setEnv("XEDITOR", "lyxclient -g %f %l");
setEnv("XEDITOR", "lyxclient -g %f %l");
// Needed by lyxclient
support::setEnv("LYXSOCKET", address_.absFilename());
setEnv("LYXSOCKET", address_.absFilename());
theApp()->registerSocketCallback(
fd_,
@ -97,7 +98,7 @@ string const ServerSocket::address() const
// is OK and if the number of clients does not exceed MAX_CLIENTS
void ServerSocket::serverCallback()
{
int const client_fd = support::socktools::accept(fd_);
int const client_fd = socktools::accept(fd_);
if (fd_ == -1) {
LYXERR(Debug::LYXSERVER, "lyx: Failed to accept new client");

View File

@ -22,6 +22,7 @@
#include <iterator>
using namespace std;
using namespace lyx::support;
namespace {
@ -37,10 +38,6 @@ string const sec_toolbars = "[toolbars]";
namespace lyx {
using support::absolutePath;
using support::addName;
using support::FileName;
using support::package;
LastFilesSection::LastFilesSection(unsigned int num) :
default_num_last_files(4),

View File

@ -191,7 +191,7 @@ static bool doInsertInset(Cursor & cur, Text * text,
cur.recordUndo();
if (cmd.action == LFUN_INDEX_INSERT) {
docstring ds = support::subst(text->getStringToIndex(cur), '\n', ' ');
docstring ds = subst(text->getStringToIndex(cur), '\n', ' ');
text->insertInset(cur, inset);
if (edit)
inset->edit(cur, true);
@ -1028,8 +1028,8 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
if (cmd.argument().empty())
break;
docstring hexstring = cmd.argument();
if (lyx::support::isHex(hexstring)) {
char_type c = lyx::support::hexToInt(hexstring);
if (isHex(hexstring)) {
char_type c = hexToInt(hexstring);
if (c >= 32 && c < 0x10ffff) {
lyxerr << "Inserting c: " << c << endl;
docstring s = docstring(1, c);

View File

@ -69,15 +69,15 @@ bool layout2layout(FileName const & filename, FileName const & tempfile)
}
ostringstream command;
command << support::os::python() << ' ' << quoteName(script.toFilesystemEncoding())
command << os::python() << ' ' << quoteName(script.toFilesystemEncoding())
<< ' ' << quoteName(filename.toFilesystemEncoding())
<< ' ' << quoteName(tempfile.toFilesystemEncoding());
string const command_str = command.str();
LYXERR(Debug::TCLASS, "Running `" << command_str << '\'');
support::cmd_ret const ret =
support::runCommand(command_str);
cmd_ret const ret =
runCommand(command_str);
if (ret.first != 0) {
lyxerr << "Could not run layout conversion "
"script layout2layout.py." << endl;
@ -433,7 +433,7 @@ bool TextClass::read(FileName const & filename, ReadType rt)
if (format != FORMAT) {
LYXERR(Debug::TCLASS, "Converting layout file from format "
<< format << " to " << FORMAT);
FileName const tempfile(support::tempName());
FileName const tempfile(tempName());
error = !layout2layout(filename, tempfile);
if (!error)
error = read(tempfile, rt);

View File

@ -84,7 +84,7 @@ public:
bool TextClassList::read()
{
Lexer lex(0, 0);
support::FileName const real_file = libFileSearch("", "textclass.lst");
FileName const real_file = libFileSearch("", "textclass.lst");
LYXERR(Debug::TCLASS, "Reading textclasses from `" << real_file << '\'');
if (real_file.empty()) {

View File

@ -386,7 +386,7 @@ docstring const Trans::process(char_type c, TransManager & k)
int Trans::load(string const & language)
{
support::FileName const filename = libFileSearch("kbd", language, "kmap");
FileName const filename = libFileSearch("kbd", language, "kmap");
if (filename.empty())
return -1;

View File

@ -248,7 +248,7 @@ private:
LyXDataSocket::LyXDataSocket(FileName const & address)
{
if ((fd_ = support::socktools::connect(address)) == -1) {
if ((fd_ = socktools::connect(address)) == -1) {
connected_ = false;
} else {
connected_ = true;
@ -421,7 +421,7 @@ int h(vector<docstring> const &)
docstring clientName =
from_ascii(support::itoa(::getppid()) + ">" + support::itoa(::getpid()));
from_ascii(itoa(::getppid()) + ">" + itoa(::getpid()));
int n(vector<docstring> const & arg)
{
@ -553,7 +553,7 @@ int main(int argc, char * argv[])
} else {
// We have to look for an address.
// serverPid can be empty.
vector<fs::path> addrs = support::lyxSockets(to_filesystem8bit(cmdline::mainTmp), cmdline::serverPid);
vector<fs::path> addrs = lyxSockets(to_filesystem8bit(cmdline::mainTmp), cmdline::serverPid);
vector<fs::path>::const_iterator addr = addrs.begin();
vector<fs::path>::const_iterator end = addrs.end();
for (; addr != end; ++addr) {

View File

@ -146,7 +146,7 @@ LyXErr & operator<<(LyXErr & l, string const & t)
{ l.stream() << t; return l; }
LyXErr & operator<<(LyXErr & l, docstring const & t)
{ l.stream() << to_utf8(t); return l; }
LyXErr & operator<<(LyXErr & l, support::FileName const & t)
LyXErr & operator<<(LyXErr & l, FileName const & t)
{ l.stream() << t; return l; }
LyXErr & operator<<(LyXErr & l, ostream &(*t)(ostream &))
{ l.stream() << t; return l; }

View File

@ -68,6 +68,7 @@
#include <sstream>
using namespace std;
using namespace lyx::support;
namespace lyx {
@ -358,12 +359,12 @@ Inset * createInset(Buffer & buf, FuncRequest const & cmd)
break;
}
} catch (support::ExceptionMessage const & message) {
if (message.type_ == support::ErrorException) {
} catch (ExceptionMessage const & message) {
if (message.type_ == ErrorException) {
Alert::error(message.title_, message.details_);
LyX::cref().emergencyCleanup();
abort();
} else if (message.type_ == support::WarningException) {
} else if (message.type_ == WarningException) {
Alert::warning(message.title_, message.details_);
return 0;
}

View File

@ -72,6 +72,7 @@
#include <exception>
using namespace std;
using namespace lyx::support;
namespace lyx {
@ -127,8 +128,6 @@ public:
///////////////////////////////////////////////////////////////
using support::FileName;
GuiApplication * guiApp;
@ -434,12 +433,12 @@ bool GuiApplication::notify(QObject * receiver, QEvent * event)
try {
return QApplication::notify(receiver, event);
}
catch (support::ExceptionMessage const & e) {
if (e.type_ == support::ErrorException) {
catch (ExceptionMessage const & e) {
if (e.type_ == ErrorException) {
Alert::error(e.title_, e.details_);
LyX::cref().emergencyCleanup();
QApplication::exit(1);
} else if (e.type_ == support::WarningException) {
} else if (e.type_ == WarningException) {
Alert::warning(e.title_, e.details_);
return false;
}
@ -483,7 +482,7 @@ bool GuiApplication::getRgbColor(ColorCode col, RGBColor & rgbcol)
string const GuiApplication::hexName(ColorCode col)
{
return support::ltrim(fromqstr(color_cache_.get(col).name()), "#");
return ltrim(fromqstr(color_cache_.get(col).name()), "#");
}

View File

@ -41,6 +41,7 @@
#include <vector>
using namespace std;
using namespace lyx::support;
namespace lyx {
namespace frontend {
@ -682,7 +683,7 @@ vector<docstring> GuiCitation::searchKeys(
{
vector<docstring> foundKeys;
docstring expr = support::trim(search_expression);
docstring expr = trim(search_expression);
if (expr.empty())
return foundKeys;

View File

@ -56,6 +56,7 @@
#include <sstream>
using namespace std;
using namespace lyx::support;
///
template<class Pair>
@ -133,11 +134,6 @@ vector<pair<string, lyx::docstring> > pagestyles;
namespace lyx {
namespace frontend {
using support::token;
using support::bformat;
using support::findToken;
using support::getVectorFromString;
/////////////////////////////////////////////////////////////////////
//
// PreambleModule

View File

@ -28,6 +28,7 @@
#include <QFontDatabase>
using namespace std;
using namespace lyx::support;
QString const math_fonts[] = {"cmex10", "cmmi10", "cmr10", "cmsy10",
"eufm10", "msam10", "msbm10", "wasy10", "esint10"};
@ -36,11 +37,6 @@ int const num_math_fonts = sizeof(math_fonts) / sizeof(*math_fonts);
namespace lyx {
using support::contains;
using support::package;
using support::addPath;
using support::addName;
extern docstring const stateText(FontInfo const & f);
namespace frontend {

View File

@ -125,7 +125,7 @@ unsigned int GuiImage::height() const
}
void GuiImage::load(support::FileName const & filename)
void GuiImage::load(FileName const & filename)
{
if (!original_.isNull()) {
LYXERR(Debug::GRAPHICS, "Image is loaded already!");

View File

@ -167,7 +167,7 @@ void GuiPrint::applyView()
params_ = PrinterParams(t,
fromqstr(printerED->text()),
support::os::internal_path(fromqstr(fileED->text())),
os::internal_path(fromqstr(fileED->text())),
allRB->isChecked(),
fromED->text().toUInt(),
toED->text().toUInt(),
@ -183,7 +183,7 @@ void GuiPrint::applyView()
bool GuiPrint::initialiseParams(string const &)
{
/// get global printer parameters
string const name = support::changeExtension(buffer().absFileName(),
string const name = changeExtension(buffer().absFileName(),
lyxrc.print_file_extension);
params_ = PrinterParams(PrinterParams::PRINTER, lyxrc.printer, name);

View File

@ -21,12 +21,11 @@
#include <QCloseEvent>
using namespace std;
using namespace lyx::support;
namespace lyx {
namespace frontend {
using support::FileName;
using support::onlyFilename;
GuiShowFile::GuiShowFile(GuiView & lv)
: GuiDialog(lv, "file")

View File

@ -176,7 +176,7 @@ void GuiTexInfo::updateStyles(TexFileType type)
vector<string>::iterator it1 = data.begin();
vector<string>::iterator end1 = data.end();
for (; it1 != end1; ++it1)
*it1 = support::onlyFilename(*it1);
*it1 = onlyFilename(*it1);
// sort on filename only (no path)
sort(data.begin(), data.end());

View File

@ -51,6 +51,7 @@
#include <boost/assert.hpp>
using namespace std;
using namespace lyx::support;
static void initializeResources()
{
@ -65,11 +66,6 @@ static void initializeResources()
namespace lyx {
namespace frontend {
using support::libFileSearch;
using support::subst;
using support::compare;
namespace {
struct PngMap {

View File

@ -451,7 +451,7 @@ void GuiView::dropEvent(QDropEvent* event)
LYXERR(Debug::GUI, "GuiView::dropEvent: got URLs!");
for (int i = 0; i != files.size(); ++i) {
string const file = support::os::internal_path(fromqstr(
string const file = os::internal_path(fromqstr(
files.at(i).toLocalFile()));
if (!file.empty())
lyx::dispatch(FuncRequest(LFUN_FILE_OPEN, file));
@ -1176,10 +1176,10 @@ bool GuiView::renameBuffer(Buffer & b, docstring const & newname)
dlg.setButton1(_("Documents|#o#O"), from_utf8(lyxrc.document_path));
dlg.setButton2(_("Templates|#T#t"), from_utf8(lyxrc.template_path));
if (!support::isLyXFilename(fname.absFilename()))
if (!isLyXFilename(fname.absFilename()))
fname.changeExtension(".lyx");
support::FileFilterList const filter(_("LyX Documents (*.lyx)"));
FileFilterList const filter(_("LyX Documents (*.lyx)"));
FileDialog::Result result =
dlg.save(from_utf8(fname.onlyPath().absFilename()),
@ -1194,7 +1194,7 @@ bool GuiView::renameBuffer(Buffer & b, docstring const & newname)
if (fname.empty())
return false;
if (!support::isLyXFilename(fname.absFilename()))
if (!isLyXFilename(fname.absFilename()))
fname.changeExtension(".lyx");
}

View File

@ -452,7 +452,7 @@ void GuiWorkArea::toggleCursor()
// Use this opportunity to deal with any child processes that
// have finished but are waiting to communicate this fact
// to the rest of LyX.
support::ForkedCallsController::handleCompletedProcesses();
ForkedCallsController::handleCompletedProcesses();
}

View File

@ -306,11 +306,11 @@ docstring browseDir(docstring const & pathname, docstring const & title,
void rescanTexStyles()
{
// Run rescan in user lyx directory
support::PathChanger p(package().user_support());
PathChanger p(package().user_support());
FileName const command = libFileSearch("scripts", "TeXFiles.py");
Systemcall one;
int const status = one.startscript(Systemcall::Wait,
support::os::python() + ' ' +
os::python() + ' ' +
quoteName(command.toFilesystemEncoding()));
if (status == 0)
return;

View File

@ -159,7 +159,7 @@ Converter::Impl::Impl(FileName const & from_file, string const & to_file_base,
// We create a dummy command for ease of understanding of the
// list of forked processes.
// Note: 'python ' is absolutely essential, or execvp will fail.
script_command_ = support::os::python() + ' ' +
script_command_ = os::python() + ' ' +
quoteName(script_file_.toFilesystemEncoding()) + ' ' +
quoteName(onlyFilename(from_file.toFilesystemEncoding())) + ' ' +
quoteName(to_format);
@ -176,7 +176,7 @@ void Converter::Impl::startConversion()
}
ForkedCall::SignalTypePtr ptr =
support::ForkedCallQueue::add(script_command_);
ForkedCallQueue::add(script_command_);
ptr->connect(boost::bind(&Impl::converted, this, _1, _2));
}
@ -325,7 +325,7 @@ static void build_script(FileName const & from_file,
<< quoteName(to_file, quote_python) << ")\n";
ostringstream os;
os << support::os::python() << ' '
os << os::python() << ' '
<< libScriptSearch("$$s/scripts/convertDefault.py",
quote_python) << ' ';
if (!from_format.empty())

View File

@ -63,7 +63,7 @@ string const unique_filename(string const & bufferpath)
{
static int theCounter = 0;
string const filename = lyx::convert<string>(theCounter++) + "lyxpreview";
return lyx::support::addName(bufferpath, filename);
return addName(bufferpath, filename);
}
@ -369,7 +369,7 @@ InProgress::InProgress(string const & filename_base,
void InProgress::stop() const
{
if (pid)
lyx::support::ForkedCallsController::kill(pid, 0);
ForkedCallsController::kill(pid, 0);
if (!metrics_file.empty())
metrics_file.removeFile();
@ -469,7 +469,7 @@ void PreviewLoader::Impl::add(string const & latex_snippet)
if (!pconverter_ || status(latex_snippet) != NotFound)
return;
string const snippet = support::trim(latex_snippet);
string const snippet = trim(latex_snippet);
if (snippet.empty())
return;
@ -584,19 +584,19 @@ void PreviewLoader::Impl::startLoading()
// The conversion command.
ostringstream cs;
cs << pconverter_->command << ' ' << pconverter_->to << ' '
<< support::quoteName(latexfile.toFilesystemEncoding()) << ' '
<< quoteName(latexfile.toFilesystemEncoding()) << ' '
<< int(font_scaling_factor_) << ' '
<< theApp()->hexName(Color_preview) << ' '
<< theApp()->hexName(Color_background);
string const command = support::libScriptSearch(cs.str());
string const command = libScriptSearch(cs.str());
// Initiate the conversion from LaTeX to bitmap images files.
support::ForkedCall::SignalTypePtr
convert_ptr(new support::ForkedCall::SignalType);
ForkedCall::SignalTypePtr
convert_ptr(new ForkedCall::SignalType);
convert_ptr->connect(bind(&Impl::finishedGenerating, this, _1, _2));
support::ForkedCall call;
ForkedCall call;
int ret = call.startScript(command, convert_ptr);
if (ret != 0) {

View File

@ -62,8 +62,8 @@ string const subst_path(string const & input,
string const & placeholder,
string const & path,
bool use_latex_path,
support::latex_path_extension ext = support::PROTECT_EXTENSION,
support::latex_path_dots dots = support::LEAVE_DOTS)
latex_path_extension ext = PROTECT_EXTENSION,
latex_path_dots dots = LEAVE_DOTS)
{
if (input.find(placeholder) == string::npos)
return input;
@ -71,8 +71,8 @@ string const subst_path(string const & input,
// path will be compared with another one in internal style later
// in Converters::move.
string const path2 = use_latex_path ?
support::latex_path(path, ext, dots) : path;
return support::subst(input, placeholder, path2);
latex_path(path, ext, dots) : path;
return subst(input, placeholder, path2);
}
} // namespace anon
@ -91,64 +91,64 @@ string const doSubstitution(InsetExternalParams const & params,
string const filename = external_in_tmpdir ?
params.filename.mangledFilename() :
params.filename.outputFilename(parentpath);
string const basename = support::changeExtension(
support::onlyFilename(filename), string());
string const absname = support::makeAbsPath(filename, parentpath).absFilename();
string const basename = changeExtension(
onlyFilename(filename), string());
string const absname = makeAbsPath(filename, parentpath).absFilename();
string result = s;
if (what != ALL_BUT_PATHS) {
string const filepath = support::onlyPath(filename);
string const abspath = support::onlyPath(absname);
string const filepath = onlyPath(filename);
string const abspath = onlyPath(absname);
string const masterpath = external_in_tmpdir ?
masterBuffer->temppath() :
masterBuffer->filePath();
// FIXME UNICODE
string relToMasterPath = support::onlyPath(
to_utf8(support::makeRelPath(from_utf8(absname),
string relToMasterPath = onlyPath(
to_utf8(makeRelPath(from_utf8(absname),
from_utf8(masterpath))));
if (relToMasterPath == "./")
relToMasterPath.clear();
// FIXME UNICODE
string relToParentPath = support::onlyPath(
to_utf8(support::makeRelPath(from_utf8(absname),
string relToParentPath = onlyPath(
to_utf8(makeRelPath(from_utf8(absname),
from_utf8(parentpath))));
if (relToParentPath == "./")
relToParentPath.clear();
result = subst_path(result, "$$FPath", filepath,
use_latex_path,
support::PROTECT_EXTENSION,
support::ESCAPE_DOTS);
PROTECT_EXTENSION,
ESCAPE_DOTS);
result = subst_path(result, "$$AbsPath", abspath,
use_latex_path,
support::PROTECT_EXTENSION,
support::ESCAPE_DOTS);
PROTECT_EXTENSION,
ESCAPE_DOTS);
result = subst_path(result, "$$RelPathMaster",
relToMasterPath, use_latex_path,
support::PROTECT_EXTENSION,
support::ESCAPE_DOTS);
PROTECT_EXTENSION,
ESCAPE_DOTS);
result = subst_path(result, "$$RelPathParent",
relToParentPath, use_latex_path,
support::PROTECT_EXTENSION,
support::ESCAPE_DOTS);
if (support::absolutePath(filename)) {
PROTECT_EXTENSION,
ESCAPE_DOTS);
if (absolutePath(filename)) {
result = subst_path(result, "$$AbsOrRelPathMaster",
abspath, use_latex_path,
support::PROTECT_EXTENSION,
support::ESCAPE_DOTS);
PROTECT_EXTENSION,
ESCAPE_DOTS);
result = subst_path(result, "$$AbsOrRelPathParent",
abspath, use_latex_path,
support::PROTECT_EXTENSION,
support::ESCAPE_DOTS);
PROTECT_EXTENSION,
ESCAPE_DOTS);
} else {
result = subst_path(result, "$$AbsOrRelPathMaster",
relToMasterPath, use_latex_path,
support::PROTECT_EXTENSION,
support::ESCAPE_DOTS);
PROTECT_EXTENSION,
ESCAPE_DOTS);
result = subst_path(result, "$$AbsOrRelPathParent",
relToParentPath, use_latex_path,
support::PROTECT_EXTENSION,
support::ESCAPE_DOTS);
PROTECT_EXTENSION,
ESCAPE_DOTS);
}
}
@ -156,17 +156,17 @@ string const doSubstitution(InsetExternalParams const & params,
return result;
result = subst_path(result, "$$FName", filename, use_latex_path,
support::EXCLUDE_EXTENSION);
EXCLUDE_EXTENSION);
result = subst_path(result, "$$Basename", basename, use_latex_path,
support::PROTECT_EXTENSION, support::ESCAPE_DOTS);
PROTECT_EXTENSION, ESCAPE_DOTS);
result = subst_path(result, "$$Extension",
'.' + support::getExtension(filename), use_latex_path);
'.' + getExtension(filename), use_latex_path);
result = subst_path(result, "$$Tempname", params.tempname().absFilename(), use_latex_path);
result = subst_path(result, "$$Sysdir",
support::package().system_support().absFilename(), use_latex_path);
package().system_support().absFilename(), use_latex_path);
// Handle the $$Contents(filename) syntax
if (support::contains(result, "$$Contents(\"")) {
if (contains(result, "$$Contents(\"")) {
// Since use_latex_path may be true we must extract the file
// name from s instead of result and do the substitutions
// again, this time with use_latex_path false.
@ -179,7 +179,7 @@ string const doSubstitution(InsetExternalParams const & params,
string contents;
FileName const absfile(
support::makeAbsPath(file, masterBuffer->temppath()));
makeAbsPath(file, masterBuffer->temppath()));
if (absfile.isReadableFile())
// FIXME UNICODE
contents = to_utf8(absfile.fileContents("UTF-8"));
@ -247,7 +247,7 @@ void updateExternal(InsetExternalParams const & params,
// We copy the source file to the temp dir and do the conversion
// there if necessary
FileName const temp_file(
support::makeAbsPath(params.filename.mangledFilename(),
makeAbsPath(params.filename.mangledFilename(),
masterBuffer->temppath()));
if (!params.filename.empty() && !params.filename.isDirectory()) {
unsigned long const from_checksum = params.filename.checksum();
@ -268,7 +268,7 @@ void updateExternal(InsetExternalParams const & params,
outputFormat.updateResult,
false, true);
FileName const abs_to_file(
support::makeAbsPath(to_file, masterBuffer->temppath()));
makeAbsPath(to_file, masterBuffer->temppath()));
if (!dryrun) {
// Record the referenced files for the exporter.
@ -280,7 +280,7 @@ void updateExternal(InsetExternalParams const & params,
vector<string>::const_iterator fit = rit->second.begin();
vector<string>::const_iterator fend = rit->second.end();
for (; fit != fend; ++fit) {
FileName const source(support::makeAbsPath(
FileName const source(makeAbsPath(
doSubstitution(params, buffer, *fit,
false, true),
masterBuffer->temppath()));
@ -288,7 +288,7 @@ void updateExternal(InsetExternalParams const & params,
// temp path, but the filename may be the mangled
// or the real name. Therefore we substitute the
// paths and names separately.
string file = support::subst(*fit, "$$FName",
string file = subst(*fit, "$$FName",
"$$FPath$$Basename$$Extension");
file = doSubstitution(params, buffer, file, false, false,
PATHS);
@ -304,7 +304,7 @@ void updateExternal(InsetExternalParams const & params,
// Do we need to perform the conversion?
// Yes if to_file does not exist or if from_file is newer than to_file
if (support::compare_timestamps(temp_file, abs_to_file) < 0)
if (compare_timestamps(temp_file, abs_to_file) < 0)
return; // SUCCESS
// FIXME (Abdel 12/08/06): Is there a need to show these errors?
@ -351,7 +351,7 @@ int writeExternal(InsetExternalParams const & params,
return 0;
}
if (!dryrun || support::contains(cit->second.product, "$$Contents"))
if (!dryrun || contains(cit->second.product, "$$Contents"))
updateExternal(params, format, buffer, exportdata,
external_in_tmpdir, dryrun);
@ -359,7 +359,7 @@ int writeExternal(InsetExternalParams const & params,
string str = doSubstitution(params, buffer, cit->second.product,
use_latex_path, external_in_tmpdir);
string const absname = support::makeAbsPath(
string const absname = makeAbsPath(
params.filename.outputFilename(buffer.filePath()), buffer.filePath()).absFilename();
if (!external_in_tmpdir && !isValidLaTeXFilename(absname)) {
@ -411,8 +411,8 @@ string const substituteIt<TransformCommand>(string const & input,
return input;
string result =
support::subst(input, ptr->front_placeholder(), ptr->front());
return support::subst(result, ptr->back_placeholder(), ptr->back());
subst(input, ptr->front_placeholder(), ptr->front());
return subst(result, ptr->back_placeholder(), ptr->back());
}
@ -449,7 +449,7 @@ string const substituteIt<TransformOption>(string const & input,
if (!ptr.get())
return input;
return support::subst(input, ptr->placeholder(), ptr->option());
return subst(input, ptr->placeholder(), ptr->option());
}
@ -519,7 +519,7 @@ string const substituteOptions(InsetExternalParams const & params,
for (; it != end; ++it) {
string const opt = substituteOption(params, it->option, format);
string const placeholder = "$$" + it->name;
output = support::subst(output, placeholder, opt);
output = subst(output, placeholder, opt);
}
return output;

View File

@ -24,6 +24,7 @@
#include <ostream>
using namespace std;
using namespace lyx::support;
namespace lyx {
namespace external {
@ -59,7 +60,7 @@ Template::Format::Format()
TemplateManager::TemplateManager()
{
readTemplates(support::package().user_support());
readTemplates(package().user_support());
if (lyxerr.debugging(Debug::EXTERNAL)) {
dumpPreambleDefs(lyxerr);
lyxerr << '\n';
@ -219,7 +220,7 @@ TemplateManager::getTemplateByName(string const & name) const
string const
TemplateManager::getPreambleDefByName(string const & name) const
{
string const trimmed_name = support::trim(name);
string const trimmed_name = trim(name);
if (trimmed_name.empty())
return string();
@ -231,9 +232,9 @@ TemplateManager::getPreambleDefByName(string const & name) const
}
void TemplateManager::readTemplates(support::FileName const & path)
void TemplateManager::readTemplates(FileName const & path)
{
support::PathChanger p(path);
PathChanger p(path);
enum TemplateTags {
TM_PREAMBLEDEF = 1,
@ -251,7 +252,7 @@ void TemplateManager::readTemplates(support::FileName const & path)
Lexer lex(templatetags, TM_TEMPLATE_END);
support::FileName const filename = support::libFileSearch("", "external_templates");
FileName const filename = libFileSearch("", "external_templates");
if (filename.empty() || !lex.setFile(filename)) {
lex.printError("external::TemplateManager::readTemplates: "
"No template file");

View File

@ -317,7 +317,7 @@ string const sanitizeLatexOption(string const & input)
output = what.str(1);
// Remove any surrounding whitespace
output = support::trim(output);
output = trim(output);
// If the thing is empty, leave it so, else wrap it in square brackets.
return output.empty() ? output : "[" + output + "]";

View File

@ -32,6 +32,7 @@
#include <ostream>
using namespace std;
using namespace lyx::support;
namespace lyx {
@ -95,7 +96,7 @@ void InsetBibitem::read(Buffer const & buf, Lexer & lex)
{
InsetCommand::read(buf, lex);
if (support::prefixIs(getParam("key"), key_prefix)) {
if (prefixIs(getParam("key"), key_prefix)) {
int const key = convert<int>(getParam("key").substr(key_prefix.length()));
key_counter = max(key_counter, key);
}

View File

@ -81,8 +81,8 @@ void InsetBibtex::doDispatch(Cursor & cur, FuncRequest & cmd)
cur.noUpdate();
break;
}
} catch (support::ExceptionMessage const & message) {
if (message.type_ == support::WarningException) {
} catch (ExceptionMessage const & message) {
if (message.type_ == WarningException) {
Alert::warning(message.title_, message.details_);
cur.noUpdate();
} else
@ -309,7 +309,7 @@ int InsetBibtex::latex(Buffer const & buffer, odocstream & os,
FileNameList const InsetBibtex::getFiles(Buffer const & buffer) const
{
FileName path(buffer.filePath());
support::PathChanger p(path);
PathChanger p(path);
FileNameList vec;

View File

@ -42,6 +42,7 @@
#include <sstream>
using namespace std;
using namespace lyx::support;
namespace lyx {
@ -101,7 +102,7 @@ void InsetCaption::cursorPos(BufferView const & bv,
void InsetCaption::setCustomLabel(docstring const & label)
{
if (!support::isAscii(label) || label.empty())
if (!isAscii(label) || label.empty())
// This must be a user defined layout. We cannot translate
// this, since gettext accepts only ascii keys.
custom_label_ = label;
@ -270,7 +271,6 @@ int InsetCaption::getOptArg(Buffer const & buf, odocstream & os,
void InsetCaption::updateLabels(Buffer const & buf, ParIterator const & it)
{
using support::bformat;
TextClass const & tclass = buf.params().getTextClass();
Counters & cnts = tclass.counters();
string const & type = cnts.current_float();

View File

@ -333,8 +333,6 @@ docstring const getNatbibLabel(Buffer const & buffer,
docstring const getBasicLabel(docstring const & keyList, docstring const & after)
{
using support::contains;
docstring keys = keyList;
docstring label;

View File

@ -65,11 +65,11 @@ namespace external {
TempName::TempName()
{
support::FileName const tempname(support::tempName(support::FileName(), "lyxext"));
FileName const tempname(tempName(FileName(), "lyxext"));
// FIXME: This is unsafe
tempname.removeFile();
// must have an extension for the converter code to work correctly.
tempname_ = support::FileName(tempname.absFilename() + ".tmp");
tempname_ = FileName(tempname.absFilename() + ".tmp");
}
@ -224,7 +224,6 @@ void InsetExternalParams::write(Buffer const & buffer, ostream & os) const
}
if (!resizedata.no_resize()) {
using support::float_equal;
double const scl = convert<double>(resizedata.scale);
if (!float_equal(scl, 0.0, 0.05)) {
if (!float_equal(scl, 100.0, 0.05))
@ -587,7 +586,7 @@ docstring const getScreenLabel(InsetExternalParams const & params,
external::getTemplatePtr(params);
if (!ptr)
// FIXME UNICODE
return support::bformat((_("External template %1$s is not installed")),
return bformat((_("External template %1$s is not installed")),
from_utf8(params.templatename()));
// FIXME UNICODE
docstring gui = _(ptr->guiName);

View File

@ -484,7 +484,7 @@ copyFileIfNeeded(FileName const & file_in, FileName const & file_out)
if (!success) {
// FIXME UNICODE
LYXERR(Debug::GRAPHICS,
to_utf8(support::bformat(_("Could not copy the file\n%1$s\n"
to_utf8(bformat(_("Could not copy the file\n%1$s\n"
"into the temporary directory."),
from_utf8(file_in.absFilename()))));
}
@ -497,11 +497,9 @@ copyFileIfNeeded(FileName const & file_in, FileName const & file_out)
pair<GraphicsCopyStatus, FileName> const
copyToDirIfNeeded(DocFileName const & file, string const & dir)
{
using support::rtrim;
string const file_in = file.absFilename();
string const only_path = support::onlyPath(file_in);
if (rtrim(support::onlyPath(file_in) , "/") == rtrim(dir, "/"))
string const only_path = onlyPath(file_in);
if (rtrim(onlyPath(file_in) , "/") == rtrim(dir, "/"))
return make_pair(IDENTICAL_PATHS, file_in);
string mangled = file.mangledFilename();
@ -516,7 +514,7 @@ copyToDirIfNeeded(DocFileName const & file, string const & dir)
string::size_type const ext_len = file_in.length() - base.length();
mangled[mangled.length() - ext_len] = '.';
}
FileName const file_out(support::makeAbsPath(mangled, dir));
FileName const file_out(makeAbsPath(mangled, dir));
return copyFileIfNeeded(file, file_out);
}
@ -535,13 +533,10 @@ string const stripExtensionIfPossible(string const & file, bool nice)
// dots with a macro whose definition is just a dot ;-)
// The automatic format selection does not work if the file
// name is escaped.
string const latex_name = latex_path(file,
support::EXCLUDE_EXTENSION);
string const latex_name = latex_path(file, EXCLUDE_EXTENSION);
if (!nice || contains(latex_name, '"'))
return latex_name;
return latex_path(removeExtension(file),
support::PROTECT_EXTENSION,
support::ESCAPE_DOTS);
return latex_path(removeExtension(file), PROTECT_EXTENSION, ESCAPE_DOTS);
}
@ -556,7 +551,7 @@ string const stripExtensionIfPossible(string const & file, string const & to, bo
(to_format == "eps" && file_format == "ps") ||
(to_format == "ps" && file_format == "eps"))
return stripExtensionIfPossible(file, nice);
return latex_path(file, support::EXCLUDE_EXTENSION);
return latex_path(file, EXCLUDE_EXTENSION);
}
} // namespace anon
@ -654,8 +649,7 @@ string const InsetGraphics::prepareFile(Buffer const & buf,
source_file, output_file);
// We can't strip the extension, because we don't know
// the unzipped file format
return latex_path(output_file,
support::EXCLUDE_EXTENSION);
return latex_path(output_file, EXCLUDE_EXTENSION);
}
FileName const unzipped_temp_file =
@ -694,7 +688,7 @@ string const InsetGraphics::prepareFile(Buffer const & buf,
// the file format from the extension, so we must
// change it.
FileName const new_file = FileName(changeExtension(temp_file.absFilename(), ext));
if (support::rename(temp_file, new_file)) {
if (rename(temp_file, new_file)) {
temp_file = new_file;
output_file = changeExtension(output_file, ext);
source_file = FileName(changeExtension(source_file.absFilename(), ext));

View File

@ -23,6 +23,7 @@
#include "support/lyxalgo.h"
using namespace std;
using namespace lyx::support;
namespace lyx {
@ -88,7 +89,7 @@ void InsetLabel::doDispatch(Cursor & cur, FuncRequest & cmd)
int InsetLabel::latex(Buffer const &, odocstream & os,
OutputParams const &) const
{
os << support::escape(getCommand());
os << escape(getCommand());
return 0;
}

View File

@ -34,11 +34,10 @@
#include <sstream>
using namespace std;
using namespace lyx::support;
namespace lyx {
using support::bformat;
namespace {
docstring verboseHLine(int n)
@ -1419,7 +1418,7 @@ bool InsetMathGrid::getStatus(Cursor & cur, FuncRequest const & cmd,
status.enable(false);
break;
}
if (!support::contains("tcb", cmd.argument()[0])) {
if (!contains("tcb", cmd.argument()[0])) {
status.enable(false);
break;
}

View File

@ -1105,7 +1105,7 @@ void InsetMathHull::doDispatch(Cursor & cur, FuncRequest & cmd)
docstring str = p["name"];
cur.recordUndoInset();
row_type const r = (type_ == hullMultline) ? nrows() - 1 : cur.row();
str = support::trim(str);
str = trim(str);
if (!str.empty())
numbered(r, true);
docstring old = label(r);

View File

@ -60,6 +60,7 @@
#include <sstream>
using namespace std;
using namespace lyx::support;
namespace lyx {
@ -922,7 +923,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
case LFUN_MATH_DELIM: {
docstring ls;
docstring rs = support::split(cmd.argument(), ls, ' ');
docstring rs = split(cmd.argument(), ls, ' ');
// Reasonable default values
if (ls.empty())
ls = '(';

View File

@ -1427,7 +1427,7 @@ MathData pipeThroughExtern(string const & lang, docstring const & extra,
string data = to_utf8(os.str());
// search external script
support::FileName const file = libFileSearch("mathed", "extern_" + lang);
FileName const file = libFileSearch("mathed", "extern_" + lang);
if (file.empty()) {
lyxerr << "converter to '" << lang << "' not found" << endl;
return MathData();

View File

@ -96,7 +96,7 @@ bool math_font_available(docstring & name)
void initSymbols()
{
support::FileName const filename = libFileSearch(string(), "symbols");
FileName const filename = libFileSearch(string(), "symbols");
LYXERR(Debug::MATHED, "read symbols from " << filename);
if (filename.empty()) {
lyxerr << "Could not find symbols file" << endl;

View File

@ -172,7 +172,7 @@ LyXErr & operator<<(LyXErr & l, string const & t)
{ if (l.enabled()) l.stream() << t; return l; }
LyXErr & operator<<(LyXErr & l, docstring const & t)
{ if (l.enabled()) l.stream() << to_utf8(t); return l; }
LyXErr & operator<<(LyXErr & l, support::FileName const & t)
LyXErr & operator<<(LyXErr & l, FileName const & t)
{ if (l.enabled()) l.stream() << t; return l; }
LyXErr & operator<<(LyXErr & l, ostream &(*t)(ostream &))
{ if (l.enabled()) l.stream() << t; return l; }

View File

@ -596,8 +596,8 @@ protected:
for (; iit != eit; ++iit) {
s += *iit;
++n;
bool true_ok = lyx::support::prefixIs(truename, s);
bool false_ok = lyx::support::prefixIs(falsename, s);
bool true_ok = prefixIs(truename, s);
bool false_ok = prefixIs(falsename, s);
if (!true_ok && !false_ok) {
++iit;
ok = false;

View File

@ -18,6 +18,7 @@
#include <iostream>
using namespace std;
using namespace lyx::support;
namespace lyx {
@ -206,7 +207,7 @@ void Context::new_paragraph(ostream & os)
void Context::add_extra_stuff(string const & stuff)
{
if (!lyx::support::contains(extra_stuff, stuff))
if (!contains(extra_stuff, stuff))
extra_stuff += stuff;
}

View File

@ -649,7 +649,7 @@ TextClass const parse_preamble(Parser & p, ostream & os, string const & forcecla
// Force textclass if the user wanted it
if (!forceclass.empty())
h_textclass = forceclass;
if (noweb_mode && !lyx::support::prefixIs(h_textclass, "literate-"))
if (noweb_mode && !prefixIs(h_textclass, "literate-"))
h_textclass.insert(0, "literate-");
FileName layoutfilename = libFileSearch("layouts", h_textclass, "layout");
if (layoutfilename.empty()) {

View File

@ -486,15 +486,15 @@ int main(int argc, char * argv[])
return 2;
}
lyx::support::os::init(argc, argv);
os::init(argc, argv);
try { support::init_package(internal_path(to_utf8(from_local8bit(argv[0]))),
try { init_package(internal_path(to_utf8(from_local8bit(argv[0]))),
cl_system_support, cl_user_support,
support::top_build_dir_is_two_levels_up);
} catch (support::ExceptionMessage const & message) {
top_build_dir_is_two_levels_up);
} catch (ExceptionMessage const & message) {
cerr << to_utf8(message.title_) << ":\n"
<< to_utf8(message.details_) << endl;
if (message.type_ == support::ErrorException)
if (message.type_ == ErrorException)
exit(1);
}
@ -511,7 +511,7 @@ int main(int argc, char * argv[])
} else
outfilename = changeExtension(infilename, ".lyx");
FileName const system_syntaxfile = lyx::support::libFileSearch("", "syntax.default");
FileName const system_syntaxfile = libFileSearch("", "syntax.default");
if (system_syntaxfile.empty()) {
cerr << "Error: Could not find syntax file \"syntax.default\"." << endl;
exit(1);

View File

@ -248,7 +248,7 @@ bool splitLatexLength(string const & len, string & value, string & unit)
if (contains(len, '\\'))
unit = trim(string(len, i));
else
unit = support::ascii_lowercase(trim(string(len, i)));
unit = ascii_lowercase(trim(string(len, i)));
return true;
}
@ -1029,7 +1029,7 @@ string const normalize_filename(string const & name)
/// convention (relative to .lyx file) if it is relative
void fix_relative_filename(string & name)
{
if (lyx::support::absolutePath(name))
if (absolutePath(name))
return;
// FIXME UNICODE encoding of name may be wrong (makeAbsPath expects
// utf8)