From 8c93f63b48a1b15d4f3e163b7305213f2f73879e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Sat, 8 Apr 2006 22:31:11 +0000 Subject: [PATCH] * filetools.[Ch]: Make functions that start with a capital letter start with a lower letter. * All other .C and .h in the cs: adjust for above change git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13603 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView_pimpl.C | 20 +-- src/Chktex.C | 8 +- src/DepTable.C | 10 +- src/LaTeX.C | 52 +++--- src/LaTeXFeatures.C | 12 +- src/MenuBackend.C | 6 +- src/ToolbarBackend.C | 8 +- src/buffer.C | 54 +++--- src/buffer_funcs.C | 24 +-- src/bufferlist.C | 22 +-- src/chset.C | 4 +- src/converter.C | 80 ++++----- src/exporter.C | 36 ++-- src/format.C | 34 ++-- src/frontends/LyXView.C | 8 +- src/frontends/controllers/ControlAboutlyx.C | 10 +- src/frontends/controllers/ControlBibtex.C | 6 +- src/frontends/controllers/ControlExternal.C | 4 +- src/frontends/controllers/ControlGraphics.C | 14 +- src/frontends/controllers/ControlInclude.C | 12 +- src/frontends/controllers/ControlMath.C | 4 +- src/frontends/controllers/ControlPrint.C | 8 +- src/frontends/controllers/ControlRef.C | 8 +- src/frontends/controllers/ControlSendto.C | 1 - src/frontends/controllers/ControlShowFile.C | 7 +- src/frontends/controllers/ControlTexinfo.C | 4 +- src/frontends/controllers/helper_funcs.C | 44 ++--- src/frontends/controllers/tex_helpers.C | 22 +-- src/frontends/gtk/GAboutlyx.C | 4 +- src/frontends/gtk/GBibtex.C | 8 +- src/frontends/gtk/GTexinfo.C | 2 +- src/frontends/gtk/GView.C | 6 +- src/frontends/gtk/GViewBase.C | 2 +- src/frontends/gtk/ghelpers.C | 22 +-- src/frontends/qt2/BulletsModule.C | 14 +- src/frontends/qt2/QBibtex.C | 6 +- src/frontends/qt2/QBibtexDialog.C | 8 +- src/frontends/qt2/QCommandBuffer.C | 6 +- src/frontends/qt2/QTexinfo.C | 2 +- src/frontends/qt2/QtView.C | 4 +- src/frontends/qt2/qfont_loader.C | 6 +- src/frontends/screen.C | 4 +- src/frontends/xforms/FormBibtex.C | 10 +- src/frontends/xforms/FormColorpicker.C | 2 +- src/frontends/xforms/FormDialogView.C | 4 +- src/frontends/xforms/FormDocument.C | 6 +- src/frontends/xforms/FormFiledialog.C | 20 +-- src/frontends/xforms/FormPreferences.C | 8 +- src/frontends/xforms/FormTexinfo.C | 2 - src/frontends/xforms/XFormsView.C | 4 +- src/frontends/xforms/lyx_gui.C | 4 +- src/frontends/xforms/xfont_loader.C | 2 - src/frontends/xforms/xforms_helpers.C | 16 +- src/graphics/GraphicsCache.C | 2 +- src/graphics/GraphicsCacheItem.C | 10 +- src/graphics/GraphicsConverter.C | 42 ++--- src/graphics/PreviewLoader.C | 6 +- src/importer.C | 10 +- src/insets/ExternalSupport.C | 32 ++-- src/insets/ExternalTemplate.C | 2 +- src/insets/insetbibtex.C | 20 +-- src/insets/insetgraphics.C | 34 ++-- src/insets/insetinclude.C | 62 +++---- src/insets/render_graphic.C | 10 +- src/lyx_cb.C | 36 ++-- src/lyx_main.C | 34 ++-- src/lyxfunc.C | 74 ++++---- src/lyxlex_pimpl.C | 4 +- src/lyxrc.C | 20 +-- src/lyxtextclass.C | 30 ++-- src/lyxtextclasslist.C | 10 +- src/lyxvc.C | 8 +- src/mathed/math_autocorrect.C | 4 +- src/mathed/math_extern.C | 8 +- src/mathed/math_factory.C | 4 +- src/mover.C | 2 +- src/output.C | 4 +- src/session.C | 4 +- src/support/filename.C | 14 +- src/support/filetools.C | 185 ++++++++++---------- src/support/filetools.h | 71 ++++---- src/support/package.C.in | 62 +++---- src/support/tempname.C | 2 +- src/support/tests/filetools.C | 22 +-- src/tex2lyx/preamble.C | 4 +- src/tex2lyx/tex2lyx.C | 20 +-- src/tex2lyx/text.C | 26 +-- src/trans.C | 4 +- src/vc-backend.C | 40 ++--- 89 files changed, 809 insertions(+), 807 deletions(-) diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index e793188284..40fd603897 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -84,14 +84,14 @@ using lyx::pos_type; -using lyx::support::AddPath; +using lyx::support::addPath; using lyx::support::bformat; using lyx::support::FileFilterList; -using lyx::support::FileSearch; +using lyx::support::fileSearch; using lyx::support::ForkedcallsController; using lyx::support::isDirWriteable; -using lyx::support::MakeDisplayPath; -using lyx::support::MakeAbsPath; +using lyx::support::makeDisplayPath; +using lyx::support::makeAbsPath; using lyx::support::package; using std::endl; @@ -252,7 +252,7 @@ bool BufferView::Pimpl::loadLyXFile(string const & filename, bool tolastfiles) { // Get absolute path of file and add ".lyx" // to the filename if necessary - string s = FileSearch(string(), filename, "lyx"); + string s = fileSearch(string(), filename, "lyx"); bool const found = !s.empty(); @@ -261,7 +261,7 @@ bool BufferView::Pimpl::loadLyXFile(string const & filename, bool tolastfiles) // File already open? if (bufferlist.exists(s)) { - string const file = MakeDisplayPath(s, 20); + string const file = makeDisplayPath(s, 20); string text = bformat(_("The document %1$s is already " "loaded.\n\nDo you want to revert " "to the saved version?"), file); @@ -916,7 +916,7 @@ void BufferView::Pimpl::MenuInsertLyXFile(string const & filenm) make_pair(string(_("Documents|#o#O")), string(lyxrc.document_path)), make_pair(string(_("Examples|#E#e")), - string(AddPath(package().system_support(), "examples")))); + string(addPath(package().system_support(), "examples")))); FileDialog::Result result = fileDlg.open(initpath, @@ -937,15 +937,15 @@ void BufferView::Pimpl::MenuInsertLyXFile(string const & filenm) // Get absolute path of file and add ".lyx" // to the filename if necessary - filename = FileSearch(string(), filename, "lyx"); + filename = fileSearch(string(), filename, "lyx"); - string const disp_fn = MakeDisplayPath(filename); + string const disp_fn = makeDisplayPath(filename); owner_->message(bformat(_("Inserting document %1$s..."), disp_fn)); string res; Buffer buf("", false); buf.error.connect(boost::bind(&BufferView::Pimpl::addError, this, _1)); - if (::loadLyXFile(&buf, MakeAbsPath(filename))) { + if (::loadLyXFile(&buf, makeAbsPath(filename))) { lyx::cap::pasteParagraphList(cursor_, buf.paragraphs(), buf.params().textclass); res = _("Document %1$s inserted."); diff --git a/src/Chktex.C b/src/Chktex.C index bb9258c207..8ca81b294c 100644 --- a/src/Chktex.C +++ b/src/Chktex.C @@ -24,8 +24,8 @@ #include -using lyx::support::ChangeExtension; -using lyx::support::OnlyFilename; +using lyx::support::changeExtension; +using lyx::support::onlyFilename; using lyx::support::split; using lyx::support::Systemcall; @@ -43,7 +43,7 @@ Chktex::Chktex(string const & chktex, string const & f, string const & p) int Chktex::run(TeXErrors &terr) { // run bibtex - string log = OnlyFilename(ChangeExtension(file, ".log")); + string log = onlyFilename(changeExtension(file, ".log")); string tmp = cmd + " -q -v0 -b0 -x " + file + " -o " + log; Systemcall one; int result = one.startscript(Systemcall::Wait, tmp); @@ -61,7 +61,7 @@ int Chktex::scanLogFile(TeXErrors & terr) string token; int retval = 0; - string const tmp = OnlyFilename(ChangeExtension(file, ".log")); + string const tmp = onlyFilename(changeExtension(file, ".log")); #if USE_BOOST_FORMAT boost::format msg(_("ChkTeX warning id # %1$d")); diff --git a/src/DepTable.C b/src/DepTable.C index 2718bcacf9..6de78ce830 100644 --- a/src/DepTable.C +++ b/src/DepTable.C @@ -30,8 +30,8 @@ using std::time; #endif using lyx::support::ltrim; -using lyx::support::MakeAbsPath; -using lyx::support::OnlyFilename; +using lyx::support::makeAbsPath; +using lyx::support::onlyFilename; using lyx::support::suffixIs; using lyx::support::sum; @@ -52,7 +52,7 @@ bool DepTable::dep_info::changed() const void DepTable::insert(string const & fi, bool upd) { // not quite sure if this is the correct place for MakeAbsPath - string const f = MakeAbsPath(fi); + string const f = makeAbsPath(fi); if (deplist.find(f) == deplist.end()) { dep_info di; di.crc_prev = 0; @@ -132,7 +132,7 @@ bool DepTable::sumchange() const bool DepTable::haschanged(string const & f) const { // not quite sure if this is the correct place for MakeAbsPath - string const fil = MakeAbsPath(f); + string const fil = makeAbsPath(f); DepList::const_iterator cit = deplist.find(fil); if (cit != deplist.end()) { if (cit->second.changed()) @@ -199,7 +199,7 @@ void DepTable::remove_file(string const & filename) DepList::iterator cit = deplist.begin(); DepList::iterator end = deplist.end(); while (cit != end) { - if (OnlyFilename(cit->first) == filename) { + if (onlyFilename(cit->first) == filename) { // Can't erase the current iterator, but we // can increment and then erase. // deplist is a map so only the erased diff --git a/src/LaTeX.C b/src/LaTeX.C index e748be39c8..2c64fd896e 100644 --- a/src/LaTeX.C +++ b/src/LaTeX.C @@ -32,15 +32,15 @@ #include -using lyx::support::AbsolutePath; +using lyx::support::absolutePath; using lyx::support::bformat; -using lyx::support::ChangeExtension; +using lyx::support::changeExtension; using lyx::support::contains; using lyx::support::findtexfile; using lyx::support::getcwd; -using lyx::support::OnlyFilename; +using lyx::support::onlyFilename; using lyx::support::prefixIs; -using lyx::support::QuoteName; +using lyx::support::quoteName; using lyx::support::rtrim; using lyx::support::split; using lyx::support::subst; @@ -128,9 +128,9 @@ LaTeX::LaTeX(string const & latex, OutputParams const & rp, depfile = file + ".dep"; if (prefixIs(cmd, "pdf")) { // Do we use pdflatex ? depfile += "-pdf"; - output_file = ChangeExtension(file,".pdf"); + output_file = changeExtension(file,".pdf"); } else { - output_file = ChangeExtension(file,".dvi"); + output_file = changeExtension(file,".dvi"); } } @@ -146,18 +146,18 @@ void LaTeX::deleteFilesOnError() const // but the reason for the error might be in a generated file... - string const ofname = OnlyFilename(file); + string const ofname = onlyFilename(file); // bibtex file - string const bbl = ChangeExtension(ofname, ".bbl"); + string const bbl = changeExtension(ofname, ".bbl"); unlink(bbl); // makeindex file - string const ind = ChangeExtension(ofname, ".ind"); + string const ind = changeExtension(ofname, ".ind"); unlink(ind); // Also remove the aux file - string const aux = ChangeExtension(ofname, ".aux"); + string const aux = changeExtension(ofname, ".aux"); unlink(aux); } @@ -199,7 +199,7 @@ int LaTeX::run(TeXErrors & terr) bool had_depfile = fs::exists(depfile); bool run_bibtex = false; - string aux_file = OnlyFilename(ChangeExtension(file, "aux")); + string aux_file = onlyFilename(changeExtension(file, "aux")); if (had_depfile) { lyxerr[Debug::DEPEND] << "Dependency file exists" << endl; @@ -270,11 +270,11 @@ int LaTeX::run(TeXErrors & terr) // if needed. // run makeindex - if (head.haschanged(OnlyFilename(ChangeExtension(file, ".idx")))) { + if (head.haschanged(onlyFilename(changeExtension(file, ".idx")))) { // no checks for now lyxerr[Debug::LATEX] << "Running MakeIndex." << endl; message(_("Running MakeIndex.")); - rerun = runMakeIndex(OnlyFilename(ChangeExtension(file, ".idx")), runparams); + rerun = runMakeIndex(onlyFilename(changeExtension(file, ".idx")), runparams); } // run bibtex @@ -338,11 +338,11 @@ int LaTeX::run(TeXErrors & terr) // more after this. // run makeindex if the .idx has changed or was generated. - if (head.haschanged(OnlyFilename(ChangeExtension(file, ".idx")))) { + if (head.haschanged(onlyFilename(changeExtension(file, ".idx")))) { // no checks for now lyxerr[Debug::LATEX] << "Running MakeIndex." << endl; message(_("Running MakeIndex.")); - rerun = runMakeIndex(OnlyFilename(ChangeExtension(file, ".idx")), runparams); + rerun = runMakeIndex(onlyFilename(changeExtension(file, ".idx")), runparams); } // 2 @@ -383,7 +383,7 @@ int LaTeX::run(TeXErrors & terr) int LaTeX::startscript() { - string tmp = cmd + ' ' + QuoteName(file) + " > " + os::nulldev(); + string tmp = cmd + ' ' + quoteName(file) + " > " + os::nulldev(); Systemcall one; return one.startscript(Systemcall::Wait, tmp); } @@ -396,7 +396,7 @@ bool LaTeX::runMakeIndex(string const & f, OutputParams const & runparams) << f << endl; string tmp = lyxrc.index_command + " "; tmp = subst(tmp, "$$lang", runparams.document_language); - tmp += QuoteName(f); + tmp += quoteName(f); Systemcall one; one.startscript(Systemcall::Wait, tmp); return true; @@ -411,7 +411,7 @@ LaTeX::scanAuxFiles(string const & file) result.push_back(scanAuxFile(file)); for (int i = 1; i < 1000; ++i) { - string const file2 = ChangeExtension(file, "") + string const file2 = changeExtension(file, "") + '.' + convert(i) + ".aux"; if (!fs::exists(file2)) @@ -461,7 +461,7 @@ void LaTeX::scanAuxFile(string const & file, Aux_Info & aux_info) while (!data.empty()) { string database; data = split(data, database, ','); - database = ChangeExtension(database, "bib"); + database = changeExtension(database, "bib"); lyxerr[Debug::LATEX] << "BibTeX database: `" << database << '\'' << endl; aux_info.databases.insert(database); @@ -470,7 +470,7 @@ void LaTeX::scanAuxFile(string const & file, Aux_Info & aux_info) string style = sub.str(1); // token is now the style file // pass it to the helper - style = ChangeExtension(style, "bst"); + style = changeExtension(style, "bst"); lyxerr[Debug::LATEX] << "BibTeX style: `" << style << '\'' << endl; aux_info.styles.insert(style); @@ -520,7 +520,7 @@ bool LaTeX::runBibTeX(vector const & bibtex_info) result = true; string tmp = lyxrc.bibtex_command + " "; - tmp += QuoteName(OnlyFilename(ChangeExtension(it->aux_file, string()))); + tmp += quoteName(onlyFilename(changeExtension(it->aux_file, string()))); Systemcall one; one.startscript(Systemcall::Wait, tmp); } @@ -534,7 +534,7 @@ int LaTeX::scanLogFile(TeXErrors & terr) int last_line = -1; int line_count = 1; int retval = NO_ERRORS; - string tmp = OnlyFilename(ChangeExtension(file, ".log")); + string tmp = onlyFilename(changeExtension(file, ".log")); lyxerr[Debug::LATEX] << "Log file: " << tmp << endl; ifstream ifs(tmp.c_str()); @@ -682,7 +682,7 @@ void handleFoundFile(string const & ff, DepTable & head) // (1) foundfile is an // absolute path and should // be inserted. - if (AbsolutePath(foundfile)) { + if (absolutePath(foundfile)) { lyxerr[Debug::DEPEND] << "AbsolutePath file: " << foundfile << endl; // On initial insert we want to do the update at once @@ -694,7 +694,7 @@ void handleFoundFile(string const & ff, DepTable & head) return; } - string const onlyfile = OnlyFilename(foundfile); + string const onlyfile = onlyFilename(foundfile); // (2) foundfile is in the tmpdir // insert it into head @@ -737,7 +737,7 @@ void LaTeX::deplog(DepTable & head) // files used by the LaTeX run. The files are then entered into the // dependency file. - string const logfile = OnlyFilename(ChangeExtension(file, ".log")); + string const logfile = onlyFilename(changeExtension(file, ".log")); static regex reg1(".*\\([^)]+.*"); static regex reg2("File: ([^ ]+).*"); @@ -788,5 +788,5 @@ void LaTeX::deplog(DepTable & head) } // Make sure that the main .tex file is in the dependancy file. - head.insert(OnlyFilename(file), true); + head.insert(onlyFilename(file), true); } diff --git a/src/LaTeXFeatures.C b/src/LaTeXFeatures.C index bcda1dc5be..ed5b8ccda7 100644 --- a/src/LaTeXFeatures.C +++ b/src/LaTeXFeatures.C @@ -31,9 +31,9 @@ #include using lyx::support::isSGMLFilename; -using lyx::support::LibFileSearch; -using lyx::support::MakeRelPath; -using lyx::support::OnlyPath; +using lyx::support::libFileSearch; +using lyx::support::makeRelPath; +using lyx::support::onlyPath; using std::endl; using std::find; @@ -75,7 +75,7 @@ void LaTeXFeatures::require(string const & name) void LaTeXFeatures::getAvailable() { LyXLex lex(0, 0); - string real_file = LibFileSearch("", "packages.lst"); + string real_file = libFileSearch("", "packages.lst"); if (real_file.empty()) return; @@ -503,14 +503,14 @@ string const LaTeXFeatures::getLyXSGMLEntities() const string const LaTeXFeatures::getIncludedFiles(string const & fname) const { ostringstream sgmlpreamble; - string const basename = OnlyPath(fname); + string const basename = onlyPath(fname); FileMap::const_iterator end = IncludedFiles_.end(); for (FileMap::const_iterator fi = IncludedFiles_.begin(); fi != end; ++fi) sgmlpreamble << "\nfirst << (isSGMLFilename(fi->second) ? " SYSTEM \"" : " \"") - << MakeRelPath(fi->second, basename) << "\">"; + << makeRelPath(fi->second, basename) << "\">"; return sgmlpreamble.str(); } diff --git a/src/MenuBackend.C b/src/MenuBackend.C index 58e4b26683..1aa53581dc 100644 --- a/src/MenuBackend.C +++ b/src/MenuBackend.C @@ -49,7 +49,7 @@ using lyx::support::compare_ascii_no_case; using lyx::support::contains; -using lyx::support::MakeDisplayPath; +using lyx::support::makeDisplayPath; using lyx::support::token; using boost::bind; @@ -435,7 +435,7 @@ void expandLastfiles(Menu & tomenu, LyXView const * view) for (; lfit != lf.end() && ii < 10; ++lfit, ++ii) { string const label = convert(ii) + ". " - + MakeDisplayPath((*lfit), 30) + + makeDisplayPath((*lfit), 30) + '|' + convert(ii); tomenu.add(MenuItem(MenuItem::Command, label, FuncRequest(LFUN_FILE_OPEN, (*lfit))), view); } @@ -457,7 +457,7 @@ void expandDocuments(Menu & tomenu, LyXView const * view) Strings::const_iterator docit = names.begin(); Strings::const_iterator end = names.end(); for (; docit != end; ++docit, ++ii) { - string label = MakeDisplayPath(*docit, 20); + string label = makeDisplayPath(*docit, 20); if (ii < 10) label = convert(ii) + ". " + label + '|' + convert(ii); tomenu.add(MenuItem(MenuItem::Command, label, FuncRequest(LFUN_SWITCHBUFFER, *docit)), view); diff --git a/src/ToolbarBackend.C b/src/ToolbarBackend.C index baa2ddfbcd..eaf6a61dbe 100644 --- a/src/ToolbarBackend.C +++ b/src/ToolbarBackend.C @@ -25,7 +25,7 @@ using lyx::support::compare_ascii_no_case; using lyx::support::getVectorFromString; -using lyx::support::LibFileSearch; +using lyx::support::libFileSearch; using lyx::support::subst; using std::endl; @@ -229,11 +229,11 @@ string const ToolbarBackend::getIcon(FuncRequest const & f) if (!f.argument.empty()) xpm_name = subst(name + ' ' + f.argument, ' ', '_'); - fullname = LibFileSearch("images", xpm_name, "xpm"); + fullname = libFileSearch("images", xpm_name, "xpm"); if (fullname.empty()) { // try without the argument - fullname = LibFileSearch("images", name, "xpm"); + fullname = libFileSearch("images", name, "xpm"); } } @@ -246,5 +246,5 @@ string const ToolbarBackend::getIcon(FuncRequest const & f) lyxerr[Debug::GUI] << "Cannot find icon for command \"" << lyxaction.getActionName(f.action) << '(' << f.argument << ")\"" << endl; - return LibFileSearch("images", "unknown", "xpm"); + return libFileSearch("images", "unknown", "xpm"); } diff --git a/src/buffer.C b/src/buffer.C index 77b6e46bb1..91ea64f25a 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -94,27 +94,27 @@ using lyx::pos_type; using lyx::pit_type; -using lyx::support::AddName; +using lyx::support::addName; using lyx::support::bformat; -using lyx::support::ChangeExtension; +using lyx::support::changeExtension; using lyx::support::cmd_ret; using lyx::support::createBufferTmpDir; using lyx::support::destroyDir; using lyx::support::getFormatFromContents; using lyx::support::isDirWriteable; -using lyx::support::LibFileSearch; +using lyx::support::libFileSearch; using lyx::support::latex_path; using lyx::support::ltrim; -using lyx::support::MakeAbsPath; -using lyx::support::MakeDisplayPath; -using lyx::support::MakeLatexName; -using lyx::support::OnlyFilename; -using lyx::support::OnlyPath; +using lyx::support::makeAbsPath; +using lyx::support::makeDisplayPath; +using lyx::support::makeLatexName; +using lyx::support::onlyFilename; +using lyx::support::onlyPath; using lyx::support::Path; -using lyx::support::QuoteName; +using lyx::support::quoteName; using lyx::support::removeAutosaveFile; using lyx::support::rename; -using lyx::support::RunCommand; +using lyx::support::runCommand; using lyx::support::split; using lyx::support::subst; using lyx::support::tempName; @@ -202,7 +202,7 @@ public: Buffer::Impl::Impl(Buffer & parent, string const & file, bool readonly_) : lyx_clean(true), bak_clean(true), unnamed(false), read_only(readonly_), - filename(file), filepath(OnlyPath(file)), file_fully_loaded(false), + filename(file), filepath(onlyPath(file)), file_fully_loaded(false), inset(params) { inset.setAutoBreakRows(true); @@ -331,8 +331,8 @@ TexRow const & Buffer::texrow() const string const Buffer::getLatexName(bool const no_path) const { - string const name = ChangeExtension(MakeLatexName(fileName()), ".tex"); - return no_path ? OnlyFilename(name) : name; + string const name = changeExtension(makeLatexName(fileName()), ".tex"); + return no_path ? onlyFilename(name) : name; } @@ -345,12 +345,12 @@ pair const Buffer::getLogName() const string const path = temppath(); - string const fname = AddName(path, - OnlyFilename(ChangeExtension(filename, + string const fname = addName(path, + onlyFilename(changeExtension(filename, ".log"))); string const bname = - AddName(path, OnlyFilename( - ChangeExtension(filename, + addName(path, onlyFilename( + changeExtension(filename, formats.extension("literate") + ".out"))); // If no Latex log or Build log is newer, show Build log @@ -376,8 +376,8 @@ void Buffer::setReadonly(bool const flag) void Buffer::setFileName(string const & newfile) { - pimpl_->filename = MakeAbsPath(newfile); - pimpl_->filepath = OnlyPath(pimpl_->filename); + pimpl_->filename = makeAbsPath(newfile); + pimpl_->filepath = onlyPath(pimpl_->filename); setReadonly(fs::is_readonly(pimpl_->filename)); updateTitles(); } @@ -631,7 +631,7 @@ bool Buffer::readFile(LyXLex & lex, string const & filename) filename)); return false; } - string const lyx2lyx = LibFileSearch("lyx2lyx", "lyx2lyx"); + string const lyx2lyx = libFileSearch("lyx2lyx", "lyx2lyx"); if (lyx2lyx.empty()) { Alert::error(_("Conversion script not found"), bformat(_("%1$s is from an earlier" @@ -642,17 +642,17 @@ bool Buffer::readFile(LyXLex & lex, string const & filename) return false; } ostringstream command; - command << "python " << QuoteName(lyx2lyx) + command << "python " << quoteName(lyx2lyx) << " -t " << convert(LYX_FORMAT) - << " -o " << QuoteName(tmpfile) << ' ' - << QuoteName(filename); + << " -o " << quoteName(tmpfile) << ' ' + << quoteName(filename); string const command_str = command.str(); lyxerr[Debug::INFO] << "Running '" << command_str << '\'' << endl; - cmd_ret const ret = RunCommand(command_str); + cmd_ret const ret = runCommand(command_str); if (ret.first != 0) { Alert::error(_("Conversion script failed"), bformat(_("%1$s is from an earlier version" @@ -695,7 +695,7 @@ bool Buffer::save() const if (lyxrc.make_backup) { s = fileName() + '~'; if (!lyxrc.backupdir_path.empty()) - s = AddName(lyxrc.backupdir_path, + s = addName(lyxrc.backupdir_path, subst(os::internal_path(s),'/','!')); // It might very well be that this variant is just @@ -999,7 +999,7 @@ void Buffer::makeLinuxDocFile(string const & fname, ofs << tclass.class_header(); string preamble = params().preamble; - string const name = runparams.nice ? ChangeExtension(pimpl_->filename, ".sgml") + string const name = runparams.nice ? changeExtension(pimpl_->filename, ".sgml") : fname; preamble += features.getIncludedFiles(name); preamble += features.getLyXSGMLEntities(); @@ -1074,7 +1074,7 @@ void Buffer::makeDocBookFile(string const & fname, preamble += "\n"; } - string const name = runparams.nice ? ChangeExtension(pimpl_->filename, ".sgml") + string const name = runparams.nice ? changeExtension(pimpl_->filename, ".sgml") : fname; preamble += features.getIncludedFiles(name); preamble += features.getLyXSGMLEntities(); diff --git a/src/buffer_funcs.C b/src/buffer_funcs.C index 7a663b4123..2456da0c1e 100644 --- a/src/buffer_funcs.C +++ b/src/buffer_funcs.C @@ -47,10 +47,10 @@ using lyx::pit_type; using lyx::support::bformat; -using lyx::support::LibFileSearch; -using lyx::support::MakeDisplayPath; -using lyx::support::OnlyFilename; -using lyx::support::OnlyPath; +using lyx::support::libFileSearch; +using lyx::support::makeDisplayPath; +using lyx::support::onlyFilename; +using lyx::support::onlyPath; using lyx::support::unlink; using std::min; @@ -68,7 +68,7 @@ bool readFile(Buffer * const b, string const & s) // File information about normal file if (!fs::exists(s)) { - string const file = MakeDisplayPath(s, 50); + string const file = makeDisplayPath(s, 50); string text = bformat(_("The specified document\n%1$s" "\ncould not be read."), file); Alert::error(_("Could not read document"), text); @@ -76,12 +76,12 @@ bool readFile(Buffer * const b, string const & s) } // Check if emergency save file exists and is newer. - string const e = OnlyPath(s) + OnlyFilename(s) + ".emergency"; + string const e = onlyPath(s) + onlyFilename(s) + ".emergency"; if (fs::exists(e) && fs::exists(s) && fs::last_write_time(e) > fs::last_write_time(s)) { - string const file = MakeDisplayPath(s, 20); + string const file = makeDisplayPath(s, 20); string const text = bformat(_("An emergency save of the document " "%1$s exists.\n\n" @@ -102,12 +102,12 @@ bool readFile(Buffer * const b, string const & s) } // Now check if autosave file is newer. - string const a = OnlyPath(s) + '#' + OnlyFilename(s) + '#'; + string const a = onlyPath(s) + '#' + onlyFilename(s) + '#'; if (fs::exists(a) && fs::exists(s) && fs::last_write_time(a) > fs::last_write_time(s)) { - string const file = MakeDisplayPath(s, 20); + string const file = makeDisplayPath(s, 20); string const text = bformat(_("The backup of the document " "%1$s is newer.\n\nLoad the " @@ -148,7 +148,7 @@ bool loadLyXFile(Buffer * b, string const & s) return true; } } else { - string const file = MakeDisplayPath(s, 20); + string const file = makeDisplayPath(s, 20); // Here we probably should run if (LyXVC::file_not_found_hook(s)) { string const text = @@ -180,13 +180,13 @@ Buffer * newFile(string const & filename, string const & templatename, string tname; // use defaults.lyx as a default template if it exists. if (templatename.empty()) - tname = LibFileSearch("templates", "defaults.lyx"); + tname = libFileSearch("templates", "defaults.lyx"); else tname = templatename; if (!tname.empty()) { if (!b->readFile(tname)) { - string const file = MakeDisplayPath(tname, 50); + string const file = makeDisplayPath(tname, 50); string const text = bformat(_("The specified document template\n%1$s\ncould not be read."), file); Alert::error(_("Could not read template"), text); // no template, start with empty buffer diff --git a/src/bufferlist.C b/src/bufferlist.C index a4d2d6a0fd..5b9826471b 100644 --- a/src/bufferlist.C +++ b/src/bufferlist.C @@ -34,11 +34,11 @@ #include #include -using lyx::support::AddName; +using lyx::support::addName; using lyx::support::bformat; -using lyx::support::MakeAbsPath; -using lyx::support::MakeDisplayPath; -using lyx::support::OnlyFilename; +using lyx::support::makeAbsPath; +using lyx::support::makeDisplayPath; +using lyx::support::onlyFilename; using lyx::support::removeAutosaveFile; using lyx::support::package; using lyx::support::prefixIs; @@ -73,9 +73,9 @@ bool BufferList::quitWriteBuffer(Buffer * buf) string file; if (buf->isUnnamed()) - file = OnlyFilename(buf->fileName()); + file = onlyFilename(buf->fileName()); else - file = MakeDisplayPath(buf->fileName(), 30); + file = makeDisplayPath(buf->fileName(), 30); string const text = bformat(_("The document %1$s has unsaved changes.\n\n" @@ -172,9 +172,9 @@ bool BufferList::close(Buffer * buf, bool const ask) string fname; if (buf->isUnnamed()) - fname = OnlyFilename(buf->fileName()); + fname = onlyFilename(buf->fileName()); else - fname = MakeDisplayPath(buf->fileName(), 30); + fname = makeDisplayPath(buf->fileName(), 30); string const text = bformat(_("The document %1$s has unsaved changes.\n\n" @@ -299,7 +299,7 @@ void BufferList::emergencyWrite(Buffer * buf) return; string const doc = buf->isUnnamed() - ? OnlyFilename(buf->fileName()) : buf->fileName(); + ? onlyFilename(buf->fileName()) : buf->fileName(); lyxerr << bformat(_("LyX: Attempting to save document %1$s"), doc) << endl; @@ -319,7 +319,7 @@ void BufferList::emergencyWrite(Buffer * buf) } // 2) In HOME directory. - string s = AddName(package().home_dir(), buf->fileName()); + string s = addName(package().home_dir(), buf->fileName()); s += ".emergency"; lyxerr << ' ' << s << endl; if (buf->writeFile(s)) { @@ -333,7 +333,7 @@ void BufferList::emergencyWrite(Buffer * buf) // 3) In "/tmp" directory. // MakeAbsPath to prepend the current // drive letter on OS/2 - s = AddName(package().temp_dir(), buf->fileName()); + s = addName(package().temp_dir(), buf->fileName()); s += ".emergency"; lyxerr << ' ' << s << endl; if (buf->writeFile(s)) { diff --git a/src/chset.C b/src/chset.C index 6a5631566d..c52158e166 100644 --- a/src/chset.C +++ b/src/chset.C @@ -22,7 +22,7 @@ #include -using lyx::support::LibFileSearch; +using lyx::support::libFileSearch; using boost::regex; using boost::smatch; @@ -48,7 +48,7 @@ bool CharacterSet::loadFile(string const & fname) // open definition file lyxerr[Debug::KBMAP] << "Reading character set file " << fname << ".cdef" << endl; - string const filename = LibFileSearch("kbd", fname, "cdef"); + string const filename = libFileSearch("kbd", fname, "cdef"); ifstream ifs(filename.c_str()); if (!ifs) { lyxerr << "Unable to open character set file" << endl; diff --git a/src/converter.C b/src/converter.C index 334f790bee..750a03936b 100644 --- a/src/converter.C +++ b/src/converter.C @@ -29,22 +29,22 @@ #include "support/path.h" #include "support/systemcall.h" -using lyx::support::AddName; +using lyx::support::addName; using lyx::support::bformat; -using lyx::support::ChangeExtension; +using lyx::support::changeExtension; using lyx::support::compare_ascii_no_case; using lyx::support::contains; -using lyx::support::DirList; -using lyx::support::GetExtension; +using lyx::support::dirList; +using lyx::support::getExtension; using lyx::support::isFileReadable; -using lyx::support::LibFileSearch; -using lyx::support::LibScriptSearch; -using lyx::support::MakeRelPath; -using lyx::support::OnlyFilename; -using lyx::support::OnlyPath; +using lyx::support::libFileSearch; +using lyx::support::libScriptSearch; +using lyx::support::makeRelPath; +using lyx::support::onlyFilename; +using lyx::support::onlyPath; using lyx::support::Path; using lyx::support::prefixIs; -using lyx::support::QuoteName; +using lyx::support::quoteName; using lyx::support::split; using lyx::support::subst; using lyx::support::Systemcall; @@ -284,7 +284,7 @@ bool Converters::convert(Buffer const * buffer, string & to_file, bool try_default) { string const to_ext = formats.extension(to_format); - to_file = ChangeExtension(to_file_base, to_ext); + to_file = changeExtension(to_file_base, to_ext); if (from_format == to_format) return move(from_format, from_file, to_file, false); @@ -295,15 +295,15 @@ bool Converters::convert(Buffer const * buffer, // if no special converter defined, then we take the // default one from ImageMagic. string const from_ext = from_format.empty() ? - GetExtension(from_file) : + getExtension(from_file) : formats.extension(from_format); string const command = "sh " + - QuoteName(LibFileSearch("scripts", "convertDefault.sh")) + + quoteName(libFileSearch("scripts", "convertDefault.sh")) + ' ' + - QuoteName(from_ext + ':' + from_file) + + quoteName(from_ext + ':' + from_file) + ' ' + - QuoteName(to_ext + ':' + to_file); + quoteName(to_ext + ':' + to_file); lyxerr[Debug::FILES] << "No converter defined! " "I use convertDefault.sh:\n\t" @@ -323,12 +323,12 @@ bool Converters::convert(Buffer const * buffer, } OutputParams runparams; runparams.flavor = getFlavor(edgepath); - string path = OnlyPath(from_file); + string path = onlyPath(from_file); Path p(path); bool run_latex = false; - string from_base = ChangeExtension(from_file, ""); - string to_base = ChangeExtension(to_file, ""); + string from_base = changeExtension(from_file, ""); + string to_base = changeExtension(to_file, ""); string infile; string outfile = from_file; for (Graph::EdgePath::const_iterator cit = edgepath.begin(); @@ -340,18 +340,18 @@ bool Converters::convert(Buffer const * buffer, << conv.from << " to " << conv.to << endl; infile = outfile; outfile = conv.result_dir.empty() - ? ChangeExtension(from_file, conv.To->extension()) - : AddName(subst(conv.result_dir, + ? changeExtension(from_file, conv.To->extension()) + : addName(subst(conv.result_dir, token_base, from_base), subst(conv.result_file, - token_base, OnlyFilename(from_base))); + token_base, onlyFilename(from_base))); // if input and output files are equal, we use a // temporary file as intermediary (JMarc) string real_outfile; if (outfile == infile) { real_outfile = infile; - outfile = AddName(buffer->temppath(), "tmpfile.out"); + outfile = addName(buffer->temppath(), "tmpfile.out"); } if (conv.latex) { @@ -370,18 +370,18 @@ bool Converters::convert(Buffer const * buffer, } string const infile2 = (conv.original_dir) - ? infile : MakeRelPath(infile, path); + ? infile : makeRelPath(infile, path); string const outfile2 = (conv.original_dir) - ? outfile : MakeRelPath(outfile, path); + ? outfile : makeRelPath(outfile, path); string command = conv.command; - command = subst(command, token_from, QuoteName(infile2)); - command = subst(command, token_base, QuoteName(from_base)); - command = subst(command, token_to, QuoteName(outfile2)); - command = LibScriptSearch(command); + command = subst(command, token_from, quoteName(infile2)); + command = subst(command, token_base, quoteName(from_base)); + command = subst(command, token_to, quoteName(outfile2)); + command = libScriptSearch(command); if (!conv.parselog.empty()) - command += " 2> " + QuoteName(infile2 + ".out"); + command += " 2> " + quoteName(infile2 + ".out"); if (conv.from == "dvi" && conv.to == "ps") command = add_options(command, @@ -421,10 +421,10 @@ bool Converters::convert(Buffer const * buffer, if (!conv.parselog.empty()) { string const logfile = infile2 + ".log"; - string const script = LibScriptSearch(conv.parselog); + string const script = libScriptSearch(conv.parselog); string const command2 = script + - " < " + QuoteName(infile2 + ".out") + - " > " + QuoteName(logfile); + " < " + quoteName(infile2 + ".out") + + " > " + quoteName(logfile); one.startscript(Systemcall::Wait, command2); if (!scanLog(*buffer, command, logfile)) return false; @@ -451,9 +451,9 @@ bool Converters::convert(Buffer const * buffer, return true; if (!conv.result_dir.empty()) { - to_file = AddName(subst(conv.result_dir, token_base, to_base), + to_file = addName(subst(conv.result_dir, token_base, to_base), subst(conv.result_file, - token_base, OnlyFilename(to_base))); + token_base, onlyFilename(to_base))); if (from_base != to_base) { string const from = subst(conv.result_dir, token_base, from_base); @@ -480,18 +480,18 @@ bool Converters::move(string const & fmt, return true; bool no_errors = true; - string const path = OnlyPath(from); - string const base = OnlyFilename(ChangeExtension(from, "")); - string const to_base = ChangeExtension(to, ""); - string const to_extension = GetExtension(to); + string const path = onlyPath(from); + string const base = onlyFilename(changeExtension(from, "")); + string const to_base = changeExtension(to, ""); + string const to_extension = getExtension(to); - vector files = DirList(OnlyPath(from), GetExtension(from)); + vector files = dirList(onlyPath(from), getExtension(from)); for (vector::const_iterator it = files.begin(); it != files.end(); ++it) if (prefixIs(*it, base)) { string const from2 = path + *it; string to2 = to_base + it->substr(base.length()); - to2 = ChangeExtension(to2, to_extension); + to2 = changeExtension(to2, to_extension); lyxerr[Debug::FILES] << "moving " << from2 << " to " << to2 << endl; diff --git a/src/exporter.C b/src/exporter.C index ede3c28776..076e09a09b 100644 --- a/src/exporter.C +++ b/src/exporter.C @@ -36,14 +36,14 @@ #include -using lyx::support::AddName; +using lyx::support::addName; using lyx::support::bformat; -using lyx::support::ChangeExtension; +using lyx::support::changeExtension; using lyx::support::contains; -using lyx::support::MakeAbsPath; -using lyx::support::MakeDisplayPath; -using lyx::support::OnlyFilename; -using lyx::support::OnlyPath; +using lyx::support::makeAbsPath; +using lyx::support::makeDisplayPath; +using lyx::support::onlyFilename; +using lyx::support::onlyPath; using lyx::support::package; using lyx::support::prefixIs; @@ -76,7 +76,7 @@ int checkOverwrite(string const & filename) if (fs::exists(filename)) { string text = bformat(_("The file %1$s already exists.\n\n" "Do you want to over-write that file?"), - MakeDisplayPath(filename)); + makeDisplayPath(filename)); return Alert::prompt(_("Over-write file?"), text, 0, 2, _("&Over-write"), _("Over-write &all"), @@ -111,7 +111,7 @@ CopyStatus copyFile(string const & format, // overwrite themselves. This check could be changed to // boost::filesystem::equivalent(sourceFile, destFile) if export to // other directories than the document directory is desired. - if (!prefixIs(OnlyPath(sourceFile), package().temp_dir())) + if (!prefixIs(onlyPath(sourceFile), package().temp_dir())) return ret; if (!force) { @@ -131,8 +131,8 @@ CopyStatus copyFile(string const & format, if (!mover.copy(sourceFile, destFile, latexFile)) Alert::error(_("Couldn't copy file"), bformat(_("Copying %1$s to %2$s failed."), - MakeDisplayPath(sourceFile), - MakeDisplayPath(destFile))); + makeDisplayPath(sourceFile), + makeDisplayPath(destFile))); return ret; } @@ -181,8 +181,8 @@ bool Exporter::Export(Buffer * buffer, string const & format, } string filename = buffer->getLatexName(false); - filename = AddName(buffer->temppath(), filename); - filename = ChangeExtension(filename, + filename = addName(buffer->temppath(), filename); + filename = changeExtension(filename, formats.extension(backend_format)); // Ascii backend @@ -221,20 +221,20 @@ bool Exporter::Export(Buffer * buffer, string const & format, if (!put_in_tempdir) { string const tmp_result_file = result_file; - result_file = ChangeExtension(buffer->fileName(), + result_file = changeExtension(buffer->fileName(), formats.extension(format)); // We need to copy referenced files (e. g. included graphics // if format == "dvi") to the result dir. vector const files = runparams.exportdata->externalFiles(format); - string const dest = OnlyPath(result_file); + string const dest = onlyPath(result_file); CopyStatus status = SUCCESS; for (vector::const_iterator it = files.begin(); it != files.end() && status != CANCEL; ++it) { string const fmt = formats.getFormatFromFile(it->sourceName); status = copyFile(fmt, it->sourceName, - MakeAbsPath(it->exportName, dest), + makeAbsPath(it->exportName, dest), it->exportName, status == FORCE); } if (status == CANCEL) { @@ -247,7 +247,7 @@ bool Exporter::Export(Buffer * buffer, string const & format, buffer->message(bformat(_("Document exported as %1$s " "to file `%2$s'"), formats.prettyName(format), - MakeDisplayPath(result_file))); + makeDisplayPath(result_file))); } else { // This must be a dummy converter like fax (bug 1888) buffer->message(bformat(_("Document exported as %1$s"), @@ -319,7 +319,7 @@ void ExportData::addExternalFile(string const & format, string const & sourceName, string const & exportName) { - BOOST_ASSERT(lyx::support::AbsolutePath(sourceName)); + BOOST_ASSERT(lyx::support::absolutePath(sourceName)); // Make sure that we have every file only once, otherwise copyFile() // would ask several times if it should overwrite a file. @@ -333,7 +333,7 @@ void ExportData::addExternalFile(string const & format, void ExportData::addExternalFile(string const & format, string const & sourceName) { - addExternalFile(format, sourceName, OnlyFilename(sourceName)); + addExternalFile(format, sourceName, onlyFilename(sourceName)); } diff --git a/src/format.C b/src/format.C index da512b01b6..ca8ef10e47 100644 --- a/src/format.C +++ b/src/format.C @@ -27,12 +27,12 @@ using lyx::support::bformat; using lyx::support::compare_ascii_no_case; using lyx::support::contains; -using lyx::support::LibScriptSearch; -using lyx::support::MakeDisplayPath; -using lyx::support::OnlyFilename; -using lyx::support::OnlyPath; +using lyx::support::libScriptSearch; +using lyx::support::makeDisplayPath; +using lyx::support::onlyFilename; +using lyx::support::onlyPath; using lyx::support::Path; -using lyx::support::QuoteName; +using lyx::support::quoteName; using lyx::support::subst; using lyx::support::Systemcall; @@ -134,7 +134,7 @@ string Formats::getFormatFromFile(string const & filename) const return format; // try to find a format from the file extension. - string const ext(lyx::support::GetExtension(filename)); + string const ext(lyx::support::getExtension(filename)); if (!ext.empty()) { // this is ambigous if two formats have the same extension, // but better than nothing @@ -232,7 +232,7 @@ bool Formats::view(Buffer const & buffer, string const & filename, return false; } - string command = LibScriptSearch(format->viewer()); + string command = libScriptSearch(format->viewer()); if (format_name == "dvi" && !lyxrc.view_dvi_paper_option.empty()) { @@ -249,20 +249,20 @@ bool Formats::view(Buffer const & buffer, string const & filename, command += ' ' + token_from; command = subst(command, token_from, - QuoteName(OnlyFilename(filename))); - command = subst(command, token_path, QuoteName(OnlyPath(filename))); - command = subst(command, token_socket, QuoteName(lyxsocket->address())); + quoteName(onlyFilename(filename))); + command = subst(command, token_path, quoteName(onlyPath(filename))); + command = subst(command, token_socket, quoteName(lyxsocket->address())); lyxerr[Debug::FILES] << "Executing command: " << command << std::endl; buffer.message(_("Executing command: ") + command); - Path p(OnlyPath(filename)); + Path p(onlyPath(filename)); Systemcall one; int const res = one.startscript(Systemcall::DontWait, command); if (res) { Alert::error(_("Cannot view file"), bformat(_("An error occurred whilst running %1$s"), - MakeDisplayPath(command, 50))); + makeDisplayPath(command, 50))); return false; } return true; @@ -294,20 +294,20 @@ bool Formats::edit(Buffer const & buffer, string const & filename, command += ' ' + token_from; command = subst(command, token_from, - QuoteName(OnlyFilename(filename))); - command = subst(command, token_path, QuoteName(OnlyPath(filename))); - command = subst(command, token_socket, QuoteName(lyxsocket->address())); + quoteName(onlyFilename(filename))); + command = subst(command, token_path, quoteName(onlyPath(filename))); + command = subst(command, token_socket, quoteName(lyxsocket->address())); lyxerr[Debug::FILES] << "Executing command: " << command << std::endl; buffer.message(_("Executing command: ") + command); - Path p(OnlyPath(filename)); + Path p(onlyPath(filename)); Systemcall one; int const res = one.startscript(Systemcall::DontWait, command); if (res) { Alert::error(_("Cannot edit file"), bformat(_("An error occurred whilst running %1$s"), - MakeDisplayPath(command, 50))); + makeDisplayPath(command, 50))); return false; } return true; diff --git a/src/frontends/LyXView.C b/src/frontends/LyXView.C index 56a7e410ce..7b272a3c05 100644 --- a/src/frontends/LyXView.C +++ b/src/frontends/LyXView.C @@ -46,8 +46,8 @@ # include #endif -using lyx::support::MakeDisplayPath; -using lyx::support::OnlyFilename; +using lyx::support::makeDisplayPath; +using lyx::support::onlyFilename; using std::endl; using std::string; @@ -179,8 +179,8 @@ void LyXView::updateWindowTitle() if (view()->available()) { string const cur_title = buffer()->fileName(); if (!cur_title.empty()) { - maximize_title += ": " + MakeDisplayPath(cur_title, 30); - minimize_title = OnlyFilename(cur_title); + maximize_title += ": " + makeDisplayPath(cur_title, 30); + minimize_title = onlyFilename(cur_title); if (!buffer()->isClean()) { maximize_title += _(" (changed)"); minimize_title += '*'; diff --git a/src/frontends/controllers/ControlAboutlyx.C b/src/frontends/controllers/ControlAboutlyx.C index b0b7ef1d34..cd379b9141 100644 --- a/src/frontends/controllers/ControlAboutlyx.C +++ b/src/frontends/controllers/ControlAboutlyx.C @@ -28,8 +28,8 @@ using std::string; namespace lyx { -using support::FileSearch; -using support::MakeDisplayPath; +using support::fileSearch; +using support::makeDisplayPath; using support::package; namespace frontend { @@ -42,7 +42,7 @@ ControlAboutlyx::ControlAboutlyx(Dialog & parent) void ControlAboutlyx::getCredits(ostream & ss) const { - string const name = FileSearch(package().system_support(), "CREDITS"); + string const name = fileSearch(package().system_support(), "CREDITS"); bool found(!name.empty()); @@ -89,10 +89,10 @@ string const ControlAboutlyx::getVersion() const << lyx_release_date << "\n" << _("Library directory: ") - << MakeDisplayPath(package().system_support()) + << makeDisplayPath(package().system_support()) << "\n" << _("User directory: ") - << MakeDisplayPath(package().user_support()); + << makeDisplayPath(package().user_support()); return ss.str(); } diff --git a/src/frontends/controllers/ControlBibtex.C b/src/frontends/controllers/ControlBibtex.C index 76964ac4c3..37ab488b0d 100644 --- a/src/frontends/controllers/ControlBibtex.C +++ b/src/frontends/controllers/ControlBibtex.C @@ -36,7 +36,7 @@ namespace lyx { using support::contains; using support::FileFilterList; -using support::OnlyFilename; +using support::onlyFilename; using support::prefixIs; using support::split; @@ -82,7 +82,7 @@ void ControlBibtex::getBibStyles(vector & data) const vector::iterator it = data.begin(); vector::iterator end = data.end(); for (; it != end; ++it) { - *it = OnlyFilename(*it); + *it = onlyFilename(*it); } // sort on filename only (no path) std::sort(data.begin(), data.end()); @@ -102,7 +102,7 @@ void ControlBibtex::getBibFiles(vector & data) const vector::iterator it = data.begin(); vector::iterator end = data.end(); for (; it != end; ++it) { - *it = OnlyFilename(*it); + *it = onlyFilename(*it); } // sort on filename only (no path) std::sort(data.begin(), data.end()); diff --git a/src/frontends/controllers/ControlExternal.C b/src/frontends/controllers/ControlExternal.C index 556363ac50..e0c36c0ec4 100644 --- a/src/frontends/controllers/ControlExternal.C +++ b/src/frontends/controllers/ControlExternal.C @@ -38,7 +38,7 @@ using std::string; namespace lyx { using support::FileFilterList; -using support::MakeAbsPath; +using support::makeAbsPath; using support::readBB_from_PSFile; namespace frontend { @@ -167,7 +167,7 @@ string const ControlExternal::browse(string const & input, string const ControlExternal::readBB(string const & file) { string const abs_file = - MakeAbsPath(file, kernel().bufferFilepath()); + makeAbsPath(file, kernel().bufferFilepath()); // try to get it from the file, if possible. Zipped files are // unzipped in the readBB_from_PSFile-Function diff --git a/src/frontends/controllers/ControlGraphics.C b/src/frontends/controllers/ControlGraphics.C index e7c5e4157f..af2ef55324 100644 --- a/src/frontends/controllers/ControlGraphics.C +++ b/src/frontends/controllers/ControlGraphics.C @@ -42,10 +42,10 @@ namespace fs = boost::filesystem; namespace lyx { -using support::AddName; +using support::addName; using support::FileFilterList; using support::isFileReadable; -using support::MakeAbsPath; +using support::makeAbsPath; using support::package; using support::readBB_from_PSFile; @@ -86,10 +86,10 @@ string const ControlGraphics::browse(string const & in_name) const string const title = _("Select graphics file"); // Does user clipart directory exist? - string clipdir = AddName (package().user_support(), "clipart"); + string clipdir = addName(package().user_support(), "clipart"); if (!(fs::exists(clipdir) && fs::is_directory(clipdir))) // No - bail out to system clipart directory - clipdir = AddName (package().system_support(), "clipart"); + clipdir = addName(package().system_support(), "clipart"); pair dir1(_("Clipart|#C#c"), clipdir); pair dir2(_("Documents|#o#O"), string(lyxrc.document_path)); // Show the file browser dialog @@ -103,7 +103,7 @@ string const ControlGraphics::browse(string const & in_name) const string const ControlGraphics::readBB(string const & file) { string const abs_file = - MakeAbsPath(file, kernel().bufferFilepath()); + makeAbsPath(file, kernel().bufferFilepath()); // try to get it from the file, if possible. Zipped files are // unzipped in the readBB_from_PSFile-Function @@ -132,7 +132,7 @@ string const ControlGraphics::readBB(string const & file) bool ControlGraphics::isFilenameValid(string const & fname) const { // It may be that the filename is relative. - string const name = MakeAbsPath(fname, kernel().bufferFilepath()); + string const name = makeAbsPath(fname, kernel().bufferFilepath()); return isFileReadable(name); } @@ -178,7 +178,7 @@ size_t const rorigin_size = sizeof(rorigin_lyx_strs) / sizeof(char *); vector const getBBUnits() { - return vector (bb_units, bb_units + bb_size); + return vector(bb_units, bb_units + bb_size); } diff --git a/src/frontends/controllers/ControlInclude.C b/src/frontends/controllers/ControlInclude.C index 96b57156b1..9bbcbffddb 100644 --- a/src/frontends/controllers/ControlInclude.C +++ b/src/frontends/controllers/ControlInclude.C @@ -36,8 +36,8 @@ namespace lyx { using support::FileFilterList; using support::isFileReadable; -using support::MakeAbsPath; -using support::OnlyPath; +using support::makeAbsPath; +using support::onlyPath; namespace frontend { @@ -90,7 +90,7 @@ string const ControlInclude::browse(string const & in_name, Type in_type) const pair dir1(N_("Documents|#o#O"), string(lyxrc.document_path)); - string const docpath = OnlyPath(kernel().buffer().fileName()); + string const docpath = onlyPath(kernel().buffer().fileName()); return browseRelFile(in_name, docpath, title, filters, false, dir1); @@ -99,7 +99,7 @@ string const ControlInclude::browse(string const & in_name, Type in_type) const void ControlInclude::load(string const & file) { - string const ext = support::GetExtension(file); + string const ext = support::getExtension(file); if (ext == "lyx") kernel().dispatch(FuncRequest(LFUN_CHILDOPEN, file)); else @@ -111,8 +111,8 @@ void ControlInclude::load(string const & file) bool ControlInclude::fileExists(string const & file) { string const fileWithAbsPath - = MakeAbsPath(file, - OnlyPath(kernel().buffer().fileName())); + = makeAbsPath(file, + onlyPath(kernel().buffer().fileName())); if (isFileReadable(fileWithAbsPath)) return true; diff --git a/src/frontends/controllers/ControlMath.C b/src/frontends/controllers/ControlMath.C index a0cc9de8fa..61cc600e4f 100644 --- a/src/frontends/controllers/ControlMath.C +++ b/src/frontends/controllers/ControlMath.C @@ -25,7 +25,7 @@ using std::string; namespace lyx { using support::compare; -using support::LibFileSearch; +using support::libFileSearch; using support::subst; namespace frontend { @@ -374,7 +374,7 @@ string const find_xpm(string const & name) << "Looking for math XPM called \"" << xpm_name << '"' << std::endl; - return LibFileSearch("images/math/", xpm_name, "xpm"); + return libFileSearch("images/math/", xpm_name, "xpm"); } } // namespace frontend diff --git a/src/frontends/controllers/ControlPrint.C b/src/frontends/controllers/ControlPrint.C index 18718d24d9..2405bc16a5 100644 --- a/src/frontends/controllers/ControlPrint.C +++ b/src/frontends/controllers/ControlPrint.C @@ -29,7 +29,7 @@ using std::string; namespace lyx { -using support::ChangeExtension; +using support::changeExtension; using support::FileFilterList; namespace frontend { @@ -44,10 +44,10 @@ ControlPrint::ControlPrint(Dialog & parent) bool ControlPrint::initialiseParams(std::string const &) { /// get global printer parameters - string const name = ChangeExtension(kernel().buffer().fileName(), + string const name = changeExtension(kernel().buffer().fileName(), lyxrc.print_file_extension); - params_.reset(new PrinterParams (PrinterParams::PRINTER, - lyxrc.printer, name)); + params_.reset(new PrinterParams(PrinterParams::PRINTER, + lyxrc.printer, name)); dialog().bc().valid(); // so that the user can press Ok return true; diff --git a/src/frontends/controllers/ControlRef.C b/src/frontends/controllers/ControlRef.C index 9260d5db86..e17044a30d 100644 --- a/src/frontends/controllers/ControlRef.C +++ b/src/frontends/controllers/ControlRef.C @@ -26,8 +26,8 @@ extern BufferList bufferlist; namespace lyx { -using support::MakeAbsPath; -using support::MakeDisplayPath; +using support::makeAbsPath; +using support::makeDisplayPath; namespace frontend { @@ -38,7 +38,7 @@ ControlRef::ControlRef(Dialog & d) vector const ControlRef::getLabelList(string const & name) const { - Buffer const & buf = *bufferlist.getBuffer(MakeAbsPath(name)); + Buffer const & buf = *bufferlist.getBuffer(makeAbsPath(name)); vector list; buf.getLabelList(list); return list; @@ -63,7 +63,7 @@ vector const ControlRef::getBufferList() const vector buffers = bufferlist.getFileNames(); for (vector::iterator it = buffers.begin(); it != buffers.end(); ++it) { - *it = MakeDisplayPath(*it); + *it = makeDisplayPath(*it); } return buffers; diff --git a/src/frontends/controllers/ControlSendto.C b/src/frontends/controllers/ControlSendto.C index c58eb7dd45..b083bf3681 100644 --- a/src/frontends/controllers/ControlSendto.C +++ b/src/frontends/controllers/ControlSendto.C @@ -26,7 +26,6 @@ using std::string; namespace lyx { -using support::AddName; using support::trim; namespace frontend { diff --git a/src/frontends/controllers/ControlShowFile.C b/src/frontends/controllers/ControlShowFile.C index 6ffe52a18e..f0239c8f60 100644 --- a/src/frontends/controllers/ControlShowFile.C +++ b/src/frontends/controllers/ControlShowFile.C @@ -17,8 +17,7 @@ using std::string; namespace lyx { -using support::GetFileContents; -using support::OnlyFilename; +using support::onlyFilename; namespace frontend { @@ -43,13 +42,13 @@ void ControlShowFile::clearParams() string ControlShowFile::getFileContents() { - return GetFileContents(filename_); + return support::getFileContents(filename_); } string ControlShowFile::getFileName() { - return OnlyFilename(filename_); + return onlyFilename(filename_); } } // namespace frontend diff --git a/src/frontends/controllers/ControlTexinfo.C b/src/frontends/controllers/ControlTexinfo.C index 6262d4a21e..a6dfab8c2f 100644 --- a/src/frontends/controllers/ControlTexinfo.C +++ b/src/frontends/controllers/ControlTexinfo.C @@ -22,7 +22,7 @@ using std::vector; namespace lyx { -using support::OnlyFilename; +using support::onlyFilename; namespace frontend { @@ -54,7 +54,7 @@ void getTexFileList(ControlTexinfo::texFileSuffix type, vector::iterator it = list.begin(); vector::iterator end = list.end(); for (; it != end; ++it) { - *it = OnlyFilename(*it); + *it = onlyFilename(*it); } // sort on filename only (no path) std::sort(list.begin(), list.end()); diff --git a/src/frontends/controllers/helper_funcs.C b/src/frontends/controllers/helper_funcs.C index ddf9ce9dff..2aa81d893a 100644 --- a/src/frontends/controllers/helper_funcs.C +++ b/src/frontends/controllers/helper_funcs.C @@ -29,15 +29,15 @@ using std::string; namespace lyx { -using support::AddName; -using support::ChangeExtension; +using support::addName; +using support::changeExtension; using support::FileFilterList; -using support::GetExtension; -using support::LibFileSearch; -using support::MakeAbsPath; -using support::MakeRelPath; -using support::OnlyFilename; -using support::OnlyPath; +using support::getExtension; +using support::libFileSearch; +using support::makeAbsPath; +using support::makeRelPath; +using support::onlyFilename; +using support::onlyPath; using support::package; using support::prefixIs; @@ -53,7 +53,7 @@ string const browseFile(string const & filename, { string lastPath("."); if (!filename.empty()) - lastPath = OnlyPath(filename); + lastPath = onlyPath(filename); FileDialog fileDlg(title, LFUN_SELECT_FILE_SYNC, dir1, dir2); @@ -61,10 +61,10 @@ string const browseFile(string const & filename, if (save) result = fileDlg.save(lastPath, filters, - OnlyFilename(filename)); + onlyFilename(filename)); else result = fileDlg.open(lastPath, filters, - OnlyFilename(filename)); + onlyFilename(filename)); return result.second; } @@ -78,11 +78,11 @@ string const browseRelFile(string const & filename, pair const & dir1, pair const & dir2) { - string const fname = MakeAbsPath(filename, refpath); + string const fname = makeAbsPath(filename, refpath); string const outname = browseFile(fname, title, filters, save, dir1, dir2); - string const reloutname = MakeRelPath(outname, refpath); + string const reloutname = makeRelPath(outname, refpath); if (prefixIs(reloutname, "../")) return outname; else @@ -98,24 +98,24 @@ string const browseLibFile(string const & dir, FileFilterList const & filters) { pair const dir1(_("System files|#S#s"), - AddName(package().system_support(), dir)); + addName(package().system_support(), dir)); pair const dir2(_("User files|#U#u"), - AddName(package().user_support(), dir)); + addName(package().user_support(), dir)); - string const result = browseFile(LibFileSearch(dir, name, ext), title, + string const result = browseFile(libFileSearch(dir, name, ext), title, filters, false, dir1, dir2); // remove the extension if it is the default one string noextresult; - if (GetExtension(result) == ext) - noextresult = ChangeExtension(result, string()); + if (getExtension(result) == ext) + noextresult = changeExtension(result, string()); else noextresult = result; // remove the directory, if it is the default one - string const file = OnlyFilename(noextresult); - if (LibFileSearch(dir, file, ext) == result) + string const file = onlyFilename(noextresult); + if (libFileSearch(dir, file, ext) == result) return file; else return noextresult; @@ -129,12 +129,12 @@ string const browseDir(string const & pathname, { string lastPath("."); if (!pathname.empty()) - lastPath = OnlyPath(pathname); + lastPath = onlyPath(pathname); FileDialog fileDlg(title, LFUN_SELECT_FILE_SYNC, dir1, dir2); FileDialog::Result const result = - fileDlg.opendir(lastPath, OnlyFilename(pathname)); + fileDlg.opendir(lastPath, onlyFilename(pathname)); return result.second; } diff --git a/src/frontends/controllers/tex_helpers.C b/src/frontends/controllers/tex_helpers.C index e2aa2d5bb9..4e19b7d3ee 100644 --- a/src/frontends/controllers/tex_helpers.C +++ b/src/frontends/controllers/tex_helpers.C @@ -30,14 +30,14 @@ using std::endl; namespace lyx { using support::contains; -using support::GetExtension; -using support::GetFileContents; +using support::getExtension; +using support::getFileContents; using support::getVectorFromString; -using support::LibFileSearch; -using support::OnlyFilename; +using support::libFileSearch; +using support::onlyFilename; using support::package; using support::Path; -using support::QuoteName; +using support::quoteName; using support::split; using support::Systemcall; using support::token; @@ -53,7 +53,7 @@ void rescanTexStyles() Systemcall one; one.startscript(Systemcall::Wait, "sh " + - QuoteName(LibFileSearch("scripts", "TeXFiles.sh"))); + quoteName(libFileSearch("scripts", "TeXFiles.sh"))); } @@ -71,11 +71,11 @@ void texhash() void getTexFileList(string const & filename, std::vector & list) { list.clear(); - string const file = LibFileSearch("", filename); + string const file = libFileSearch("", filename); if (file.empty()) return; - list = getVectorFromString(GetFileContents(file), "\n"); + list = getVectorFromString(getFileContents(file), "\n"); // Normalise paths like /foo//bar ==> /foo/bar boost::RegEx regex("/{2,}"); @@ -115,7 +115,7 @@ string const getTexFileFromList(string const & file, { string file_ = file; // do we need to add the suffix? - if (!(GetExtension(file) == type)) + if (!(getExtension(file) == type)) file_ += '.' + type; lyxerr << "Searching for file " << file_ << endl; @@ -129,13 +129,13 @@ string const getTexFileFromList(string const & file, lstfile = "bstFiles.lst"; else if (type == "bib") lstfile = "bibFiles.lst"; - string const allClasses = GetFileContents(LibFileSearch(string(), + string const allClasses = getFileContents(libFileSearch(string(), lstfile)); int entries = 0; string classfile = token(allClasses, '\n', entries); int count = 0; while ((!contains(classfile, file) || - (OnlyFilename(classfile) != file)) && + (onlyFilename(classfile) != file)) && (++count < 1000)) { classfile = token(allClasses, '\n', ++entries); } diff --git a/src/frontends/gtk/GAboutlyx.C b/src/frontends/gtk/GAboutlyx.C index abf04e9d27..96d98e5664 100644 --- a/src/frontends/gtk/GAboutlyx.C +++ b/src/frontends/gtk/GAboutlyx.C @@ -29,7 +29,7 @@ #include -using lyx::support::LibFileSearch; +using lyx::support::libFileSearch; using std::ostringstream; using std::string; @@ -173,7 +173,7 @@ void GAboutlyx::doBuild() << controller().getDisclaimer(); dialog->set_license (ls.str()); - string const filename = LibFileSearch("images", "banner", "ppm"); + string const filename = libFileSearch("images", "banner", "ppm"); Glib::RefPtr logo = Gdk::Pixbuf::create_from_file(filename); Glib::RefPtr logo_scaled = logo->scale_simple( logo->get_width() / 2, diff --git a/src/frontends/gtk/GBibtex.C b/src/frontends/gtk/GBibtex.C index 881fe69be9..4bc61f9630 100644 --- a/src/frontends/gtk/GBibtex.C +++ b/src/frontends/gtk/GBibtex.C @@ -27,7 +27,7 @@ #include -using lyx::support::ChangeExtension; +using lyx::support::changeExtension; using lyx::support::split; using lyx::support::trim; @@ -135,7 +135,7 @@ void GBibtex::update() vector::const_iterator it = str.begin(); vector::const_iterator const end = str.end(); for (; it != end; ++it) { - string item(ChangeExtension(*it, "")); + string item(changeExtension(*it, "")); if (item == bibstyle) item_nr = int(it - str.begin()); stylecombo_.append_text (item); @@ -216,7 +216,7 @@ void GBibtex::add() if (new_bib.empty()) return; - new_bib = ChangeExtension(new_bib, string()); + new_bib = changeExtension(new_bib, string()); Gtk::TreeModel::iterator const row = databasesstore_->append(); (*row)[stringcol_] = new_bib; @@ -242,7 +242,7 @@ void GBibtex::browse() string const file = controller().browseBst(""); if (!file.empty()) { - string const filen = ChangeExtension(file, ""); + string const filen = changeExtension(file, ""); bool present = false; for (int i = 0; i < stylecombo_.get_model()->children().size(); ++i) { diff --git a/src/frontends/gtk/GTexinfo.C b/src/frontends/gtk/GTexinfo.C index 38890916fb..5e3616e17b 100644 --- a/src/frontends/gtk/GTexinfo.C +++ b/src/frontends/gtk/GTexinfo.C @@ -28,7 +28,7 @@ using std::string; namespace lyx { -using support::OnlyFilename; +using support::onlyFilename; namespace frontend { diff --git a/src/frontends/gtk/GView.C b/src/frontends/gtk/GView.C index 8d41e47b40..b975a81b4b 100644 --- a/src/frontends/gtk/GView.C +++ b/src/frontends/gtk/GView.C @@ -100,7 +100,7 @@ GView::GView() boost::bind(&GMiniBuffer::editMode, minibuffer_.get())); view_state_changed.connect(boost::bind(&GView::showViewState, this)); signal_focus_in_event().connect(sigc::mem_fun(*this, &GView::onFocusIn)); - // + // int width = 750; int height = 550; // first try lyxrc @@ -116,12 +116,12 @@ GView::GView() val = LyX::ref().session().loadSessionInfo("WindowHeight"); if (val != "") height = convert(val); - } + } set_default_size(width, height); // Make sure the buttons are disabled if needed. updateToolbars(); string const iconName = - support::LibFileSearch("images", "lyx", "xpm"); + support::libFileSearch("images", "lyx", "xpm"); if (!iconName.empty()) set_icon_from_file(iconName); } diff --git a/src/frontends/gtk/GViewBase.C b/src/frontends/gtk/GViewBase.C index 9b071d748e..71dfdefe03 100644 --- a/src/frontends/gtk/GViewBase.C +++ b/src/frontends/gtk/GViewBase.C @@ -47,7 +47,7 @@ void GViewBase::build() { doBuild(); string const iconName = - support::LibFileSearch("images", "lyx", "xpm"); + support::libFileSearch("images", "lyx", "xpm"); if (!iconName.empty()) window()->set_icon_from_file(iconName); window()->signal_delete_event().connect( diff --git a/src/frontends/gtk/ghelpers.C b/src/frontends/gtk/ghelpers.C index 5d0b89fb87..fdf5e2fbbe 100644 --- a/src/frontends/gtk/ghelpers.C +++ b/src/frontends/gtk/ghelpers.C @@ -61,7 +61,7 @@ Gtk::BuiltinStockID getGTKStockIcon(FuncRequest const & func) case LFUN_ITAL: return Gtk::Stock::ITALIC; case LFUN_FILE_OPEN: return Gtk::Stock::OPEN; case LFUN_RECONFIGURE: return Gtk::Stock::REFRESH; - case LFUN_LABEL_GOTO: + case LFUN_LABEL_GOTO: case LFUN_BOOKMARK_GOTO: return Gtk::Stock::JUMP_TO; case LFUN_GOTONOTE: return Gtk::Stock::GO_FORWARD; case LFUN_ACCEPT_ALL_CHANGES: return Gtk::Stock::APPLY; @@ -138,7 +138,7 @@ Glib::ustring getGTKThemeIcon(FuncRequest const & func) else if (func.argument == "align-right") return "gtk-justify-right"; break; - + case LFUN_BOOKMARK_SAVE: return "stock_add-bookmark"; case LFUN_INSERT_NOTE: return "stock_insert-note"; case LFUN_LAYOUT_PARAGRAPH: return "stock_format-paragraph"; @@ -160,7 +160,7 @@ Gtk::Image *getGTKIcon(FuncRequest const & func, Gtk::IconSize const & size) int iconheight = 16; Gtk::IconSize::lookup(size, iconwidth, iconheight); - // TODO: this stuff is called every menu view - needs + // TODO: this stuff is called every menu view - needs // caching somewhere, or maybe GTK does enough of that for us. Gtk::Image *image = NULL; Gtk::BuiltinStockID const stockID = getGTKStockIcon(func); @@ -177,7 +177,7 @@ Gtk::Image *getGTKIcon(FuncRequest const & func, Gtk::IconSize const & size) } } } - + return image; } @@ -200,9 +200,9 @@ string const getDefaultUnit() void unitsComboFromLength(Gtk::ComboBox * combo, - Gtk::TreeModelColumn const & stringcol, - LyXLength const & len, - std::string const & defunit) + Gtk::TreeModelColumn const & stringcol, + LyXLength const & len, + std::string const & defunit) { string unit = stringFromUnit(len.unit()); if (unit.empty()) @@ -244,18 +244,18 @@ string const findGladeFile(string const & name) { // First, search in the installation directories. - string filename = lyx::support::LibFileSearch("glade", name, "glade"); + string filename = lyx::support::libFileSearch("glade", name, "glade"); if (!filename.empty()) return filename; // Second, search in the src tree. string const dir = - lyx::support::AddPath(lyx::support::package().top_srcdir(), + lyx::support::addPath(lyx::support::package().top_srcdir(), "src/frontends/gtk/glade"); - filename = lyx::support::ChangeExtension(name, ".glade"); - filename = lyx::support::AddName(dir, filename); + filename = lyx::support::changeExtension(name, ".glade"); + filename = lyx::support::addName(dir, filename); if (!lyx::support::isFileReadable(filename)) { lyxerr << "Unable to find glade file \"" << name diff --git a/src/frontends/qt2/BulletsModule.C b/src/frontends/qt2/BulletsModule.C index 05e2826670..6e9a2b8508 100644 --- a/src/frontends/qt2/BulletsModule.C +++ b/src/frontends/qt2/BulletsModule.C @@ -24,7 +24,7 @@ #include -using lyx::support::LibFileSearch; +using lyx::support::libFileSearch; using std::string; @@ -84,22 +84,22 @@ BulletsModule::BulletsModule(QWidget * parent, const char * name, WFlags fl) // insert pixmaps string bmfile; - bmfile = LibFileSearch("images", "standard", "xpm"); + bmfile = libFileSearch("images", "standard", "xpm"); standard_->insertItem(QPixmap(toqstr(bmfile))); - bmfile = LibFileSearch("images", "amssymb", "xpm"); + bmfile = libFileSearch("images", "amssymb", "xpm"); maths_->insertItem(QPixmap(toqstr(bmfile))); - bmfile = LibFileSearch("images", "psnfss1", "xpm"); + bmfile = libFileSearch("images", "psnfss1", "xpm"); ding1_->insertItem(QPixmap(toqstr(bmfile))); - bmfile = LibFileSearch("images", "psnfss2", "xpm"); + bmfile = libFileSearch("images", "psnfss2", "xpm"); ding2_->insertItem(QPixmap(toqstr(bmfile))); - bmfile = LibFileSearch("images", "psnfss3", "xpm"); + bmfile = libFileSearch("images", "psnfss3", "xpm"); ding3_->insertItem(QPixmap(toqstr(bmfile))); - bmfile = LibFileSearch("images", "psnfss4", "xpm"); + bmfile = libFileSearch("images", "psnfss4", "xpm"); ding4_->insertItem(QPixmap(toqstr(bmfile))); connect(standard_, SIGNAL(selected(int, int)), diff --git a/src/frontends/qt2/QBibtex.C b/src/frontends/qt2/QBibtex.C index eb80229276..2a1e30b826 100644 --- a/src/frontends/qt2/QBibtex.C +++ b/src/frontends/qt2/QBibtex.C @@ -32,7 +32,7 @@ #include -using lyx::support::ChangeExtension; +using lyx::support::changeExtension; using lyx::support::split; using lyx::support::trim; @@ -92,7 +92,7 @@ void QBibtex::update_contents() controller().getBibFiles(bib_str); for (vector::const_iterator it = bib_str.begin(); it != bib_str.end(); ++it) { - string bibItem(ChangeExtension(*it, "")); + string bibItem(changeExtension(*it, "")); dialog_->add_->bibLB->insertItem(toqstr(bibItem)); } @@ -118,7 +118,7 @@ void QBibtex::update_contents() controller().getBibStyles(str); for (vector::const_iterator it = str.begin(); it != str.end(); ++it) { - string item(ChangeExtension(*it, "")); + string item(changeExtension(*it, "")); if (item == bibstyle) item_nr = int(it - str.begin()); dialog_->styleCB->insertItem(toqstr(item)); diff --git a/src/frontends/qt2/QBibtexDialog.C b/src/frontends/qt2/QBibtexDialog.C index cbd6061aa0..38f5938b09 100644 --- a/src/frontends/qt2/QBibtexDialog.C +++ b/src/frontends/qt2/QBibtexDialog.C @@ -30,7 +30,7 @@ #include #include -using lyx::support::ChangeExtension; +using lyx::support::changeExtension; using lyx::support::trim; using std::string; @@ -97,7 +97,7 @@ void QBibtexDialog::browsePressed() string const file = form_->controller().browseBst(""); if (!file.empty()) { - string const filen = ChangeExtension(file, ""); + string const filen = changeExtension(file, ""); bool present = false; unsigned int pres = 0; @@ -122,7 +122,7 @@ void QBibtexDialog::browseBibPressed() string const file = trim(form_->controller().browseBib("")); if (!file.empty()) { - string const f = ChangeExtension(file, ""); + string const f = changeExtension(file, ""); bool present = false; for (unsigned int i = 0; i != add_->bibLB->count(); i++) { @@ -166,7 +166,7 @@ void QBibtexDialog::addDatabase() } if (!file.empty()) { - QString const f = toqstr(ChangeExtension(file, "")); + QString const f = toqstr(changeExtension(file, "")); if ((databaseLB->findItem(f)) == 0) databaseLB->insertItem(f); } diff --git a/src/frontends/qt2/QCommandBuffer.C b/src/frontends/qt2/QCommandBuffer.C index 7ec5bb27a4..65d29bf99c 100644 --- a/src/frontends/qt2/QCommandBuffer.C +++ b/src/frontends/qt2/QCommandBuffer.C @@ -27,7 +27,7 @@ #include #include -using lyx::support::LibFileSearch; +using lyx::support::libFileSearch; using std::vector; using std::string; @@ -69,8 +69,8 @@ protected: QCommandBuffer::QCommandBuffer(QtView * view, QWidget * parent, ControlCommandBuffer & control) : QWidget(parent), view_(view), controller_(control) { - QPixmap qpup(toqstr(LibFileSearch("images", "up", "xpm"))); - QPixmap qpdown(toqstr(LibFileSearch("images", "down", "xpm"))); + QPixmap qpup(toqstr(libFileSearch("images", "up", "xpm"))); + QPixmap qpdown(toqstr(libFileSearch("images", "down", "xpm"))); QVBoxLayout * top = new QVBoxLayout(this); QHBoxLayout * layout = new QHBoxLayout(0); diff --git a/src/frontends/qt2/QTexinfo.C b/src/frontends/qt2/QTexinfo.C index 4a993f7bb5..87055d2fd0 100644 --- a/src/frontends/qt2/QTexinfo.C +++ b/src/frontends/qt2/QTexinfo.C @@ -21,7 +21,7 @@ #include #include -using lyx::support::OnlyFilename; +using lyx::support::onlyFilename; using std::string; diff --git a/src/frontends/qt2/QtView.C b/src/frontends/qt2/QtView.C index b83a767e4b..492e9fdc64 100644 --- a/src/frontends/qt2/QtView.C +++ b/src/frontends/qt2/QtView.C @@ -43,7 +43,7 @@ FontLoader fontloader; namespace lyx { -using support::LibFileSearch; +using support::libFileSearch; namespace frontend { @@ -75,7 +75,7 @@ QtView::QtView(unsigned int width, unsigned int height) #ifndef Q_WS_MACX // assign an icon to main form. We do not do it under Qt/Mac, // since the icon is provided in the application bundle. - string const iconname = LibFileSearch("images", "lyx", "xpm"); + string const iconname = libFileSearch("images", "lyx", "xpm"); if (!iconname.empty()) setIcon(QPixmap(toqstr(iconname))); #endif diff --git a/src/frontends/qt2/qfont_loader.C b/src/frontends/qt2/qfont_loader.C index 6c22ac193e..1ca348bb69 100644 --- a/src/frontends/qt2/qfont_loader.C +++ b/src/frontends/qt2/qfont_loader.C @@ -35,9 +35,9 @@ #endif using lyx::support::contains; -using lyx::support::LibFileSearch; -using lyx::support::OnlyPath; -using lyx::support::QuoteName; +using lyx::support::libFileSearch; +using lyx::support::onlyPath; +using lyx::support::quoteName; using lyx::support::Systemcall; using std::endl; diff --git a/src/frontends/screen.C b/src/frontends/screen.C index fd3d3ec55b..2f2636ef7a 100644 --- a/src/frontends/screen.C +++ b/src/frontends/screen.C @@ -44,7 +44,7 @@ #include #include -using lyx::support::LibFileSearch; +using lyx::support::libFileSearch; using std::endl; using std::min; @@ -102,7 +102,7 @@ SplashScreen::SplashScreen() if (!lyxrc.show_banner) return; - string const file = LibFileSearch("images", "banner", "ppm"); + string const file = libFileSearch("images", "banner", "ppm"); if (file.empty()) return; diff --git a/src/frontends/xforms/FormBibtex.C b/src/frontends/xforms/FormBibtex.C index 5ada2bfac0..7bc5296d41 100644 --- a/src/frontends/xforms/FormBibtex.C +++ b/src/frontends/xforms/FormBibtex.C @@ -32,12 +32,12 @@ using std::string; namespace lyx { -using support::ChangeExtension; +using support::changeExtension; using support::compare; using support::FileFilterList; using support::getStringFromVector; using support::getVectorFromString; -using support::OnlyFilename; +using support::onlyFilename; using support::split; namespace frontend { @@ -148,7 +148,7 @@ ButtonPolicy::SMInput FormBibtex::input(FL_OBJECT * ob, long ob_value) return ButtonPolicy::SMI_NOOP; } else { fl_set_input(dialog_->input_style, - ChangeExtension(style, "").c_str()); + changeExtension(style, "").c_str()); } // reset the browser so that the following // single-click callback doesn't do anything @@ -211,7 +211,7 @@ string const unique_and_no_extensions(string const & str_in) vector dbase = getVectorFromString(str_in); for (vector::iterator it = dbase.begin(); it != dbase.end(); ++it) { - *it = ChangeExtension(*it, string()); + *it = changeExtension(*it, string()); } eliminate_duplicates(dbase); return getStringFromVector(dbase); @@ -237,7 +237,7 @@ void FormBibtex::apply() string bibstyle = getString(dialog_->input_style); if (!bibstyle.empty()) { // save the BibTeX style without any ".bst" extension - bibstyle = ChangeExtension(OnlyFilename(bibstyle), ""); + bibstyle = changeExtension(onlyFilename(bibstyle), ""); } bool const addtotoc = fl_get_button(dialog_->check_bibtotoc); diff --git a/src/frontends/xforms/FormColorpicker.C b/src/frontends/xforms/FormColorpicker.C index d235741d50..47f59faafe 100644 --- a/src/frontends/xforms/FormColorpicker.C +++ b/src/frontends/xforms/FormColorpicker.C @@ -286,7 +286,7 @@ void FormColorpicker::prepare_to_show() // assign an icon to the form string const iconname = - support::LibFileSearch("images", "lyx", "xpm"); + support::libFileSearch("images", "lyx", "xpm"); if (!iconname.empty()) { unsigned int w, h; diff --git a/src/frontends/xforms/FormDialogView.C b/src/frontends/xforms/FormDialogView.C index 13b0822ade..1c873abfbf 100644 --- a/src/frontends/xforms/FormDialogView.C +++ b/src/frontends/xforms/FormDialogView.C @@ -31,7 +31,7 @@ using std::string; namespace lyx { using support::bformat; -using support::LibFileSearch; +using support::libFileSearch; namespace frontend { @@ -114,7 +114,7 @@ void FormDialogView::prepare_to_show() fl_winicontitle(form()->window, getTitle().c_str()); // assign an icon to the form - string const iconname = LibFileSearch("images", "lyx", "xpm"); + string const iconname = libFileSearch("images", "lyx", "xpm"); if (!iconname.empty()) { unsigned int w, h; icon_pixmap_ = fl_read_pixmapfile(fl_root, diff --git a/src/frontends/xforms/FormDocument.C b/src/frontends/xforms/FormDocument.C index d3bc408374..2ae5cd4bce 100644 --- a/src/frontends/xforms/FormDocument.C +++ b/src/frontends/xforms/FormDocument.C @@ -62,7 +62,7 @@ using support::bformat; using support::contains; using support::getStringFromVector; using support::getVectorFromString; -using support::LibFileSearch; +using support::libFileSearch; namespace frontend { @@ -365,7 +365,7 @@ void FormDocument::build() fl_set_input_maxchars(bullets_->input_latex, 80); - string const bmtablefile = LibFileSearch("images", "standard", "xpm"); + string const bmtablefile = libFileSearch("images", "standard", "xpm"); fl_set_bmtable_pixmap_file(bullets_->bmtable_panel, 6, 6, bmtablefile.c_str()); @@ -1428,7 +1428,7 @@ void FormDocument::BulletPanel(FL_OBJECT * ob) } new_panel += ".xpm"; fl_set_bmtable_pixmap_file(bullets_->bmtable_panel, 6, 6, - LibFileSearch("images", new_panel).c_str()); + libFileSearch("images", new_panel).c_str()); fl_redraw_object(bullets_->bmtable_panel); fl_unfreeze_form(bullets_->form); } diff --git a/src/frontends/xforms/FormFiledialog.C b/src/frontends/xforms/FormFiledialog.C index 1c5f75ddf6..7b561b563c 100644 --- a/src/frontends/xforms/FormFiledialog.C +++ b/src/frontends/xforms/FormFiledialog.C @@ -35,13 +35,13 @@ #include #include -using lyx::support::AbsolutePath; -using lyx::support::AddName; -using lyx::support::ExpandPath; +using lyx::support::absolutePath; +using lyx::support::addName; +using lyx::support::expandPath; using lyx::support::FileFilterList; using lyx::support::getcwd; -using lyx::support::MakeAbsPath; -using lyx::support::OnlyFilename; +using lyx::support::makeAbsPath; +using lyx::support::onlyFilename; using lyx::support::package; using lyx::support::split; using lyx::support::suffixIs; @@ -228,7 +228,7 @@ void FileDialog::Private::SetDirectory(string const & path) if (path.empty()) tmp = getcwd(); else - tmp = MakeAbsPath(ExpandPath(path), directory_); + tmp = makeAbsPath(expandPath(path), directory_); // must check the directory exists if (!fs::exists(tmp) || !fs::is_directory(tmp)) { @@ -274,7 +274,7 @@ void FileDialog::Private::SetFilters(FileFilterList const & filters) FileDialog::Private::Private() { - directory_ = MakeAbsPath(string(".")); + directory_ = makeAbsPath(string(".")); // Creates form if necessary. if (!file_dlg_form_) { @@ -591,7 +591,7 @@ string const FileDialog::Private::Select(string const & title, // highlight the suggested file in the browser, if it exists. int sel = 0; - string const filename = OnlyFilename(suggested); + string const filename = onlyFilename(suggested); if (!filename.empty()) { for (int i = 0; i < fl_get_browser_maxline(file_dlg_form_->List); ++i) { string s = fl_get_browser_line(file_dlg_form_->List, i + 1); @@ -642,8 +642,8 @@ string const FileDialog::Private::Select(string const & title, file_name_ = fl_get_input(file_dlg_form_->Filename); - if (!AbsolutePath(file_name_)) - file_name_ = AddName(fl_get_input(file_dlg_form_->DirBox), file_name_); + if (!absolutePath(file_name_)) + file_name_ = addName(fl_get_input(file_dlg_form_->DirBox), file_name_); return file_name_; } diff --git a/src/frontends/xforms/FormPreferences.C b/src/frontends/xforms/FormPreferences.C index 715f0cc109..3cc85e5050 100644 --- a/src/frontends/xforms/FormPreferences.C +++ b/src/frontends/xforms/FormPreferences.C @@ -52,8 +52,8 @@ using std::string; namespace lyx { -using support::AddName; -using support::ChangeExtension; +using support::addName; +using support::changeExtension; using support::package; using support::rtrim; using support::trim; @@ -308,7 +308,7 @@ void FormPreferences::apply() // The "Save" button has been pressed. if (dialog().isClosing() && colors_.modifiedXformsPrefs) { string const filename = - AddName(package().user_support(), "preferences.xform"); + addName(package().user_support(), "preferences.xform"); colors_.modifiedXformsPrefs = !XformsColor::write(filename); } } @@ -2341,7 +2341,7 @@ bool FormPreferences::Paths::input(FL_OBJECT const * const ob) string const name = getString(dialog_->input_serverpipe); if (!name.empty()) { // strip off the extension - string const str = ChangeExtension(name, ""); + string const str = changeExtension(name, ""); if (!RWInfo::WriteableFile(str + ".in")) { parent_.postWarning(RWInfo::ErrorMessage()); return false; diff --git a/src/frontends/xforms/FormTexinfo.C b/src/frontends/xforms/FormTexinfo.C index c0b1ad6cd1..98677ef2ce 100644 --- a/src/frontends/xforms/FormTexinfo.C +++ b/src/frontends/xforms/FormTexinfo.C @@ -24,8 +24,6 @@ using std::string; namespace lyx { -using support::OnlyFilename; - namespace frontend { diff --git a/src/frontends/xforms/XFormsView.C b/src/frontends/xforms/XFormsView.C index 0206a6907b..f13ca1f336 100644 --- a/src/frontends/xforms/XFormsView.C +++ b/src/frontends/xforms/XFormsView.C @@ -42,7 +42,7 @@ extern void QuitLyX(bool); namespace lyx { -using support::LibFileSearch; +using support::libFileSearch; namespace frontend { @@ -112,7 +112,7 @@ XFormsView::XFormsView(int width, int height) minibuffer_.reset(new XMiniBuffer(*this, *controlcommand_)); // Assign an icon to the main form. - string const iconname = LibFileSearch("images", "lyx", "xpm"); + string const iconname = libFileSearch("images", "lyx", "xpm"); if (!iconname.empty()) { unsigned int w, h; icon_pixmap_ = fl_read_pixmapfile(fl_root, diff --git a/src/frontends/xforms/lyx_gui.C b/src/frontends/xforms/lyx_gui.C index 809e834693..a35383f3e2 100644 --- a/src/frontends/xforms/lyx_gui.C +++ b/src/frontends/xforms/lyx_gui.C @@ -49,7 +49,7 @@ #include #include -using lyx::support::AddName; +using lyx::support::addName; using lyx::support::package; using lyx::frontend::fontloader; @@ -204,7 +204,7 @@ void parse_init(int & argc, char * argv[]) void parse_lyxrc() { - XformsColor::read(AddName(package().user_support(), + XformsColor::read(addName(package().user_support(), "preferences.xform")); if (lyxrc.popup_font_encoding.empty()) diff --git a/src/frontends/xforms/xfont_loader.C b/src/frontends/xforms/xfont_loader.C index c9c09d8257..de05c79192 100644 --- a/src/frontends/xforms/xfont_loader.C +++ b/src/frontends/xforms/xfont_loader.C @@ -32,8 +32,6 @@ using std::string; namespace lyx { -using support::LibFileSearch; -using support::OnlyPath; using support::Systemcall; namespace frontend { diff --git a/src/frontends/xforms/xforms_helpers.C b/src/frontends/xforms/xforms_helpers.C index a77ec91944..621de8c7a8 100644 --- a/src/frontends/xforms/xforms_helpers.C +++ b/src/frontends/xforms/xforms_helpers.C @@ -41,9 +41,9 @@ namespace fs = boost::filesystem; namespace lyx { -using support::AbsolutePath; +using support::absolutePath; using support::isStrDbl; -using support::OnlyPath; +using support::onlyPath; using support::subst; using support::trim; @@ -417,7 +417,7 @@ bool RWInfo::WriteableDir(string const & name) { error_message.erase(); - if (!AbsolutePath(name)) { + if (!absolutePath(name)) { error_message = _("The absolute path is required."); return false; } @@ -440,7 +440,7 @@ bool RWInfo::ReadableDir(string const & name) { error_message.erase(); - if (!AbsolutePath(name)) { + if (!absolutePath(name)) { error_message = _("The absolute path is required."); return false; } @@ -473,8 +473,8 @@ bool RWInfo::WriteableFile(string const & name) return false; } - string const dir = OnlyPath(name); - if (!AbsolutePath(dir)) { + string const dir = onlyPath(name); + if (!absolutePath(dir)) { error_message = _("The absolute path is required."); return false; } @@ -518,8 +518,8 @@ bool RWInfo::ReadableFile(string const & name) return false; } - string const dir = OnlyPath(name); - if (!AbsolutePath(dir)) { + string const dir = onlyPath(name); + if (!absolutePath(dir)) { error_message = _("The absolute path is required."); return false; } diff --git a/src/graphics/GraphicsCache.C b/src/graphics/GraphicsCache.C index 633ecb505b..de5b63ad4c 100644 --- a/src/graphics/GraphicsCache.C +++ b/src/graphics/GraphicsCache.C @@ -66,7 +66,7 @@ std::vector Cache::loadableFormats() const void Cache::add(string const & file) const { - if (!support::AbsolutePath(file)) { + if (!support::absolutePath(file)) { lyxerr << "Cache::add(" << file << "):\n" << "The file must be have an absolute path." << std::endl; diff --git a/src/graphics/GraphicsCacheItem.C b/src/graphics/GraphicsCacheItem.C index e0cd2c7a95..2e47d58a16 100644 --- a/src/graphics/GraphicsCacheItem.C +++ b/src/graphics/GraphicsCacheItem.C @@ -28,11 +28,11 @@ namespace support = lyx::support; -using support::ChangeExtension; +using support::changeExtension; using support::FileMonitor; using support::isFileReadable; -using support::MakeDisplayPath; -using support::OnlyFilename; +using support::makeDisplayPath; +using support::onlyFilename; using support::tempName; using support::unlink; using support::unzipFile; @@ -402,7 +402,7 @@ void CacheItem::Impl::convertToDisplayFormat() } else filename = filename_; - string const displayed_filename = MakeDisplayPath(filename_); + string const displayed_filename = makeDisplayPath(filename_); lyxerr[Debug::GRAPHICS] << "[GrahicsCacheItem::convertToDisplayFormat]\n" << "\tAttempting to convert image file: " << filename << "\n\twith displayed filename: " << displayed_filename @@ -428,7 +428,7 @@ void CacheItem::Impl::convertToDisplayFormat() lyxerr[Debug::GRAPHICS] << "\tConverting it to " << to << " format." << endl; // Take only the filename part of the file, without path or extension. - string const temp = ChangeExtension(OnlyFilename(filename), string()); + string const temp = changeExtension(onlyFilename(filename), string()); // Add some stuff to create a uniquely named temporary file. // This file is deleted in loadImage after it is loaded into memory. diff --git a/src/graphics/GraphicsConverter.C b/src/graphics/GraphicsConverter.C index a9b21a8e52..179e74a826 100644 --- a/src/graphics/GraphicsConverter.C +++ b/src/graphics/GraphicsConverter.C @@ -29,14 +29,14 @@ namespace support = lyx::support; -using support::ChangeExtension; +using support::changeExtension; using support::Forkedcall; using support::ForkedCallQueue; -using support::LibFileSearch; -using support::LibScriptSearch; -using support::OnlyPath; -using support::OnlyFilename; -using support::QuoteName; +using support::libFileSearch; +using support::libScriptSearch; +using support::onlyPath; +using support::onlyFilename; +using support::quoteName; using support::subst; using support::tempName; using support::unlink; @@ -168,11 +168,11 @@ Converter::Impl::Impl(string const & from_file, string const & to_file_base, if (!success) { script_command_ = "sh " + - QuoteName(LibFileSearch("scripts", "convertDefault.sh")) + + quoteName(libFileSearch("scripts", "convertDefault.sh")) + ' ' + - QuoteName((from_format.empty() ? "" : from_format + ':') + from_file) + + quoteName((from_format.empty() ? "" : from_format + ':') + from_file) + ' ' + - QuoteName(to_format + ':' + to_file_); + quoteName(to_format + ':' + to_file_); lyxerr[Debug::GRAPHICS] << "\tNo converter defined! I use convertDefault.sh\n\t" @@ -187,7 +187,7 @@ Converter::Impl::Impl(string const & from_file, string const & to_file_base, // Output the script to file. static int counter = 0; - script_file_ = OnlyPath(to_file_base) + "lyxconvert" + + script_file_ = onlyPath(to_file_base) + "lyxconvert" + convert(counter++) + ".sh"; std::ofstream fs(script_file_.c_str()); @@ -206,9 +206,9 @@ Converter::Impl::Impl(string const & from_file, string const & to_file_base, // We create a dummy command for ease of understanding of the // list of forked processes. // Note: 'sh ' is absolutely essential, or execvp will fail. - script_command_ = "sh " + QuoteName(script_file_) + ' ' + - QuoteName(OnlyFilename(from_file)) + ' ' + - QuoteName(to_format); + script_command_ = "sh " + quoteName(script_file_) + ' ' + + quoteName(onlyFilename(from_file)) + ' ' + + quoteName(to_format); } // All is ready to go valid_process_ = true; @@ -292,7 +292,7 @@ bool build_script(string const & from_file, + formats.extension(to_format); if (from_format == to_format) { - script << move_file(QuoteName(from_file), QuoteName(to_file)); + script << move_file(quoteName(from_file), quoteName(to_file)); lyxerr[Debug::GRAPHICS] << "ready (from == to)" << endl; return true; } @@ -327,19 +327,19 @@ bool build_script(string const & from_file, // Build the conversion command string const infile = outfile; - string const infile_base = ChangeExtension(infile, string()); - outfile = ChangeExtension(to_base, conv.To->extension()); + string const infile_base = changeExtension(infile, string()); + outfile = changeExtension(to_base, conv.To->extension()); // Store these names in the shell script - script << "infile=" << QuoteName(infile) << '\n' - << "infile_base=" << QuoteName(infile_base) << '\n' - << "outfile=" << QuoteName(outfile) << '\n'; + script << "infile=" << quoteName(infile) << '\n' + << "infile_base=" << quoteName(infile_base) << '\n' + << "outfile=" << quoteName(outfile) << '\n'; string command = conv.command; command = subst(command, token_from, "\"${infile}\""); command = subst(command, token_base, "\"${infile_base}\""); command = subst(command, token_to, "\"${outfile}\""); - command = LibScriptSearch(command); + command = libScriptSearch(command); // Store in the shell script script << "\n" << command << " ||\n"; @@ -372,7 +372,7 @@ bool build_script(string const & from_file, } // Move the final outfile to to_file - script << move_file("\"${outfile}\"", QuoteName(to_file)); + script << move_file("\"${outfile}\"", quoteName(to_file)); lyxerr[Debug::GRAPHICS] << "ready!" << endl; return true; diff --git a/src/graphics/PreviewLoader.C b/src/graphics/PreviewLoader.C index b2a63b753b..058ceeecb9 100644 --- a/src/graphics/PreviewLoader.C +++ b/src/graphics/PreviewLoader.C @@ -498,12 +498,12 @@ void PreviewLoader::Impl::startLoading() // The conversion command. ostringstream cs; cs << pconverter_->command << ' ' << pconverter_->to << ' ' - << support::QuoteName(latexfile) << ' ' + << support::quoteName(latexfile) << ' ' << int(font_scaling_factor_) << ' ' << lyx_gui::hexname(LColor::preview) << ' ' << lyx_gui::hexname(LColor::background); - string const command = support::LibScriptSearch(cs.str()); + string const command = support::libScriptSearch(cs.str()); // Initiate the conversion from LaTeX to bitmap images files. support::Forkedcall::SignalTypePtr @@ -654,7 +654,7 @@ string const unique_filename(string const bufferpath) { static int theCounter = 0; string const filename = convert(theCounter++) + "lyxpreview"; - return support::AddName(bufferpath, filename); + return support::addName(bufferpath, filename); } diff --git a/src/importer.C b/src/importer.C index 4dd895084e..da876d536f 100644 --- a/src/importer.C +++ b/src/importer.C @@ -25,8 +25,8 @@ #include "BufferView.h" using lyx::support::bformat; -using lyx::support::ChangeExtension; -using lyx::support::MakeDisplayPath; +using lyx::support::changeExtension; +using lyx::support::makeDisplayPath; using std::find; using std::string; @@ -40,10 +40,10 @@ extern void InsertAsciiFile(BufferView *, string const &, bool); bool Importer::Import(LyXView * lv, string const & filename, string const & format) { - string const displaypath = MakeDisplayPath(filename); + string const displaypath = makeDisplayPath(filename); lv->message(bformat(_("Importing %1$s..."), displaypath)); - string const lyxfile = ChangeExtension(filename, ".lyx"); + string const lyxfile = changeExtension(filename, ".lyx"); string loader_format; vector loaders = Loaders(); @@ -74,7 +74,7 @@ bool Importer::Import(LyXView * lv, string const & filename, lv->view()->newFile(lyxfile, string(), true); bool as_paragraphs = loader_format == "textparagraph"; string filename2 = (loader_format == format) ? filename - : ChangeExtension(filename, + : changeExtension(filename, formats.extension(loader_format)); InsertAsciiFile(lv->view().get(), filename2, as_paragraphs); lv->dispatch(FuncRequest(LFUN_MARK_OFF)); diff --git a/src/insets/ExternalSupport.C b/src/insets/ExternalSupport.C index c52a0c7d13..d8fd28e7bd 100644 --- a/src/insets/ExternalSupport.C +++ b/src/insets/ExternalSupport.C @@ -94,23 +94,23 @@ 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); + string const basename = support::changeExtension( + support::onlyFilename(filename), string()); + string const absname = support::makeAbsPath(filename, parentpath); string result = s; if (what != ALL_BUT_PATHS) { - string const filepath = support::OnlyPath(filename); - string const abspath = support::OnlyPath(absname); + string const filepath = support::onlyPath(filename); + string const abspath = support::onlyPath(absname); string const masterpath = external_in_tmpdir ? m_buffer->temppath() : m_buffer->filePath(); - string relToMasterPath = support::OnlyPath( - support::MakeRelPath(absname, masterpath)); + string relToMasterPath = support::onlyPath( + support::makeRelPath(absname, masterpath)); if (relToMasterPath == "./") relToMasterPath.clear(); - string relToParentPath = support::OnlyPath( - support::MakeRelPath(absname, parentpath)); + string relToParentPath = support::onlyPath( + support::makeRelPath(absname, parentpath)); if (relToParentPath == "./") relToParentPath.clear(); @@ -130,7 +130,7 @@ string const doSubstitution(InsetExternalParams const & params, relToParentPath, use_latex_path, support::PROTECT_EXTENSION, support::ESCAPE_DOTS); - if (support::AbsolutePath(filename)) { + if (support::absolutePath(filename)) { result = subst_path(result, "$$AbsOrRelPathMaster", abspath, use_latex_path, support::PROTECT_EXTENSION, @@ -159,7 +159,7 @@ string const doSubstitution(InsetExternalParams const & params, result = subst_path(result, "$$Basename", basename, use_latex_path, support::PROTECT_EXTENSION, support::ESCAPE_DOTS); result = subst_path(result, "$$Extension", - '.' + support::GetExtension(filename), use_latex_path); + '.' + support::getExtension(filename), use_latex_path); result = subst_path(result, "$$Tempname", params.tempname(), use_latex_path); result = subst_path(result, "$$Sysdir", support::package().system_support(), use_latex_path); @@ -177,7 +177,7 @@ string const doSubstitution(InsetExternalParams const & params, support::Path p(filepath); if (support::isFileReadable(file)) - contents = support::GetFileContents(file); + contents = support::getFileContents(file); result = support::subst(result, ("$$Contents(\"" + file + "\")").c_str(), @@ -252,7 +252,7 @@ void updateExternal(InsetExternalParams const & params, // We copy the source file to the temp dir and do the conversion // there if necessary string const temp_file = - support::MakeAbsPath(params.filename.mangledFilename(), + support::makeAbsPath(params.filename.mangledFilename(), m_buffer->temppath()); if (!abs_from_file.empty()) { unsigned long const from_checksum = support::sum(abs_from_file); @@ -275,7 +275,7 @@ void updateExternal(InsetExternalParams const & params, outputFormat.updateResult, false, true); string const abs_to_file = - support::MakeAbsPath(to_file, m_buffer->temppath()); + support::makeAbsPath(to_file, m_buffer->temppath()); // Record the referenced files for the exporter. // The exporter will copy them to the export dir. @@ -286,7 +286,7 @@ void updateExternal(InsetExternalParams const & params, vector::const_iterator fit = rit->second.begin(); vector::const_iterator fend = rit->second.end(); for (; fit != fend; ++fit) { - string const source = support::MakeAbsPath( + string const source = support::makeAbsPath( doSubstitution(params, buffer, *fit, false, true), m_buffer->temppath()); @@ -312,7 +312,7 @@ void updateExternal(InsetExternalParams const & params, if (support::compare_timestamps(temp_file, abs_to_file) < 0) return; // SUCCESS string const to_file_base = - support::ChangeExtension(to_file, string()); + support::changeExtension(to_file, string()); /* bool const success = */ converters.convert(&buffer, temp_file, to_file_base, from_format, to_format, true); diff --git a/src/insets/ExternalTemplate.C b/src/insets/ExternalTemplate.C index 5653623d4d..df79354da6 100644 --- a/src/insets/ExternalTemplate.C +++ b/src/insets/ExternalTemplate.C @@ -246,7 +246,7 @@ void TemplateManager::readTemplates(string const & path) LyXLex lex(templatetags, TM_TEMPLATE_END); - string filename = support::LibFileSearch("", "external_templates"); + string filename = support::libFileSearch("", "external_templates"); if (filename.empty() || !lex.setFile(filename)) { lex.printError("external::TemplateManager::readTemplates: " "No template file"); diff --git a/src/insets/insetbibtex.C b/src/insets/insetbibtex.C index 2a5ee6f4ce..7222ce061d 100644 --- a/src/insets/insetbibtex.C +++ b/src/insets/insetbibtex.C @@ -36,9 +36,9 @@ #include #include -using lyx::support::AbsolutePath; +using lyx::support::absolutePath; using lyx::support::ascii_lowercase; -using lyx::support::ChangeExtension; +using lyx::support::changeExtension; using lyx::support::contains; using lyx::support::copy; using lyx::support::FileName; @@ -46,8 +46,8 @@ using lyx::support::findtexfile; using lyx::support::isFileReadable; using lyx::support::latex_path; using lyx::support::ltrim; -using lyx::support::MakeAbsPath; -using lyx::support::MakeRelPath; +using lyx::support::makeAbsPath; +using lyx::support::makeRelPath; using lyx::support::Path; using lyx::support::prefixIs; using lyx::support::removeExtension; @@ -111,13 +111,13 @@ namespace { string normalize_name(Buffer const & buffer, OutputParams const & runparams, string const & name, string const & ext) { - string const fname = MakeAbsPath(name, buffer.filePath()); - if (AbsolutePath(name) || !isFileReadable(fname + ext)) + string const fname = makeAbsPath(name, buffer.filePath()); + if (absolutePath(name) || !isFileReadable(fname + ext)) return name; else if (!runparams.nice) return fname; else - return MakeRelPath(fname, buffer.getMasterBuffer()->filePath()); + return makeRelPath(fname, buffer.getMasterBuffer()->filePath()); } } @@ -166,7 +166,7 @@ int InsetBibtex::latex(Buffer const & buffer, ostream & os, // mangledFilename() needs the extension database = removeExtension(FileName(in_file).mangledFilename()); - string const out_file = MakeAbsPath(database + ".bib", + string const out_file = makeAbsPath(database + ".bib", buffer.getMasterBuffer()->temppath()); bool const success = copy(in_file, out_file); @@ -221,7 +221,7 @@ int InsetBibtex::latex(Buffer const & buffer, ostream & os, // use new style name base = removeExtension( FileName(in_file).mangledFilename()); - string const out_file = MakeAbsPath(base + ".bst", + string const out_file = makeAbsPath(base + ".bst", buffer.getMasterBuffer()->temppath()); bool const success = copy(in_file, out_file); if (!success) { @@ -300,7 +300,7 @@ vector const InsetBibtex::getFiles(Buffer const & buffer) const string bibfiles = getContents(); bibfiles = split(bibfiles, tmp, ','); while (!tmp.empty()) { - string file = findtexfile(ChangeExtension(tmp, "bib"), "bib"); + string file = findtexfile(changeExtension(tmp, "bib"), "bib"); lyxerr[Debug::LATEX] << "Bibfile: " << file << endl; // If we didn't find a matching file name just fail silently diff --git a/src/insets/insetgraphics.C b/src/insets/insetgraphics.C index 1450a42b7d..31e096efdc 100644 --- a/src/insets/insetgraphics.C +++ b/src/insets/insetgraphics.C @@ -90,17 +90,17 @@ TODO namespace support = lyx::support; -using lyx::support::AbsolutePath; +using lyx::support::absolutePath; using lyx::support::bformat; -using lyx::support::ChangeExtension; +using lyx::support::changeExtension; using lyx::support::compare_timestamps; using lyx::support::contains; using lyx::support::FileName; using lyx::support::float_equal; -using lyx::support::GetExtension; +using lyx::support::getExtension; using lyx::support::isFileReadable; using lyx::support::latex_path; -using lyx::support::OnlyFilename; +using lyx::support::onlyFilename; using lyx::support::removeExtension; using lyx::support::rtrim; using lyx::support::subst; @@ -458,8 +458,8 @@ enum CopyStatus { std::pair const copyFileIfNeeded(string const & file_in, string const & file_out) { - BOOST_ASSERT(AbsolutePath(file_in)); - BOOST_ASSERT(AbsolutePath(file_out)); + BOOST_ASSERT(absolutePath(file_in)); + BOOST_ASSERT(absolutePath(file_out)); unsigned long const checksum_in = support::sum(file_in); unsigned long const checksum_out = support::sum(file_out); @@ -488,10 +488,10 @@ copyToDirIfNeeded(string const & file_in, string const & dir, bool zipped) { using support::rtrim; - BOOST_ASSERT(AbsolutePath(file_in)); + BOOST_ASSERT(absolutePath(file_in)); - string const only_path = support::OnlyPath(file_in); - if (rtrim(support::OnlyPath(file_in) , "/") == rtrim(dir, "/")) + string const only_path = support::onlyPath(file_in); + if (rtrim(support::onlyPath(file_in) , "/") == rtrim(dir, "/")) return std::make_pair(IDENTICAL_PATHS, file_in); string mangled = FileName(file_in).mangledFilename(); @@ -506,7 +506,7 @@ copyToDirIfNeeded(string const & file_in, string const & dir, bool zipped) string::size_type const ext_len = file_in.length() - base.length(); mangled[mangled.length() - ext_len] = '.'; } - string const file_out = support::MakeAbsPath(mangled, dir); + string const file_out = support::makeAbsPath(mangled, dir); return copyFileIfNeeded(file_in, file_out); } @@ -537,7 +537,7 @@ string const stripExtensionIfPossible(string const & file, string const & to) // No conversion is needed. LaTeX can handle the graphic file as is. // This is true even if the orig_file is compressed. string const to_format = formats.getFormat(to)->extension(); - string const file_format = GetExtension(file); + string const file_format = getExtension(file); // for latex .ps == .eps if (to_format == file_format || (to_format == "eps" && file_format == "ps") || @@ -597,7 +597,7 @@ string const InsetGraphics::prepareFile(Buffer const & buf, // run through the LaTeX compiler. string output_file = os::external_path(runparams.nice ? params().filename.outputFilename(m_buffer->filePath()) : - OnlyFilename(temp_file)); + onlyFilename(temp_file)); string source_file = runparams.nice ? orig_file : temp_file; string const tex_format = (runparams.flavor == OutputParams::LATEX) ? "latex" : "pdflatex"; @@ -611,15 +611,15 @@ string const InsetGraphics::prepareFile(Buffer const & buf, lyxerr[Debug::GRAPHICS] << "\tpass zipped file to LaTeX.\n"; - string const bb_orig_file = ChangeExtension(orig_file, "bb"); + string const bb_orig_file = changeExtension(orig_file, "bb"); if (runparams.nice) { runparams.exportdata->addExternalFile(tex_format, bb_orig_file, - ChangeExtension(output_file, "bb")); + changeExtension(output_file, "bb")); } else { // LaTeX needs the bounding box file in the // tmp dir - string bb_file = ChangeExtension(temp_file, "bb"); + string bb_file = changeExtension(temp_file, "bb"); boost::tie(status, bb_file) = copyFileIfNeeded(bb_orig_file, bb_file); if (status == FAILURE) @@ -681,8 +681,8 @@ string const InsetGraphics::prepareFile(Buffer const & buf, return stripExtensionIfPossible(output_file, to); } - string const to_file = ChangeExtension(temp_file, ext); - string const output_to_file = ChangeExtension(output_file, ext); + string const to_file = changeExtension(temp_file, ext); + string const output_to_file = changeExtension(output_file, ext); // Do we need to perform the conversion? // Yes if to_file does not exist or if temp_file is newer than to_file diff --git a/src/insets/insetinclude.C b/src/insets/insetinclude.C index 7f015aeddf..0bbcedbdcc 100644 --- a/src/insets/insetinclude.C +++ b/src/insets/insetinclude.C @@ -53,22 +53,22 @@ #include -using lyx::support::AddName; -using lyx::support::AbsolutePath; +using lyx::support::addName; +using lyx::support::absolutePath; using lyx::support::bformat; -using lyx::support::ChangeExtension; +using lyx::support::changeExtension; using lyx::support::contains; using lyx::support::copy; using lyx::support::FileName; -using lyx::support::GetFileContents; +using lyx::support::getFileContents; using lyx::support::isFileReadable; using lyx::support::isLyXFilename; using lyx::support::latex_path; -using lyx::support::MakeAbsPath; -using lyx::support::MakeDisplayPath; -using lyx::support::MakeRelPath; -using lyx::support::OnlyFilename; -using lyx::support::OnlyPath; +using lyx::support::makeAbsPath; +using lyx::support::makeDisplayPath; +using lyx::support::makeRelPath; +using lyx::support::onlyFilename; +using lyx::support::onlyPath; using lyx::support::subst; using lyx::support::sum; @@ -222,8 +222,8 @@ string const parentFilename(Buffer const & buffer) string const includedFilename(Buffer const & buffer, InsetCommandParams const & params) { - return MakeAbsPath(params.getContents(), - OnlyPath(parentFilename(buffer))); + return makeAbsPath(params.getContents(), + onlyPath(parentFilename(buffer))); } @@ -292,7 +292,7 @@ string const InsetInclude::getScreenLabel(Buffer const &) const if (params_.getContents().empty()) temp += "???"; else - temp += OnlyFilename(params_.getContents()); + temp += onlyFilename(params_.getContents()); return temp; } @@ -342,16 +342,16 @@ int InsetInclude::latex(Buffer const & buffer, ostream & os, // if incfile is relative, make it relative to the master // buffer directory. - if (!AbsolutePath(incfile)) { - incfile = MakeRelPath(included_file, + if (!absolutePath(incfile)) { + incfile = makeRelPath(included_file, m_buffer->filePath()); } // write it to a file (so far the complete file) - string const exportfile = ChangeExtension(incfile, ".tex"); - string const mangled = FileName(ChangeExtension(included_file, + string const exportfile = changeExtension(incfile, ".tex"); + string const mangled = FileName(changeExtension(included_file, ".tex")).mangledFilename(); - string const writefile = MakeAbsPath(mangled, m_buffer->temppath()); + string const writefile = makeAbsPath(mangled, m_buffer->temppath()); if (!runparams.nice) incfile = mangled; @@ -369,7 +369,7 @@ int InsetInclude::latex(Buffer const & buffer, ostream & os, string text = bformat(_("Included file `%1$s'\n" "has textclass `%2$s'\n" "while parent file has textclass `%3$s'."), - MakeDisplayPath(included_file), + makeDisplayPath(included_file), tmp->params().getLyXTextClass().name(), m_buffer->params().getLyXTextClass().name()); Alert::warning(_("Different textclasses"), text); @@ -386,7 +386,7 @@ int InsetInclude::latex(Buffer const & buffer, ostream & os, // make use of it somehow? (JMarc 20031002) #endif tmp->makeLaTeXFile(writefile, - OnlyPath(masterFilename(buffer)), + onlyPath(masterFilename(buffer)), runparams, false); } else { // Copy the file to the temp dir, so that .aux files etc. @@ -421,7 +421,7 @@ int InsetInclude::latex(Buffer const & buffer, ostream & os, incfile = latex_path(incfile); os << '\\' << params_.getCmdName() << '{' << incfile << '}'; } else { - incfile = ChangeExtension(incfile, ".tex"); + incfile = changeExtension(incfile, ".tex"); incfile = latex_path(incfile); os << '\\' << params_.getCmdName() << '{' << incfile @@ -433,7 +433,7 @@ int InsetInclude::latex(Buffer const & buffer, ostream & os, // \include don't want extension and demands that the // file really have .tex - incfile = ChangeExtension(incfile, string()); + incfile = changeExtension(incfile, string()); incfile = latex_path(incfile); os << '\\' << params_.getCmdName() << '{' << incfile @@ -448,7 +448,7 @@ int InsetInclude::plaintext(Buffer const & buffer, ostream & os, OutputParams const &) const { if (isVerbatim(params_)) - os << GetFileContents(includedFilename(buffer, params_)); + os << getFileContents(includedFilename(buffer, params_)); return 0; } @@ -465,13 +465,13 @@ int InsetInclude::linuxdoc(Buffer const & buffer, ostream & os, string const included_file = includedFilename(buffer, params_); // write it to a file (so far the complete file) - string const exportfile = ChangeExtension(incfile, ".sgml"); - string writefile = ChangeExtension(included_file, ".sgml"); + string const exportfile = changeExtension(incfile, ".sgml"); + string writefile = changeExtension(included_file, ".sgml"); if (loadIfNeeded(buffer, params_)) { Buffer * tmp = bufferlist.getBuffer(included_file); - writefile = MakeAbsPath(FileName(writefile).mangledFilename(), + writefile = makeAbsPath(FileName(writefile).mangledFilename(), buffer.getMasterBuffer()->temppath()); if (!runparams.nice) incfile = writefile; @@ -485,7 +485,7 @@ int InsetInclude::linuxdoc(Buffer const & buffer, ostream & os, if (isVerbatim(params_)) { os << ""; } else { runparams.exportdata->addExternalFile("linuxdoc", writefile, @@ -509,14 +509,14 @@ int InsetInclude::docbook(Buffer const & buffer, ostream & os, string const included_file = includedFilename(buffer, params_); // write it to a file (so far the complete file) - string const exportfile = ChangeExtension(incfile, ".sgml"); - string writefile = ChangeExtension(included_file, ".sgml"); + string const exportfile = changeExtension(incfile, ".sgml"); + string writefile = changeExtension(included_file, ".sgml"); if (loadIfNeeded(buffer, params_)) { Buffer * tmp = bufferlist.getBuffer(included_file); string const mangled = FileName(writefile).mangledFilename(); - writefile = MakeAbsPath(mangled, + writefile = makeAbsPath(mangled, buffer.getMasterBuffer()->temppath()); if (!runparams.nice) incfile = mangled; @@ -554,13 +554,13 @@ void InsetInclude::validate(LaTeXFeatures & features) const string const included_file = includedFilename(buffer, params_); if (isLyXFilename(included_file)) - writefile = ChangeExtension(included_file, ".sgml"); + writefile = changeExtension(included_file, ".sgml"); else writefile = included_file; if (!features.runparams().nice && !isVerbatim(params_)) { incfile = FileName(writefile).mangledFilename(); - writefile = MakeAbsPath(incfile, + writefile = makeAbsPath(incfile, buffer.getMasterBuffer()->temppath()); } diff --git a/src/insets/render_graphic.C b/src/insets/render_graphic.C index 31d4605b11..dcd6f705cd 100644 --- a/src/insets/render_graphic.C +++ b/src/insets/render_graphic.C @@ -31,8 +31,8 @@ namespace graphics = lyx::graphics; -using lyx::support::AbsolutePath; -using lyx::support::OnlyFilename; +using lyx::support::absolutePath; +using lyx::support::onlyFilename; using std::string; using std::auto_ptr; @@ -67,7 +67,7 @@ void RenderGraphic::update(graphics::Params const & params) params_ = params; if (!params_.filename.empty()) { - BOOST_ASSERT(AbsolutePath(params_.filename)); + BOOST_ASSERT(absolutePath(params_.filename)); loader_.reset(params_.filename, params_); } } @@ -142,7 +142,7 @@ void RenderGraphic::metrics(MetricsInfo & mi, Dimension & dim) const LyXFont msgFont(mi.base.font); msgFont.setFamily(LyXFont::SANS_FAMILY); - string const justname = OnlyFilename(params_.filename); + string const justname = onlyFilename(params_.filename); if (!justname.empty()) { msgFont.setSize(LyXFont::SIZE_FOOTNOTE); font_width = font_metrics::width(justname, msgFont); @@ -191,7 +191,7 @@ void RenderGraphic::draw(PainterInfo & pi, int x, int y) const // Print the file name. LyXFont msgFont = pi.base.font; msgFont.setFamily(LyXFont::SANS_FAMILY); - string const justname = OnlyFilename(params_.filename); + string const justname = onlyFilename(params_.filename); if (!justname.empty()) { msgFont.setSize(LyXFont::SIZE_FOOTNOTE); diff --git a/src/lyx_cb.C b/src/lyx_cb.C index b379076ff7..3286ce4928 100644 --- a/src/lyx_cb.C +++ b/src/lyx_cb.C @@ -54,20 +54,20 @@ #include #include -using lyx::support::AddName; +using lyx::support::addName; using lyx::support::bformat; using lyx::support::destroyDir; using lyx::support::FileFilterList; using lyx::support::ForkedProcess; using lyx::support::isLyXFilename; -using lyx::support::LibFileSearch; -using lyx::support::MakeAbsPath; -using lyx::support::MakeDisplayPath; -using lyx::support::OnlyFilename; -using lyx::support::OnlyPath; +using lyx::support::libFileSearch; +using lyx::support::makeAbsPath; +using lyx::support::makeDisplayPath; +using lyx::support::onlyFilename; +using lyx::support::onlyPath; using lyx::support::Path; using lyx::support::package; -using lyx::support::QuoteName; +using lyx::support::quoteName; using lyx::support::removeAutosaveFile; using lyx::support::rename; using lyx::support::split; @@ -107,7 +107,7 @@ bool MenuWrite(Buffer * buffer) // FIXME: we don't tell the user *WHY* the save failed !! - string const file = MakeDisplayPath(buffer->fileName(), 30); + string const file = makeDisplayPath(buffer->fileName(), 30); string text = bformat(_("The document %1$s could not be saved.\n\n" "Do you want to rename the document and try again?"), file); @@ -141,9 +141,9 @@ bool WriteAs(Buffer * buffer, string const & filename) FileFilterList const filter (_("LyX Documents (*.lyx)")); FileDialog::Result result = - fileDlg.save(OnlyPath(fname), + fileDlg.save(onlyPath(fname), filter, - OnlyFilename(fname)); + onlyFilename(fname)); if (result.first == FileDialog::Later) return false; @@ -154,14 +154,14 @@ bool WriteAs(Buffer * buffer, string const & filename) return false; // Make sure the absolute filename ends with appropriate suffix - fname = MakeAbsPath(fname); + fname = makeAbsPath(fname); if (!isLyXFilename(fname)) fname += ".lyx"; } else fname = filename; if (fs::exists(fname)) { - string const file = MakeDisplayPath(fname, 30); + string const file = makeDisplayPath(fname, 30); string text = bformat(_("The document %1$s already exists.\n\n" "Do you want to over-write that document?"), file); int const ret = Alert::prompt(_("Over-write document?"), @@ -315,7 +315,7 @@ void AutoSave(BufferView * bv) // create autosave filename string fname = bv->buffer()->filePath(); fname += '#'; - fname += OnlyFilename(bv->buffer()->fileName()); + fname += onlyFilename(bv->buffer()->fileName()); fname += '#'; AutoSaveBuffer autosave(*bv, fname); @@ -400,7 +400,7 @@ string getContentsOfAsciiFile(BufferView * bv, string const & f, bool asParagrap if (!fs::is_readable(fname)) { string const error = strerror(errno); - string const file = MakeDisplayPath(fname, 50); + string const file = makeDisplayPath(fname, 50); string const text = bformat(_("Could not read the specified document\n" "%1$s\ndue to the error: %2$s"), file, error); Alert::error(_("Could not read file"), text); @@ -410,7 +410,7 @@ string getContentsOfAsciiFile(BufferView * bv, string const & f, bool asParagrap ifstream ifs(fname.c_str()); if (!ifs) { string const error = strerror(errno); - string const file = MakeDisplayPath(fname, 50); + string const file = makeDisplayPath(fname, 50); string const text = bformat(_("Could not open the specified document\n" "%1$s\ndue to the error: %2$s"), file, error); Alert::error(_("Could not open file"), text); @@ -447,13 +447,13 @@ void Reconfigure(BufferView * bv) // Run configure in user lyx directory Path p(package().user_support()); string const configure_script = - AddName(package().system_support(), "configure.py"); - string const configure_command = "python " + QuoteName(configure_script); + addName(package().system_support(), "configure.py"); + string const configure_command = "python " + quoteName(configure_script); Systemcall one; one.startscript(Systemcall::Wait, configure_command); p.pop(); bv->owner()->message(_("Reloading configuration...")); - lyxrc.read(LibFileSearch(string(), "lyxrc.defaults")); + lyxrc.read(libFileSearch(string(), "lyxrc.defaults")); // Re-read packages.lst LaTeXFeatures::getAvailable(); diff --git a/src/lyx_main.C b/src/lyx_main.C index bc13d1ed52..5fe670ca1e 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -58,19 +58,19 @@ #include #include -using lyx::support::AddName; -using lyx::support::AddPath; +using lyx::support::addName; +using lyx::support::addPath; using lyx::support::bformat; using lyx::support::createDirectory; using lyx::support::createLyXTmpDir; -using lyx::support::FileSearch; +using lyx::support::fileSearch; using lyx::support::getEnv; using lyx::support::i18nLibFileSearch; -using lyx::support::LibFileSearch; +using lyx::support::libFileSearch; using lyx::support::package; using lyx::support::Path; using lyx::support::prependEnvPath; -using lyx::support::QuoteName; +using lyx::support::quoteName; using lyx::support::rtrim; namespace os = lyx::support::os; @@ -117,9 +117,9 @@ void showFileError(string const & error) void reconfigureUserLyXDir() { string const configure_script = - AddName(package().system_support(), "configure.py"); + addName(package().system_support(), "configure.py"); string const configure_command = - "python " + QuoteName(configure_script); + "python " + quoteName(configure_script); lyxerr << _("LyX: reconfiguring user directory") << endl; Path p(package().user_support()); @@ -260,7 +260,7 @@ void LyX::priv_exec(int & argc, char * argv[]) for (; it != end; ++it) { // get absolute path of file and add ".lyx" to // the filename if necessary - string s = FileSearch(string(), *it, "lyx"); + string s = fileSearch(string(), *it, "lyx"); if (s.empty()) { last_loaded = newFile(*it, string(), true); } else { @@ -429,7 +429,7 @@ void LyX::init(bool gui) lyxrc.document_path = package().document_dir(); if (lyxrc.template_path.empty()) { - lyxrc.template_path = AddPath(package().system_support(), + lyxrc.template_path = addPath(package().system_support(), "templates"); } @@ -453,9 +453,9 @@ void LyX::init(bool gui) string prefsfile = "preferences"; // back compatibility to lyxs < 1.1.6 - if (LibFileSearch(string(), prefsfile).empty()) + if (libFileSearch(string(), prefsfile).empty()) prefsfile = "lyxrc"; - if (!LibFileSearch(string(), prefsfile).empty()) + if (!libFileSearch(string(), prefsfile).empty()) readRcFile(prefsfile); readEncodingsFile("encodings"); @@ -622,9 +622,9 @@ bool LyX::queryUserLyXDir(bool explicit_userdir) fs::is_directory(package().user_support())) { first_start = false; string const configure_script = - AddName(package().system_support(), "configure.py"); + addName(package().system_support(), "configure.py"); string const userDefaults = - AddName(package().user_support(), "lyxrc.defaults"); + addName(package().user_support(), "lyxrc.defaults"); if (fs::exists(configure_script) && fs::exists(userDefaults) && fs::last_write_time(configure_script) @@ -672,7 +672,7 @@ void LyX::readRcFile(string const & name) { lyxerr[Debug::INIT] << "About to read " << name << "..." << endl; - string const lyxrc_path = LibFileSearch(string(), name); + string const lyxrc_path = libFileSearch(string(), name); if (!lyxrc_path.empty()) { lyxerr[Debug::INIT] << "Found " << name @@ -719,7 +719,7 @@ void LyX::readUIFile(string const & name) lyxerr[Debug::INIT] << "About to read " << name << "..." << endl; - string const ui_path = LibFileSearch("ui", name, "ui"); + string const ui_path = libFileSearch("ui", name, "ui"); if (ui_path.empty()) { lyxerr[Debug::INIT] << "Could not find " << name << endl; @@ -775,7 +775,7 @@ void LyX::readLanguagesFile(string const & name) { lyxerr[Debug::INIT] << "About to read " << name << "..." << endl; - string const lang_path = LibFileSearch(string(), name); + string const lang_path = libFileSearch(string(), name); if (lang_path.empty()) { showFileError(name); return; @@ -789,7 +789,7 @@ void LyX::readEncodingsFile(string const & name) { lyxerr[Debug::INIT] << "About to read " << name << "..." << endl; - string const enc_path = LibFileSearch(string(), name); + string const enc_path = libFileSearch(string(), name); if (enc_path.empty()) { showFileError(name); return; diff --git a/src/lyxfunc.C b/src/lyxfunc.C index fdced899f3..f02cf11601 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -100,24 +100,24 @@ using bv_funcs::freefont2string; -using lyx::support::AbsolutePath; -using lyx::support::AddName; -using lyx::support::AddPath; +using lyx::support::absolutePath; +using lyx::support::addName; +using lyx::support::addPath; using lyx::support::bformat; -using lyx::support::ChangeExtension; +using lyx::support::changeExtension; using lyx::support::contains; using lyx::support::FileFilterList; -using lyx::support::FileSearch; +using lyx::support::fileSearch; using lyx::support::ForkedcallsController; using lyx::support::i18nLibFileSearch; using lyx::support::isDirWriteable; using lyx::support::isFileReadable; using lyx::support::isStrInt; -using lyx::support::MakeAbsPath; -using lyx::support::MakeDisplayPath; +using lyx::support::makeAbsPath; +using lyx::support::makeDisplayPath; using lyx::support::package; using lyx::support::Path; -using lyx::support::QuoteName; +using lyx::support::quoteName; using lyx::support::rtrim; using lyx::support::split; using lyx::support::subst; @@ -655,7 +655,7 @@ bool ensureBufferClean(BufferView * bv) if (buf.isClean()) return true; - string const file = MakeDisplayPath(buf.fileName(), 30); + string const file = makeDisplayPath(buf.fileName(), 30); string text = bformat(_("The document %1$s has unsaved " "changes.\n\nDo you want to save " "the document?"), file); @@ -674,7 +674,7 @@ void showPrintError(string const & name) { string str = bformat(_("Could not print the document %1$s.\n" "Check that your printer is set up correctly."), - MakeDisplayPath(name, 50)); + makeDisplayPath(name, 50)); Alert::error(_("Print document failed"), str); } @@ -806,7 +806,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd) case LFUN_MENUWRITE: if (!owner->buffer()->isUnnamed()) { string const str = bformat(_("Saving document %1$s..."), - MakeDisplayPath(owner->buffer()->fileName())); + makeDisplayPath(owner->buffer()->fileName())); owner->message(str); MenuWrite(owner->buffer()); owner->message(str + _(" done.")); @@ -819,7 +819,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd) break; case LFUN_MENURELOAD: { - string const file = MakeDisplayPath(view()->buffer()->fileName(), 20); + string const file = makeDisplayPath(view()->buffer()->fileName(), 20); string text = bformat(_("Any changes will be lost. Are you sure " "you want to revert to the saved version of the document %1$s?"), file); int const ret = Alert::prompt(_("Revert to saved document?"), @@ -879,9 +879,9 @@ void LyXFunc::dispatch(FuncRequest const & cmd) if (format->name() == "lyx") { string const latexname = buffer->getLatexName(false); - filename = ChangeExtension(latexname, + filename = changeExtension(latexname, format->extension()); - filename = AddName(buffer->temppath(), filename); + filename = addName(buffer->temppath(), filename); if (!buffer->writeFile(filename)) break; @@ -939,18 +939,18 @@ void LyXFunc::dispatch(FuncRequest const & cmd) Systemcall one; int res = 0; string const dviname = - ChangeExtension(buffer->getLatexName(true), + changeExtension(buffer->getLatexName(true), "dvi"); if (target == "printer") { if (!lyxrc.print_spool_command.empty()) { // case 3: print using a spool string const psname = - ChangeExtension(dviname,".ps"); + changeExtension(dviname,".ps"); command += lyxrc.print_to_file - + QuoteName(psname) + + quoteName(psname) + ' ' - + QuoteName(dviname); + + quoteName(dviname); string command2 = lyxrc.print_spool_command +' '; @@ -959,7 +959,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd) + target_name + ' '; } - command2 += QuoteName(psname); + command2 += quoteName(psname); // First run dvips. // If successful, then spool command res = one.startscript( @@ -974,16 +974,16 @@ void LyXFunc::dispatch(FuncRequest const & cmd) // case 2: print directly to a printer res = one.startscript( Systemcall::DontWait, - command + QuoteName(dviname)); + command + quoteName(dviname)); } } else { // case 1: print to a file command += lyxrc.print_to_file - + QuoteName(MakeAbsPath(target_name, + + quoteName(makeAbsPath(target_name, path)) + ' ' - + QuoteName(dviname); + + quoteName(dviname); res = one.startscript(Systemcall::DontWait, command); } @@ -1038,7 +1038,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd) break; } owner->message(bformat(_("Opening help file %1$s..."), - MakeDisplayPath(fname))); + makeDisplayPath(fname))); view()->loadLyXFile(fname, false); break; } @@ -1137,7 +1137,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd) } else { // Must replace extension of the file to be .lyx // and get full path - string const s = ChangeExtension(file_name, ".lyx"); + string const s = changeExtension(file_name, ".lyx"); // Either change buffer or load the file if (bufferlist.exists(s)) { view()->setBuffer(bufferlist.getBuffer(s)); @@ -1292,9 +1292,9 @@ void LyXFunc::dispatch(FuncRequest const & cmd) case LFUN_CHILDOPEN: { string const filename = - MakeAbsPath(argument, owner->buffer()->filePath()); + makeAbsPath(argument, owner->buffer()->filePath()); setMessage(N_("Opening child document ") + - MakeDisplayPath(filename) + "..."); + makeDisplayPath(filename) + "..."); view()->savePosition(0); string const parentfilename = owner->buffer()->fileName(); if (bufferlist.exists(filename)) @@ -1479,7 +1479,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd) case LFUN_SAVE_AS_DEFAULT: { string const fname = - AddName(AddPath(package().user_support(), "templates/"), + addName(addPath(package().user_support(), "templates/"), "defaults.lyx"); Buffer defaults(fname); @@ -1497,7 +1497,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd) if (defaults.writeFile(defaults.fileName())) setMessage(_("Document defaults saved in ") - + MakeDisplayPath(fname)); + + makeDisplayPath(fname)); else setErrorMessage(_("Unable to save document defaults")); break; @@ -1703,11 +1703,11 @@ void LyXFunc::menuNew(string const & name, bool fromTemplate) static int newfile_number; if (filename.empty()) { - filename = AddName(lyxrc.document_path, + filename = addName(lyxrc.document_path, "newfile" + convert(++newfile_number) + ".lyx"); while (bufferlist.exists(filename) || fs::is_readable(filename)) { ++newfile_number; - filename = AddName(lyxrc.document_path, + filename = addName(lyxrc.document_path, "newfile" + convert(newfile_number) + ".lyx"); } @@ -1758,7 +1758,7 @@ void LyXFunc::open(string const & fname) make_pair(string(_("Documents|#o#O")), string(lyxrc.document_path)), make_pair(string(_("Examples|#E#e")), - string(AddPath(package().system_support(), "examples")))); + string(addPath(package().system_support(), "examples")))); FileDialog::Result result = fileDlg.open(initpath, @@ -1780,12 +1780,12 @@ void LyXFunc::open(string const & fname) // get absolute path of file and add ".lyx" to the filename if // necessary - string const fullpath = FileSearch(string(), filename, "lyx"); + string const fullpath = fileSearch(string(), filename, "lyx"); if (!fullpath.empty()) { filename = fullpath; } - string const disp_fn(MakeDisplayPath(filename)); + string const disp_fn(makeDisplayPath(filename)); // if the file doesn't exist, let the user create one if (!fs::exists(filename)) { @@ -1833,7 +1833,7 @@ void LyXFunc::doImport(string const & argument) make_pair(string(_("Documents|#o#O")), string(lyxrc.document_path)), make_pair(string(_("Examples|#E#e")), - string(AddPath(package().system_support(), "examples")))); + string(addPath(package().system_support(), "examples")))); string const filter = formats.prettyName(format) + " (*." + formats.extension(format) + ')'; @@ -1857,9 +1857,9 @@ void LyXFunc::doImport(string const & argument) return; // get absolute path of file - filename = MakeAbsPath(filename); + filename = makeAbsPath(filename); - string const lyxfile = ChangeExtension(filename, ".lyx"); + string const lyxfile = changeExtension(filename, ".lyx"); // Check if the document already is open if (lyx_gui::use_gui && bufferlist.exists(lyxfile)) { @@ -1872,7 +1872,7 @@ void LyXFunc::doImport(string const & argument) // if the file exists already, and we didn't do // -i lyx thefile.lyx, warn if (fs::exists(lyxfile) && filename != lyxfile) { - string const file = MakeDisplayPath(lyxfile, 30); + string const file = makeDisplayPath(lyxfile, 30); string text = bformat(_("The document %1$s already exists.\n\n" "Do you want to over-write that document?"), file); diff --git a/src/lyxlex_pimpl.C b/src/lyxlex_pimpl.C index 292778761a..e8e9e06bef 100644 --- a/src/lyxlex_pimpl.C +++ b/src/lyxlex_pimpl.C @@ -24,7 +24,7 @@ using lyx::support::compare_ascii_no_case; using lyx::support::getFormatFromContents; -using lyx::support::MakeDisplayPath; +using lyx::support::makeDisplayPath; using lyx::support::split; using lyx::support::subst; @@ -73,7 +73,7 @@ void LyXLex::Pimpl::printError(string const & message) const { string const tmpmsg = subst(message, "$$Token", getString()); lyxerr << "LyX: " << tmpmsg << " [around line " << lineno - << " of file " << MakeDisplayPath(name) << ']' << endl; + << " of file " << makeDisplayPath(name) << ']' << endl; } diff --git a/src/lyxrc.C b/src/lyxrc.C index acdd15ad69..d1276ba94c 100644 --- a/src/lyxrc.C +++ b/src/lyxrc.C @@ -44,9 +44,9 @@ namespace os = lyx::support::os; using lyx::support::ascii_lowercase; using lyx::support::bformat; -using lyx::support::ExpandPath; +using lyx::support::expandPath; using lyx::support::getEnv; -using lyx::support::LibFileSearch; +using lyx::support::libFileSearch; using lyx::support::token; using std::cout; @@ -365,7 +365,7 @@ int LyXRC::read(LyXLex & lexrc) case RC_INPUT: // Include file if (lexrc.next()) { string const tmp = - LibFileSearch(string(), + libFileSearch(string(), lexrc.getString()); if (read(tmp)) { lexrc.printError("Error reading " @@ -420,7 +420,7 @@ int LyXRC::read(LyXLex & lexrc) string const kmap(os::internal_path(lexrc.getString())); if (kmap.empty()) { // nothing - } else if (!LibFileSearch("kbd", kmap, + } else if (!libFileSearch("kbd", kmap, "kmap").empty()) { primary_kbmap = kmap; } else { @@ -434,7 +434,7 @@ int LyXRC::read(LyXLex & lexrc) string const kmap(os::internal_path(lexrc.getString())); if (kmap.empty()) { // nothing - } else if (!LibFileSearch("kbd", kmap, + } else if (!libFileSearch("kbd", kmap, "kmap").empty()) { secondary_kbmap = kmap; } else { @@ -720,21 +720,21 @@ int LyXRC::read(LyXLex & lexrc) case RC_DOCUMENTPATH: if (lexrc.next()) { document_path = os::internal_path(lexrc.getString()); - document_path = ExpandPath(document_path); + document_path = expandPath(document_path); } break; case RC_TEMPLATEPATH: if (lexrc.next()) { template_path = os::internal_path(lexrc.getString()); - template_path = ExpandPath(template_path); + template_path = expandPath(template_path); } break; case RC_TEMPDIRPATH: if (lexrc.next()) { tempdir_path = os::internal_path(lexrc.getString()); - tempdir_path = ExpandPath(tempdir_path); + tempdir_path = expandPath(tempdir_path); } break; @@ -876,7 +876,7 @@ int LyXRC::read(LyXLex & lexrc) case RC_SERVERPIPE: if (lexrc.next()) { lyxpipes = os::internal_path(lexrc.getString()); - lyxpipes = ExpandPath(lyxpipes); + lyxpipes = expandPath(lyxpipes); } break; @@ -961,7 +961,7 @@ int LyXRC::read(LyXLex & lexrc) case RC_BACKUPDIR_PATH: if (lexrc.next()) { backupdir_path = os::internal_path(lexrc.getString()); - backupdir_path = ExpandPath(backupdir_path); + backupdir_path = expandPath(backupdir_path); } break; case RC_DATE_INSERT_FORMAT: diff --git a/src/lyxtextclass.C b/src/lyxtextclass.C index bc522c40ed..f986838851 100644 --- a/src/lyxtextclass.C +++ b/src/lyxtextclass.C @@ -27,9 +27,9 @@ #include -using lyx::support::LibFileSearch; -using lyx::support::MakeDisplayPath; -using lyx::support::QuoteName; +using lyx::support::libFileSearch; +using lyx::support::makeDisplayPath; +using lyx::support::quoteName; using lyx::support::rtrim; using lyx::support::subst; @@ -61,7 +61,7 @@ int const FORMAT = 2; bool layout2layout(string const & filename, string const & tempfile) { - string const script = LibFileSearch("scripts", "layout2layout.py"); + string const script = libFileSearch("scripts", "layout2layout.py"); if (script.empty()) { lyxerr << "Could not find layout conversion " "script layout2layout.py." << endl; @@ -69,15 +69,15 @@ bool layout2layout(string const & filename, string const & tempfile) } std::ostringstream command; - command << "python " << QuoteName(script) - << ' ' << QuoteName(filename) - << ' ' << QuoteName(tempfile); + command << "python " << quoteName(script) + << ' ' << quoteName(filename) + << ' ' << quoteName(tempfile); string const command_str = command.str(); lyxerr[Debug::TCLASS] << "Running `" << command_str << '\'' << endl; lyx::support::cmd_ret const ret = - lyx::support::RunCommand(command_str); + lyx::support::runCommand(command_str); if (ret.first != 0) { lyxerr << "Could not run layout conversion " "script layout2layout.py." << endl; @@ -205,11 +205,11 @@ bool LyXTextClass::Read(string const & filename, bool merge) if (!merge) lyxerr[Debug::TCLASS] << "Reading textclass " - << MakeDisplayPath(filename) + << makeDisplayPath(filename) << endl; else lyxerr[Debug::TCLASS] << "Reading input file " - << MakeDisplayPath(filename) + << makeDisplayPath(filename) << endl; LyXLex lexrc(textClassTags, @@ -251,7 +251,7 @@ bool LyXTextClass::Read(string const & filename, bool merge) case TC_INPUT: // Include file if (lexrc.next()) { - string tmp = LibFileSearch("layouts", + string tmp = libFileSearch("layouts", lexrc.getString(), "layout"); @@ -442,7 +442,7 @@ bool LyXTextClass::Read(string const & filename, bool merge) if (!merge) { // we are at top level here. lyxerr[Debug::TCLASS] << "Finished reading textclass " - << MakeDisplayPath(filename) + << makeDisplayPath(filename) << endl; if (defaultlayout_.empty()) { lyxerr << "Error: Textclass '" << name_ @@ -472,7 +472,7 @@ bool LyXTextClass::Read(string const & filename, bool merge) } else lyxerr[Debug::TCLASS] << "Finished reading input file " - << MakeDisplayPath(filename) + << makeDisplayPath(filename) << endl; return error; @@ -916,12 +916,12 @@ bool LyXTextClass::load() const return true; // Read style-file - string const real_file = LibFileSearch("layouts", name_, "layout"); + string const real_file = libFileSearch("layouts", name_, "layout"); loaded_ = const_cast(this)->Read(real_file) == 0; if (!loaded_) { lyxerr << "Error reading `" - << MakeDisplayPath(real_file) + << makeDisplayPath(real_file) << "'\n(Check `" << name_ << "')\nCheck your installation and " "try Options/Reconfigure..." << endl; diff --git a/src/lyxtextclasslist.C b/src/lyxtextclasslist.C index 99c2d94a3a..c930d8a3a1 100644 --- a/src/lyxtextclasslist.C +++ b/src/lyxtextclasslist.C @@ -22,8 +22,8 @@ using lyx::textclass_type; -using lyx::support::LibFileSearch; -using lyx::support::MakeDisplayPath; +using lyx::support::libFileSearch; +using lyx::support::makeDisplayPath; using boost::bind; @@ -91,13 +91,13 @@ public: bool LyXTextClassList::Read() { LyXLex lex(0, 0); - string real_file = LibFileSearch("", "textclass.lst"); + string real_file = libFileSearch("", "textclass.lst"); lyxerr[Debug::TCLASS] << "Reading textclasses from `" << real_file << '\'' << endl; if (real_file.empty()) { lyxerr << "LyXTextClassList::Read: unable to find " - "textclass file `" << MakeDisplayPath(real_file, 1000) + "textclass file `" << makeDisplayPath(real_file, 1000) << "'. Exiting." << endl; return false; // This causes LyX to end... Not a desirable behaviour. Lgb @@ -115,7 +115,7 @@ bool LyXTextClassList::Read() if (!lex.isOK()) { lyxerr << "LyXTextClassList::Read: unable to open " - "textclass file `" << MakeDisplayPath(real_file, 1000) + "textclass file `" << makeDisplayPath(real_file, 1000) << "'\nCheck your installation. LyX can't continue." << endl; return false; diff --git a/src/lyxvc.C b/src/lyxvc.C index 6d038b9189..d05c292f7a 100644 --- a/src/lyxvc.C +++ b/src/lyxvc.C @@ -28,7 +28,7 @@ using lyx::support::bformat; using lyx::support::isFileReadable; -using lyx::support::MakeDisplayPath; +using lyx::support::makeDisplayPath; using lyx::support::tempName; using std::endl; @@ -103,14 +103,14 @@ void LyXVC::registrer() if (isFileReadable(cvs_entries)) { lyxerr[Debug::LYXVC] << "LyXVC: registering " - << MakeDisplayPath(filename) + << makeDisplayPath(filename) << " with CVS" << endl; vcs.reset(new CVS(cvs_entries, filename)); } else { lyxerr[Debug::LYXVC] << "LyXVC: registering " - << MakeDisplayPath(filename) + << makeDisplayPath(filename) << " with RCS" << endl; vcs.reset(new RCS(filename)); } @@ -160,7 +160,7 @@ void LyXVC::revert() { lyxerr[Debug::LYXVC] << "LyXVC: revert" << endl; - string const file = MakeDisplayPath(owner_->fileName(), 20); + string const file = makeDisplayPath(owner_->fileName(), 20); string text = bformat(_("Reverting to the stored version of the " "document %1$s will lose all current changes.\n\n" "Do you want to revert to the saved version?"), file); diff --git a/src/mathed/math_autocorrect.C b/src/mathed/math_autocorrect.C index 4d06c78259..2c4c50040a 100644 --- a/src/mathed/math_autocorrect.C +++ b/src/mathed/math_autocorrect.C @@ -22,7 +22,7 @@ #include #include -using lyx::support::LibFileSearch; +using lyx::support::libFileSearch; using std::string; using std::ifstream; @@ -143,7 +143,7 @@ Corrections theCorrections; void initAutoCorrect() { lyxerr[Debug::MATHED] << "reading autocorrect file" << endl; - string const file = LibFileSearch(string(), "autocorrect"); + string const file = libFileSearch(string(), "autocorrect"); if (file.empty()) { lyxerr << "Could not find autocorrect file" << endl; return; diff --git a/src/mathed/math_extern.C b/src/mathed/math_extern.C index 28f961cbd2..dc87e3c2ba 100644 --- a/src/mathed/math_extern.C +++ b/src/mathed/math_extern.C @@ -40,8 +40,8 @@ using lyx::support::cmd_ret; using lyx::support::getVectorFromString; -using lyx::support::LibFileSearch; -using lyx::support::RunCommand; +using lyx::support::libFileSearch; +using lyx::support::runCommand; using lyx::support::subst; using std::string; @@ -899,7 +899,7 @@ namespace { { string command = "echo '" + data + "' | " + cmd; lyxerr << "calling: " << command << endl; - cmd_ret const ret = RunCommand(command); + cmd_ret const ret = runCommand(command); return ret.second; } @@ -1199,7 +1199,7 @@ MathArray pipeThroughExtern(string const & lang, string const & extra, string data = os.str(); // search external script - string file = LibFileSearch("mathed", "extern_" + lang); + string file = libFileSearch("mathed", "extern_" + lang); if (file.empty()) { lyxerr << "converter to '" << lang << "' not found" << endl; return MathArray(); diff --git a/src/mathed/math_factory.C b/src/mathed/math_factory.C index 36f3505dc0..67b6ec78d9 100644 --- a/src/mathed/math_factory.C +++ b/src/mathed/math_factory.C @@ -66,7 +66,7 @@ #include #include -using lyx::support::LibFileSearch; +using lyx::support::libFileSearch; using lyx::support::split; using std::string; @@ -107,7 +107,7 @@ bool math_font_available(string & name) void initSymbols() { - string const filename = LibFileSearch(string(), "symbols"); + string const filename = libFileSearch(string(), "symbols"); lyxerr[Debug::MATHED] << "read symbols from " << filename << endl; if (filename.empty()) { lyxerr << "Could not find symbols file" << endl; diff --git a/src/mover.C b/src/mover.C index 20e5909408..e8a69a5bea 100644 --- a/src/mover.C +++ b/src/mover.C @@ -48,7 +48,7 @@ bool SpecialisedMover::do_copy(string const & from, string const & to, if (command_.empty()) return Mover::do_copy(from, to, latex); - string command = support::LibScriptSearch(command_); + string command = support::libScriptSearch(command_); command = support::subst(command, "$$i", from); command = support::subst(command, "$$o", to); command = support::subst(command, "$$l", latex); diff --git a/src/output.C b/src/output.C index 5c9b57f49a..a5a3db5ece 100644 --- a/src/output.C +++ b/src/output.C @@ -21,7 +21,7 @@ #include using lyx::support::bformat; -using lyx::support::MakeDisplayPath; +using lyx::support::makeDisplayPath; using std::ofstream; using std::string; @@ -30,7 +30,7 @@ bool openFileWrite(ofstream & ofs, string const & fname) { ofs.open(fname.c_str()); if (!ofs) { - string const file = MakeDisplayPath(fname, 50); + string const file = makeDisplayPath(fname, 50); string text = bformat(_("Could not open the specified " "document\n%1$s."), file); Alert::error(_("Could not open file"), text); diff --git a/src/session.C b/src/session.C index f4bec2f051..58cd9d84a3 100644 --- a/src/session.C +++ b/src/session.C @@ -23,7 +23,7 @@ #include #include -using lyx::support::AddName; +using lyx::support::addName; using lyx::support::package; namespace fs = boost::filesystem; @@ -65,7 +65,7 @@ Session::Session(unsigned int num) : setNumberOfLastFiles(num); // locate the session file // note that the session file name 'session' is hard-coded - session_file = AddName(package().user_support(), "session"); + session_file = addName(package().user_support(), "session"); // readFile(); } diff --git a/src/support/filename.C b/src/support/filename.C index 67dde87f72..ff6bd98523 100644 --- a/src/support/filename.C +++ b/src/support/filename.C @@ -38,14 +38,14 @@ FileName::FileName() FileName::FileName(string const & abs_filename, bool save_abs) : name_(abs_filename), save_abs_path_(save_abs) { - BOOST_ASSERT(AbsolutePath(name_)); + BOOST_ASSERT(absolutePath(name_)); } void FileName::set(string const & name, string const & buffer_path) { - save_abs_path_ = AbsolutePath(name); - name_ = save_abs_path_ ? name : MakeAbsPath(name, buffer_path); + save_abs_path_ = absolutePath(name); + name_ = save_abs_path_ ? name : makeAbsPath(name, buffer_path); } @@ -57,13 +57,13 @@ void FileName::erase() string const FileName::relFilename(string const & path) const { - return MakeRelPath(name_, path); + return makeRelPath(name_, path); } string const FileName::outputFilename(string const & path) const { - return save_abs_path_ ? name_ : MakeRelPath(name_, path); + return save_abs_path_ ? name_ : makeRelPath(name_, path); } @@ -80,7 +80,7 @@ string const FileName::mangledFilename(std::string const & dir) const // Now the real work string mname = os::internal_path(name_); // Remove the extension. - mname = ChangeExtension(name_, string()); + mname = changeExtension(name_, string()); // Replace '/' in the file name with '_' mname = subst(mname, "/", "_"); // Replace '.' in the file name with '_' @@ -90,7 +90,7 @@ string const FileName::mangledFilename(std::string const & dir) const // Replace ':' in the file name with '_' mname = subst(mname, ":", "_"); // Add the extension back on - mname = ChangeExtension(mname, GetExtension(name_)); + mname = changeExtension(mname, getExtension(name_)); // Prepend a counter to the filename. This is necessary to make // the mangled name unique. diff --git a/src/support/filetools.C b/src/support/filetools.C index ad37ed96be..4c69d08532 100644 --- a/src/support/filetools.C +++ b/src/support/filetools.C @@ -95,7 +95,7 @@ string const latex_path(string const & original_path, if (extension == EXCLUDE_EXTENSION) { // ChangeExtension calls os::internal_path internally // so don't use it to remove the extension. - string const ext = GetExtension(path); + string const ext = getExtension(path); string const base = ext.empty() ? path : path.substr(0, path.length() - ext.length() - 1); @@ -112,10 +112,10 @@ string const latex_path(string const & original_path, // Substitutes spaces with underscores in filename (and path) -string const MakeLatexName(string const & file) +string const makeLatexName(string const & file) { - string name = OnlyFilename(file); - string const path = OnlyPath(file); + string name = onlyFilename(file); + string const path = onlyPath(file); for (string::size_type i = 0; i < name.length(); ++i) name[i] &= 0x7f; // set 8th bit to 0 @@ -129,11 +129,11 @@ string const MakeLatexName(string const & file) while ((pos = name.find_first_not_of(keep, pos)) != string::npos) name[pos++] = '_'; - return AddName(path, name); + return addName(path, name); } -string const QuoteName(string const & name) +string const quoteName(string const & name) { return (os::shell() == os::UNIX) ? '\'' + name + '\'': @@ -169,7 +169,7 @@ bool isDirWriteable(string const & path) // If path entry begins with $$LyX/, use system_lyxdir // If path entry begins with $$User/, use user_lyxdir // Example: "$$User/doc;$$LyX/doc" -string const FileOpenSearch(string const & path, string const & name, +string const fileOpenSearch(string const & path, string const & name, string const & ext) { string real_file; @@ -186,7 +186,7 @@ string const FileOpenSearch(string const & path, string const & name, path_element = subst(path_element, "$$User", package().user_support()); - real_file = FileSearch(path_element, name, ext); + real_file = fileSearch(path_element, name, ext); if (real_file.empty()) { do { @@ -198,8 +198,9 @@ string const FileOpenSearch(string const & path, string const & name, } #ifdef __EMX__ if (ext.empty() && notfound) { - real_file = FileOpenSearch(path, name, "exe"); - if (notfound) real_file = FileOpenSearch(path, name, "cmd"); + real_file = fileOpenSearch(path, name, "exe"); + if (notfound) + real_file = fileOpenSearch(path, name, "cmd"); } #endif return real_file; @@ -207,7 +208,7 @@ string const FileOpenSearch(string const & path, string const & name, /// Returns a vector of all files in directory dir having extension ext. -vector const DirList(string const & dir, string const & ext) +vector const dirList(string const & dir, string const & ext) { // EXCEPTIONS FIXME. Rewrite needed when we turn on exceptions. (Lgb) vector dirlist; @@ -238,13 +239,13 @@ vector const DirList(string const & dir, string const & ext) // Returns the real name of file name in directory path, with optional // extension ext. -string const FileSearch(string const & path, string const & name, +string const fileSearch(string const & path, string const & name, string const & ext) { // if `name' is an absolute path, we ignore the setting of `path' // Expand Environmentvariables in 'name' - string const tmpname = ReplaceEnvironmentPath(name); - string fullname = MakeAbsPath(tmpname, path); + string const tmpname = replaceEnvironmentPath(name); + string fullname = makeAbsPath(tmpname, path); // search first without extension, then with it. if (isFileReadable(fullname)) return fullname; @@ -261,21 +262,21 @@ string const FileSearch(string const & path, string const & name, // 1) user_lyxdir // 2) build_lyxdir (if not empty) // 3) system_lyxdir -string const LibFileSearch(string const & dir, string const & name, +string const libFileSearch(string const & dir, string const & name, string const & ext) { - string fullname = FileSearch(AddPath(package().user_support(), dir), + string fullname = fileSearch(addPath(package().user_support(), dir), name, ext); if (!fullname.empty()) return fullname; if (!package().build_support().empty()) - fullname = FileSearch(AddPath(package().build_support(), dir), + fullname = fileSearch(addPath(package().build_support(), dir), name, ext); if (!fullname.empty()) return fullname; - return FileSearch(AddPath(package().system_support(), dir), name, ext); + return fileSearch(addPath(package().system_support(), dir), name, ext); } @@ -307,7 +308,7 @@ string const i18nLibFileSearch(string const & dir, string const & name, string l; lang = split(lang, l, ':'); while (!l.empty() && l != "C" && l != "POSIX") { - string const tmp = LibFileSearch(dir, + string const tmp = libFileSearch(dir, token(l, '_', 0) + '_' + name, ext); if (!tmp.empty()) @@ -315,11 +316,11 @@ string const i18nLibFileSearch(string const & dir, string const & name, lang = split(lang, l, ':'); } - return LibFileSearch(dir, name, ext); + return libFileSearch(dir, name, ext); } -string const LibScriptSearch(string const & command_in) +string const libScriptSearch(string const & command_in) { static string const token_scriptpath = "$$s/"; @@ -337,7 +338,7 @@ string const LibScriptSearch(string const & command_in) // Does this script file exist? string const script = - LibFileSearch(".", command.substr(start_script, size_script)); + libFileSearch(".", command.substr(start_script, size_script)); if (script.empty()) { // Replace "$$s/" with "" @@ -345,7 +346,7 @@ string const LibScriptSearch(string const & command_in) } else { // Replace "$$s/foo/some_script" with "/some_script". string::size_type const size_replace = size_script + 4; - command.replace(pos1, size_replace, QuoteName(script)); + command.replace(pos1, size_replace, quoteName(script)); } return command; @@ -373,7 +374,7 @@ string const createTmpDir(string const & tempdir, string const & mask) return string(); } - return MakeAbsPath(tmpfl); + return makeAbsPath(tmpfl); } } // namespace anon @@ -444,7 +445,7 @@ bool createDirectory(string const & path, int permission) // Strip filename from path name -string const OnlyPath(string const & filename) +string const onlyPath(string const & filename) { // If empty filename, return empty if (filename.empty()) @@ -459,78 +460,78 @@ string const OnlyPath(string const & filename) // Convert relative path into absolute path based on a basepath. // If relpath is absolute, just use that. // If basepath is empty, use CWD as base. -string const MakeAbsPath(string const & RelPath, string const & BasePath) +string const makeAbsPath(string const & relPath, string const & basePath) { // checks for already absolute path - if (os::is_absolute_path(RelPath)) - return RelPath; + if (os::is_absolute_path(relPath)) + return relPath; // Copies given paths - string TempRel = os::internal_path(RelPath); + string tempRel = os::internal_path(relPath); // Since TempRel is NOT absolute, we can safely replace "//" with "/" - TempRel = subst(TempRel, "//", "/"); + tempRel = subst(tempRel, "//", "/"); - string TempBase; + string tempBase; - if (os::is_absolute_path(BasePath)) - TempBase = BasePath; + if (os::is_absolute_path(basePath)) + tempBase = basePath; else - TempBase = AddPath(getcwd(), BasePath); + tempBase = addPath(getcwd(), basePath); // Handle /./ at the end of the path - while (suffixIs(TempBase, "/./")) - TempBase.erase(TempBase.length() - 2); + while (suffixIs(tempBase, "/./")) + tempBase.erase(tempBase.length() - 2); // processes relative path - string RTemp = TempRel; - string Temp; + string rTemp = tempRel; + string temp; - while (!RTemp.empty()) { + while (!rTemp.empty()) { // Split by next / - RTemp = split(RTemp, Temp, '/'); + rTemp = split(rTemp, temp, '/'); - if (Temp == ".") continue; - if (Temp == "..") { + if (temp == ".") continue; + if (temp == "..") { // Remove one level of TempBase - string::difference_type i = TempBase.length() - 2; + string::difference_type i = tempBase.length() - 2; #ifndef __EMX__ if (i < 0) i = 0; - while (i > 0 && TempBase[i] != '/') + while (i > 0 && tempBase[i] != '/') --i; if (i > 0) #else if (i < 2) i = 2; - while (i > 2 && TempBase[i] != '/') + while (i > 2 && tempBase[i] != '/') --i; if (i > 2) #endif - TempBase.erase(i, string::npos); + tempBase.erase(i, string::npos); else - TempBase += '/'; - } else if (Temp.empty() && !RTemp.empty()) { - TempBase = os::current_root() + RTemp; - RTemp.erase(); + tempBase += '/'; + } else if (temp.empty() && !rTemp.empty()) { + tempBase = os::current_root() + rTemp; + rTemp.erase(); } else { // Add this piece to TempBase - if (!suffixIs(TempBase, '/')) - TempBase += '/'; - TempBase += Temp; + if (!suffixIs(tempBase, '/')) + tempBase += '/'; + tempBase += temp; } } // returns absolute path - return os::internal_path(TempBase); + return os::internal_path(tempBase); } // Correctly append filename to the pathname. // If pathname is '.', then don't use pathname. // Chops any path of filename. -string const AddName(string const & path, string const & fname) +string const addName(string const & path, string const & fname) { - string const basename = OnlyFilename(fname); + string const basename = onlyFilename(fname); string buf; if (path != "." && path != "./" && !path.empty()) { @@ -544,7 +545,7 @@ string const AddName(string const & path, string const & fname) // Strips path from filename -string const OnlyFilename(string const & fname) +string const onlyFilename(string const & fname) { if (fname.empty()) return fname; @@ -559,7 +560,7 @@ string const OnlyFilename(string const & fname) /// Returns true is path is absolute -bool AbsolutePath(string const & path) +bool absolutePath(string const & path) { return os::is_absolute_path(path); } @@ -567,27 +568,27 @@ bool AbsolutePath(string const & path) // Create absolute path. If impossible, don't do anything // Supports ./ and ~/. Later we can add support for ~logname/. (Asger) -string const ExpandPath(string const & path) +string const expandPath(string const & path) { // checks for already absolute path - string RTemp = ReplaceEnvironmentPath(path); - if (os::is_absolute_path(RTemp)) - return RTemp; + string rTemp = replaceEnvironmentPath(path); + if (os::is_absolute_path(rTemp)) + return rTemp; - string Temp; - string const copy = RTemp; + string temp; + string const copy = rTemp; // Split by next / - RTemp = split(RTemp, Temp, '/'); + rTemp = split(rTemp, temp, '/'); - if (Temp == ".") - return getcwd() + '/' + RTemp; + if (temp == ".") + return getcwd() + '/' + rTemp; - if (Temp == "~") - return package().home_dir() + '/' + RTemp; + if (temp == "~") + return package().home_dir() + '/' + rTemp; - if (Temp == "..") - return MakeAbsPath(copy); + if (temp == "..") + return makeAbsPath(copy); // Don't know how to handle this return copy; @@ -597,7 +598,7 @@ string const ExpandPath(string const & path) // Normalize a path. Constracts path/../path // Can't handle "../../" or "/../" (Asger) // Also converts paths like /foo//bar ==> /foo/bar -string const NormalizePath(string const & path) +string const normalizePath(string const & path) { // Normalize paths like /foo//bar ==> /foo/bar static boost::regex regex("/{2,}"); @@ -612,7 +613,7 @@ string const NormalizePath(string const & path) } -string const GetFileContents(string const & fname) +string const getFileContents(string const & fname) { if (fs::exists(fname)) { ifstream ifs(fname.c_str()); @@ -629,7 +630,7 @@ string const GetFileContents(string const & fname) // Search the string for ${VAR} and $VAR and replace VAR using getenv. -string const ReplaceEnvironmentPath(string const & path) +string const replaceEnvironmentPath(string const & path) { // ${VAR} is defined as // $\{[A-Za-z_][A-Za-z_0-9]*\} @@ -658,7 +659,7 @@ string const ReplaceEnvironmentPath(string const & path) // Make relative path out of two absolute paths -string const MakeRelPath(string const & abspath, string const & basepath) +string const makeRelPath(string const & abspath, string const & basepath) // Makes relative path out of absolute path. If it is deeper than basepath, // it's easy. If basepath and abspath share something (they are all deeper // than some directory), it'll be rendered using ..'s. If they are completely @@ -703,7 +704,7 @@ string const MakeRelPath(string const & abspath, string const & basepath) // Append sub-directory(ies) to a path in an intelligent way -string const AddPath(string const & path, string const & path_2) +string const addPath(string const & path, string const & path_2) { string buf; string const path2 = os::internal_path(path_2); @@ -729,7 +730,7 @@ string const AddPath(string const & path, string const & path_2) Strips path off if no_path == true. If no extension on oldname, just appends. */ -string const ChangeExtension(string const & oldname, string const & extension) +string const changeExtension(string const & oldname, string const & extension) { string::size_type const last_slash = oldname.rfind('/'); string::size_type last_dot = oldname.rfind('.'); @@ -749,12 +750,12 @@ string const ChangeExtension(string const & oldname, string const & extension) string const removeExtension(string const & name) { - return ChangeExtension(name, string()); + return changeExtension(name, string()); } /// Return the extension of the file (not including the .) -string const GetExtension(string const & name) +string const getExtension(string const & name) { string::size_type const last_slash = name.rfind('/'); string::size_type const last_dot = name.rfind('.'); @@ -958,9 +959,9 @@ bool zippedFile(string const & name) string const unzippedFileName(string const & zipped_file) { - string const ext = GetExtension(zipped_file); + string const ext = getExtension(zipped_file); if (ext == "gz" || ext == "z" || ext == "Z") - return ChangeExtension(zipped_file, string()); + return changeExtension(zipped_file, string()); return "unzipped_" + zipped_file; } @@ -979,7 +980,7 @@ string const unzipFile(string const & zipped_file, string const & unzipped_file) } -string const MakeDisplayPath(string const & path, unsigned int threshold) +string const makeDisplayPath(string const & path, unsigned int threshold) { string str = path; string const home = package().home_dir(); @@ -1001,7 +1002,7 @@ string const MakeDisplayPath(string const & path, unsigned int threshold) if (str.empty()) { // Yes, filename itself is too long. // Pick the start and the end of the filename. - str = OnlyFilename(path); + str = onlyFilename(path); string const head = str.substr(0, threshold / 2 - 3); string::size_type len = str.length(); @@ -1014,7 +1015,7 @@ string const MakeDisplayPath(string const & path, unsigned int threshold) } -bool LyXReadLink(string const & file, string & link, bool resolve) +bool readLink(string const & file, string & link, bool resolve) { #ifdef HAVE_READLINK char linkbuffer[512]; @@ -1025,7 +1026,7 @@ bool LyXReadLink(string const & file, string & link, bool resolve) return false; linkbuffer[nRead] = '\0'; // terminator if (resolve) - link = MakeAbsPath(linkbuffer, OnlyPath(file)); + link = makeAbsPath(linkbuffer, onlyPath(file)); else link = linkbuffer; return true; @@ -1035,7 +1036,7 @@ bool LyXReadLink(string const & file, string & link, bool resolve) } -cmd_ret const RunCommand(string const & cmd) +cmd_ret const runCommand(string const & cmd) { // FIXME: replace all calls to RunCommand with ForkedCall // (if the output is not needed) or the code in ispell.C @@ -1097,7 +1098,7 @@ string const findtexfile(string const & fil, string const & /*format*/) // If the file can be found directly, we just return a // absolute path version of it. if (fs::exists(fil)) - return MakeAbsPath(fil); + return makeAbsPath(fil); // No we try to find it using kpsewhich. // It seems from the kpsewhich manual page that it is safe to use @@ -1121,7 +1122,7 @@ string const findtexfile(string const & fil, string const & /*format*/) // should help it by setting additional path in the approp. envir.var. string const kpsecmd = "kpsewhich " + fil; - cmd_ret const c = RunCommand(kpsecmd); + cmd_ret const c = runCommand(kpsecmd); lyxerr[Debug::LATEX] << "kpse status = " << c.first << '\n' << "kpse result = `" << rtrim(c.second, "\n") @@ -1135,9 +1136,9 @@ string const findtexfile(string const & fil, string const & /*format*/) void removeAutosaveFile(string const & filename) { - string a = OnlyPath(filename); + string a = onlyPath(filename); a += '#'; - a += OnlyFilename(filename); + a += onlyFilename(filename); a += '#'; if (fs::exists(a)) unlink(a); @@ -1202,8 +1203,8 @@ string const readBB_from_PSFile(string const & file) int compare_timestamps(string const & file1, string const & file2) { - BOOST_ASSERT(AbsolutePath(file1)); - BOOST_ASSERT(AbsolutePath(file2)); + BOOST_ASSERT(absolutePath(file1)); + BOOST_ASSERT(absolutePath(file2)); // If the original is newer than the copy, then copy the original // to the new directory. diff --git a/src/support/filetools.h b/src/support/filetools.h index b363033778..7820a01dbe 100644 --- a/src/support/filetools.h +++ b/src/support/filetools.h @@ -43,27 +43,29 @@ std::string const createLyXTmpDir(std::string const & deflt); If path entry begins with $$User/, use user_lyxdir. Example: "$$User/doc;$$LyX/doc". */ -std::string const FileOpenSearch(std::string const & path, std::string const & name, - std::string const & ext = std::string()); +std::string const fileOpenSearch(std::string const & path, + std::string const & name, + std::string const & ext = std::string()); /** Returns the real name of file name in directory path, with optional extension ext. The file is searched in the given path (unless it is an absolute file name), first directly, and then with extension .ext (if given). */ -std::string const FileSearch(std::string const & path, std::string const & name, - std::string const & ext = std::string()); +std::string const fileSearch(std::string const & path, + std::string const & name, + std::string const & ext = std::string()); /// Returns a vector of all files in directory dir having extension ext. -std::vector const DirList(std::string const & dir, - std::string const & ext = std::string()); +std::vector const dirList(std::string const & dir, + std::string const & ext = std::string()); /** Is directory read only? returns true: dir writeable false: not writeable */ -bool isDirWriteable (std::string const & path); +bool isDirWriteable(std::string const & path); /** Is a file readable ? Returns true if the file `path' is readable. @@ -83,15 +85,17 @@ bool isSGMLFilename(std::string const & filename); -# system_lyxdir The third parameter `ext' is optional. */ -std::string const LibFileSearch(std::string const & dir, std::string const & name, - std::string const & ext = std::string()); +std::string const libFileSearch(std::string const & dir, + std::string const & name, + std::string const & ext = std::string()); -/** Same as LibFileSearch(), but tries first to find an +/** Same as libFileSearch(), but tries first to find an internationalized version of the file by prepending $LANG_ to the name */ std::string const -i18nLibFileSearch(std::string const & dir, std::string const & name, +i18nLibFileSearch(std::string const & dir, + std::string const & name, std::string const & ext = std::string()); /** Takes a command such as "sh $$s/scripts/convertDefault.sh file.in file.out" @@ -100,7 +104,7 @@ i18nLibFileSearch(std::string const & dir, std::string const & name, * command will still fail, but the error message will make some sort of * sense ;-) */ -std::string const LibScriptSearch(std::string const & command); +std::string const libScriptSearch(std::string const & command); enum latex_path_extension { PROTECT_EXTENSION, @@ -136,29 +140,29 @@ std::string const latex_path(std::string const & path, latex_path_dots dots = LEAVE_DOTS); /// Substitutes active latex characters with underscores in filename -std::string const MakeLatexName(std::string const & file); +std::string const makeLatexName(std::string const & file); /// Put the name in quotes suitable for the current shell -std::string const QuoteName(std::string const & file); +std::string const quoteName(std::string const & file); /// Add a filename to a path. Any path from filename is stripped first. -std::string const AddName(std::string const & path, std::string const & fname); +std::string const addName(std::string const & path, std::string const & fname); /// Append sub-directory(ies) to path in an intelligent way -std::string const AddPath(std::string const & path, std::string const & path2); +std::string const addPath(std::string const & path, std::string const & path2); /** Change extension of oldname to extension. If oldname does not have an extension, it is appended. If the extension is empty, any extension is removed from the name. */ std::string const -ChangeExtension(std::string const & oldname, std::string const & extension); +changeExtension(std::string const & oldname, std::string const & extension); /// Remove the extension from \p name std::string const removeExtension(std::string const & name); /// Return the extension of the file (not including the .) -std::string const GetExtension(std::string const & name); +std::string const getExtension(std::string const & name); /** Guess the file format name (as in Format::name()) from contents. Normally you don't want to use this directly, but rather @@ -183,23 +187,23 @@ std::string const unzipFile(std::string const & zipped_file, std::string const & unzipped_file = std::string()); /// Returns true is path is absolute -bool AbsolutePath(std::string const & path); +bool absolutePath(std::string const & path); /// Create absolute path. If impossible, don't do anything -std::string const ExpandPath(std::string const & path); +std::string const expandPath(std::string const & path); /** Convert relative path into absolute path based on a basepath. If relpath is absolute, just use that. If basepath doesn't exist use CWD. */ -std::string const MakeAbsPath(std::string const & RelPath = std::string(), - std::string const & BasePath = std::string()); +std::string const makeAbsPath(std::string const & RelPath = std::string(), + std::string const & BasePath = std::string()); /** Creates a nice compact path for displaying. The parameter threshold, if given, specifies the maximal length of the path. */ std::string const -MakeDisplayPath(std::string const & path, unsigned int threshold = 1000); +makeDisplayPath(std::string const & path, unsigned int threshold = 1000); /** Makes relative path out of absolute path. If it is deeper than basepath, @@ -209,36 +213,39 @@ MakeDisplayPath(std::string const & path, unsigned int threshold = 1000); WARNING: the absolute path and base path must really be absolute paths!!! */ std::string const -MakeRelPath(std::string const & abspath, std::string const & basepath); +makeRelPath(std::string const & abspath, std::string const & basepath); /// Strip filename from path name -std::string const OnlyPath(std::string const & fname); +std::string const onlyPath(std::string const & fname); /** Normalize a path. Constracts path/../path * Also converts paths like /foo//bar ==> /foo/bar */ -std::string const NormalizePath(std::string const & path); +std::string const normalizePath(std::string const & path); /// Strips path from filename -std::string const OnlyFilename(std::string const & fname); +std::string const onlyFilename(std::string const & fname); /// Get the contents of a file as a huge std::string -std::string const GetFileContents(std::string const & fname); +std::string const getFileContents(std::string const & fname); /** Check and Replace Environmentvariables ${NAME} in Path. Replaces all occurences of these, if they are found in the environment. Variables are defined by Var := '${' [a-zA-Z_][a-zA-Z_0-9]* '}' */ -std::string const ReplaceEnvironmentPath(std::string const & path); +std::string const replaceEnvironmentPath(std::string const & path); /* Set \c link to the path \c file points to as a symbolic link. If \c resolve is true, then \c link is an absolute path Returns true if successful */ -bool LyXReadLink(std::string const & file, std::string & link, bool resolve = false); +bool readLink(std::string const & file, + std::string & link, + bool resolve = false); /// Uses kpsewhich to find tex files -std::string const findtexfile(std::string const & fil, std::string const & format); +std::string const findtexfile(std::string const & fil, + std::string const & format); /// remove the autosave-file and give a Message if it can't be done void removeAutosaveFile(std::string const & filename); @@ -257,7 +264,7 @@ int compare_timestamps(std::string const & file1, std::string const & file2); typedef std::pair cmd_ret; -cmd_ret const RunCommand(std::string const & cmd); +cmd_ret const runCommand(std::string const & cmd); } // namespace support } // namespace lyx diff --git a/src/support/package.C.in b/src/support/package.C.in index 1cc8ba0302..e036dcb871 100644 --- a/src/support/package.C.in +++ b/src/support/package.C.in @@ -125,7 +125,7 @@ Package::Package(string const & command_line_arg0, document_dir_ = get_document_dir(home_dir_); string const abs_binary = abs_path_from_binary_name(command_line_arg0); - binary_dir_ = OnlyPath(abs_binary); + binary_dir_ = onlyPath(abs_binary); // Is LyX being run in-place from the build tree? boost::tie(build_support_dir_, system_support_dir_) = @@ -224,7 +224,7 @@ get_build_support_dir(std::string const & binary_dir, break; } - return NormalizePath(AddPath(binary_dir, indirection)); + return normalizePath(addPath(binary_dir, indirection)); } @@ -245,17 +245,17 @@ get_build_dirs(string const & abs_binary, string binary = abs_binary; while (true) { // Try and find "lyxrc.defaults". - string const binary_dir = OnlyPath(binary); + string const binary_dir = onlyPath(binary); string const build_support_dir = get_build_support_dir(binary_dir, top_build_dir_location); - if (!FileSearch(build_support_dir, "lyxrc.defaults").empty()) { + if (!fileSearch(build_support_dir, "lyxrc.defaults").empty()) { // Try and find "chkconfig.ltx". string const system_support_dir = - MakeAbsPath(AddPath(top_srcdir(), "lib"), - AddPath(binary_dir, "support")); + makeAbsPath(addPath(top_srcdir(), "lib"), + addPath(binary_dir, "support")); - if (!FileSearch(system_support_dir, "chkconfig.ltx").empty()) { + if (!fileSearch(system_support_dir, "chkconfig.ltx").empty()) { lyxerr[Debug::INIT] << check_text << " yes" << std::endl; return std::make_pair(build_support_dir, system_support_dir); @@ -268,7 +268,7 @@ get_build_dirs(string const & abs_binary, break; string link; - if (LyXReadLink(binary, link, true)) { + if (readLink(binary, link, true)) { binary = link; } else { // Unable to resolve the link. @@ -322,7 +322,7 @@ string const get_locale_dir(string const & system_support_dir) // 2. Search for system_support_dir / // The is OS-dependent. (On Unix, it will // be "../locale/".) - path = NormalizePath(AddPath(system_support_dir, relative_locale_dir())); + path = normalizePath(addPath(system_support_dir, relative_locale_dir())); if (fs::exists(path) && fs::is_directory(path)) return path; @@ -367,7 +367,7 @@ string const abs_path_from_command_line(string const & command_line) return string(); string const path = os::internal_path(command_line); - return os::is_absolute_path(path) ? path : MakeAbsPath(path); + return os::is_absolute_path(path) ? path : makeAbsPath(path); } @@ -389,13 +389,13 @@ string const get_binary_path(string const & exe) // Two possibilities present themselves. // 1. The binary is relative to the CWD. - string const abs_exe_path = MakeAbsPath(exe_path); + string const abs_exe_path = makeAbsPath(exe_path); if (fs::exists(abs_exe_path)) return abs_exe_path; // 2. exe must be the name of the binary only and it // can be found on the PATH. - string const exe_name = OnlyFilename(exe_path); + string const exe_name = onlyFilename(exe_path); if (exe_name != exe_path) return string(); @@ -404,9 +404,9 @@ string const get_binary_path(string const & exe) std::vector::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); + string const exe_dir = makeAbsPath(*it); - string const exe_path = AddName(exe_dir, exe_name); + string const exe_path = addName(exe_dir, exe_name); if (fs::exists(exe_path)) return exe_path; } @@ -472,13 +472,13 @@ get_system_support_dir(string const & abs_binary, string binary = abs_binary; while (true) { // Try and find "chkconfig.ltx". - string const binary_dir = OnlyPath(binary); + string const binary_dir = onlyPath(binary); string const lyxdir = - NormalizePath(AddPath(binary_dir, relative_lyxdir)); + normalizePath(addPath(binary_dir, relative_lyxdir)); searched_dirs.push_back(lyxdir); - if (!FileSearch(lyxdir, chkconfig_ltx).empty()) { + if (!fileSearch(lyxdir, chkconfig_ltx).empty()) { // Success! "chkconfig.ltx" has been found. return lyxdir; } @@ -489,7 +489,7 @@ get_system_support_dir(string const & abs_binary, break; string link; - if (LyXReadLink(binary, link, true)) { + if (readLink(binary, link, true)) { binary = link; } else { // Unable to resolve the link. @@ -498,7 +498,7 @@ get_system_support_dir(string const & abs_binary, } // 4. Repeat the exercise on the directory itself. - string binary_dir = OnlyPath(abs_binary); + string binary_dir = onlyPath(abs_binary); while (true) { // This time test whether the directory is a symbolic link // *before* looking for "chkconfig.ltx". @@ -507,7 +507,7 @@ get_system_support_dir(string const & abs_binary, break; string link; - if (LyXReadLink(binary_dir, link, true)) { + if (readLink(binary_dir, link, true)) { binary_dir = link; } else { // Unable to resolve the link. @@ -516,10 +516,10 @@ get_system_support_dir(string const & abs_binary, // Try and find "chkconfig.ltx". string const lyxdir = - NormalizePath(AddPath(binary_dir, relative_lyxdir)); + normalizePath(addPath(binary_dir, relative_lyxdir)); searched_dirs.push_back(lyxdir); - if (!FileSearch(lyxdir, chkconfig_ltx).empty()) { + if (!fileSearch(lyxdir, chkconfig_ltx).empty()) { // Success! "chkconfig.ltx" has been found. return lyxdir; } @@ -527,7 +527,7 @@ get_system_support_dir(string const & abs_binary, // 5. In desparation, try the hard-coded system support dir. path = hardcoded_system_support_dir(); - if (!FileSearch(path, chkconfig_ltx).empty()) + if (!fileSearch(path, chkconfig_ltx).empty()) return path; // Everything has failed :-( @@ -592,7 +592,7 @@ string const get_default_user_support_dir(string const & home_dir) (void)home_dir; // Silence warning about unused variable. os::GetFolderPath win32_folder_path; - return AddPath(win32_folder_path(os::GetFolderPath::APPDATA), PACKAGE); + return addPath(win32_folder_path(os::GetFolderPath::APPDATA), PACKAGE); #elif defined (USE_MACOSX_PACKAGING) (void)home_dir; // Silence warning about unused variable. @@ -611,10 +611,10 @@ string const get_default_user_support_dir(string const & home_dir) if (status_code != 0) return string(); - return AddPath(reinterpret_cast(store), PACKAGE); + return addPath(reinterpret_cast(store), PACKAGE); #else // USE_POSIX_PACKAGING - return AddPath(home_dir, string(".") + PACKAGE); + return addPath(home_dir, string(".") + PACKAGE); #endif } @@ -625,7 +625,7 @@ bool check_command_line_dir(string const & dir, string const & file, string const & command_line_switch) { - string const abs_path = FileSearch(dir, file); + string const abs_path = fileSearch(dir, file); if (abs_path.empty()) { lyxerr << bformat(_("Invalid %1$s switch.\n" "Directory %2$s does not contain %3$s."), @@ -641,7 +641,7 @@ bool check_command_line_dir(string const & dir, string const extract_env_var_dir(string const & env_var) { string const dir = os::internal_path(getEnv(env_var)); - return dir.empty() ? dir : MakeAbsPath(dir); + return dir.empty() ? dir : makeAbsPath(dir); } @@ -651,11 +651,11 @@ bool check_env_var_dir(string const & dir, string const & file, string const & env_var) { - string const abs_path = FileSearch(dir, file); + string const abs_path = fileSearch(dir, file); if (abs_path.empty()) { lyxerr << bformat(_("Invalid %1$s environment variable.\n" "Directory %2$s does not contain %3$s."), - env_var, dir, file) + env_var, dir, file) << std::endl; } @@ -701,7 +701,7 @@ string const relative_system_support_dir() #if defined (USE_WINDOWS_PACKAGING) || defined (USE_MACOSX_PACKAGING) result = "../Resources/"; #else // Posix-like. - result = AddPath("../share/", PACKAGE); + result = addPath("../share/", PACKAGE); #endif return result; diff --git a/src/support/tempname.C b/src/support/tempname.C index 601e21b30f..54833b5b47 100644 --- a/src/support/tempname.C +++ b/src/support/tempname.C @@ -73,7 +73,7 @@ int make_tempfile(char * templ) string const lyx::support::tempName(string const & dir, string const & mask) { string const tmpdir(dir.empty() ? package().temp_dir() : dir); - string tmpfl(AddName(tmpdir, mask)); + string tmpfl(addName(tmpdir, mask)); #if defined (HAVE_GETPID) tmpfl += convert(getpid()); #elif defined (HAVE__GETPID) diff --git a/src/support/tests/filetools.C b/src/support/tests/filetools.C index 2c391c4fc7..1b28cf619c 100755 --- a/src/support/tests/filetools.C +++ b/src/support/tests/filetools.C @@ -11,20 +11,20 @@ string _(string const & str) return str; } -void test_NormalizePath() +void test_normalizePath() { - cout << NormalizePath("foo/../bar") << endl; - cout << NormalizePath("foo/./bar") << endl; - cout << NormalizePath("./foo/../bar") << endl; - cout << NormalizePath("./foo/./bar") << endl; - cout << NormalizePath("/foo/../bar") << endl; - cout << NormalizePath("/foo/./bar") << endl; - cout << NormalizePath("foo//bar") << endl; - cout << NormalizePath("./foo//bar") << endl; - cout << NormalizePath("/foo//bar") << endl; + cout << normalizePath("foo/../bar") << endl; + cout << normalizePath("foo/./bar") << endl; + cout << normalizePath("./foo/../bar") << endl; + cout << normalizePath("./foo/./bar") << endl; + cout << normalizePath("/foo/../bar") << endl; + cout << normalizePath("/foo/./bar") << endl; + cout << normalizePath("foo//bar") << endl; + cout << normalizePath("./foo//bar") << endl; + cout << normalizePath("/foo//bar") << endl; } int main() { - test_NormalizePath(); + test_normalizePath(); } diff --git a/src/tex2lyx/preamble.C b/src/tex2lyx/preamble.C index 5226dbbe1f..ae6cadbd0f 100644 --- a/src/tex2lyx/preamble.C +++ b/src/tex2lyx/preamble.C @@ -34,7 +34,7 @@ using std::vector; using std::cerr; using std::endl; -using lyx::support::LibFileSearch; +using lyx::support::libFileSearch; // special columntypes extern std::map special_columns; @@ -485,7 +485,7 @@ LyXTextClass const parse_preamble(Parser & p, ostream & os, string const & force if (!forceclass.empty()) { h_textclass = forceclass; } - string layoutfilename = LibFileSearch("layouts", h_textclass, "layout"); + string layoutfilename = libFileSearch("layouts", h_textclass, "layout"); if (layoutfilename.empty()) { cerr << "Error: Could not find layout file for textclass \"" << h_textclass << "\"." << endl; exit(1); diff --git a/src/tex2lyx/tex2lyx.C b/src/tex2lyx/tex2lyx.C index 9d2bea9366..06905f42c0 100644 --- a/src/tex2lyx/tex2lyx.C +++ b/src/tex2lyx/tex2lyx.C @@ -52,11 +52,11 @@ using std::string; using std::vector; using std::map; -using lyx::support::ChangeExtension; +using lyx::support::changeExtension; using lyx::support::isStrUnsignedInt; using lyx::support::ltrim; -using lyx::support::MakeAbsPath; -using lyx::support::OnlyPath; +using lyx::support::makeAbsPath; +using lyx::support::onlyPath; using lyx::support::rtrim; using lyx::support::isFileReadable; @@ -431,7 +431,7 @@ void tex2lyx(std::istream &is, std::ostream &os) /// convert TeX from \p infilename to LyX and write it to \p os bool tex2lyx(string const &infilename, std::ostream &os) { - BOOST_ASSERT(lyx::support::AbsolutePath(infilename)); + BOOST_ASSERT(lyx::support::absolutePath(infilename)); ifstream is(infilename.c_str()); if (!is.good()) { cerr << "Could not open input file \"" << infilename @@ -439,7 +439,7 @@ bool tex2lyx(string const &infilename, std::ostream &os) return false; } string const oldParentFilePath = parentFilePath; - parentFilePath = OnlyPath(infilename); + parentFilePath = onlyPath(infilename); tex2lyx(is, os); parentFilePath = oldParentFilePath; return true; @@ -494,16 +494,16 @@ int main(int argc, char * argv[]) // Now every known option is parsed. Look for input and output // file name (the latter is optional). - string const infilename = MakeAbsPath(argv[1]); + string const infilename = makeAbsPath(argv[1]); string outfilename; if (argc > 2) { outfilename = argv[2]; if (outfilename != "-") - outfilename = MakeAbsPath(argv[2]); + outfilename = makeAbsPath(argv[2]); } else - outfilename = ChangeExtension(infilename, ".lyx"); + outfilename = changeExtension(infilename, ".lyx"); - string const system_syntaxfile = lyx::support::LibFileSearch("", "syntax.default"); + string const system_syntaxfile = lyx::support::libFileSearch("", "syntax.default"); if (system_syntaxfile.empty()) { cerr << "Error: Could not find syntax file \"syntax.default\"." << endl; exit(1); @@ -512,7 +512,7 @@ int main(int argc, char * argv[]) if (!syntaxfile.empty()) read_syntaxfile(syntaxfile); - masterFilePath = OnlyPath(infilename); + masterFilePath = onlyPath(infilename); parentFilePath = masterFilePath; if (outfilename == "-") { diff --git a/src/tex2lyx/text.C b/src/tex2lyx/text.C index a34222917a..07753e9104 100644 --- a/src/tex2lyx/text.C +++ b/src/tex2lyx/text.C @@ -29,9 +29,9 @@ #include #include -using lyx::support::ChangeExtension; -using lyx::support::MakeAbsPath; -using lyx::support::MakeRelPath; +using lyx::support::changeExtension; +using lyx::support::makeAbsPath; +using lyx::support::makeRelPath; using lyx::support::rtrim; using lyx::support::suffixIs; using lyx::support::contains; @@ -344,7 +344,7 @@ string find_file(string const & name, string const & path, // We don't use ChangeExtension() because it does the wrong // thing if name contains a dot. string const trial = name + '.' + (*what); - if (fs::exists(MakeAbsPath(trial, path))) + if (fs::exists(makeAbsPath(trial, path))) return trial; } return string(); @@ -1004,9 +1004,9 @@ 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 (lyx::support::absolutePath(name)) return; - name = MakeRelPath(MakeAbsPath(name, getMasterFilePath()), + name = makeRelPath(makeAbsPath(name, getMasterFilePath()), getParentFilePath()); } @@ -1384,7 +1384,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, string const path = getMasterFilePath(); // We want to preserve relative / absolute filenames, // therefore path is only used for testing - if (!fs::exists(MakeAbsPath(name, path))) { + if (!fs::exists(makeAbsPath(name, path))) { // The file extension is probably missing. // Now try to find it out. string const dvips_name = @@ -1414,7 +1414,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, name = pdftex_name; } - if (fs::exists(MakeAbsPath(name, path))) + if (fs::exists(makeAbsPath(name, path))) fix_relative_filename(name); else cerr << "Warning: Could not find graphics file '" @@ -2036,7 +2036,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, // We want to preserve relative / absolute filenames, // therefore path is only used for testing if (t.cs() == "include" && - !fs::exists(MakeAbsPath(filename, path))) { + !fs::exists(makeAbsPath(filename, path))) { // The file extension is probably missing. // Now try to find it out. string const tex_name = @@ -2045,14 +2045,14 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, if (!tex_name.empty()) filename = tex_name; } - if (fs::exists(MakeAbsPath(filename, path))) { + if (fs::exists(makeAbsPath(filename, path))) { string const abstexname = - MakeAbsPath(filename, path); + makeAbsPath(filename, path); string const abslyxname = - ChangeExtension(abstexname, ".lyx"); + changeExtension(abstexname, ".lyx"); fix_relative_filename(filename); string const lyxname = - ChangeExtension(filename, ".lyx"); + changeExtension(filename, ".lyx"); if (t.cs() != "verbatiminput" && tex2lyx(abstexname, abslyxname)) { os << name << '{' << lyxname << "}\n"; diff --git a/src/trans.C b/src/trans.C index 3230fabf18..58a8e8884c 100644 --- a/src/trans.C +++ b/src/trans.C @@ -19,7 +19,7 @@ #include "trans_mgr.h" using lyx::support::contains; -using lyx::support::LibFileSearch; +using lyx::support::libFileSearch; using std::endl; using std::string; @@ -325,7 +325,7 @@ string const Trans::process(char c, TransManager & k) int Trans::Load(string const & language) { - string const filename = LibFileSearch("kbd", language, "kmap"); + string const filename = libFileSearch("kbd", language, "kmap"); if (filename.empty()) return -1; diff --git a/src/vc-backend.C b/src/vc-backend.C index d58ea5e624..3225bc18ba 100644 --- a/src/vc-backend.C +++ b/src/vc-backend.C @@ -25,13 +25,13 @@ #include -using lyx::support::AddName; -using lyx::support::AddPath; +using lyx::support::addName; +using lyx::support::addPath; using lyx::support::contains; -using lyx::support::OnlyFilename; -using lyx::support::OnlyPath; +using lyx::support::onlyFilename; +using lyx::support::onlyPath; using lyx::support::Path; -using lyx::support::QuoteName; +using lyx::support::quoteName; using lyx::support::rtrim; using lyx::support::split; using lyx::support::Systemcall; @@ -83,7 +83,7 @@ string const RCS::find_file(string const & file) return tmp; } else { // Check if RCS/*,v exists. - tmp = AddName(AddPath(OnlyPath(file), "RCS"), file); + tmp = addName(addPath(onlyPath(file), "RCS"), file); tmp += ",v"; lyxerr[Debug::LYXVC] << "Checking if file is under rcs: " << tmp << endl; @@ -100,7 +100,7 @@ string const RCS::find_file(string const & file) void RCS::retrieve(string const & file) { lyxerr[Debug::LYXVC] << "LyXVC::RCS: retrieve.\n\t" << file << endl; - VCS::doVCCommand("co -q -r " + QuoteName(file), + VCS::doVCCommand("co -q -r " + quoteName(file), string()); } @@ -174,7 +174,7 @@ void RCS::registrer(string const & msg) string cmd = "ci -q -u -i -t-\""; cmd += msg; cmd += "\" "; - cmd += QuoteName(OnlyFilename(owner_->fileName())); + cmd += quoteName(onlyFilename(owner_->fileName())); doVCCommand(cmd, owner_->filePath()); } @@ -182,7 +182,7 @@ void RCS::registrer(string const & msg) void RCS::checkIn(string const & msg) { doVCCommand("ci -q -u -m\"" + msg + "\" " - + QuoteName(OnlyFilename(owner_->fileName())), + + quoteName(onlyFilename(owner_->fileName())), owner_->filePath()); } @@ -190,7 +190,7 @@ void RCS::checkIn(string const & msg) void RCS::checkOut() { owner_->markClean(); - doVCCommand("co -q -l " + QuoteName(OnlyFilename(owner_->fileName())), + doVCCommand("co -q -l " + quoteName(onlyFilename(owner_->fileName())), owner_->filePath()); } @@ -198,7 +198,7 @@ void RCS::checkOut() void RCS::revert() { doVCCommand("co -f -u" + version() + " " - + QuoteName(OnlyFilename(owner_->fileName())), + + quoteName(onlyFilename(owner_->fileName())), owner_->filePath()); // We ignore changes and just reload! owner_->markClean(); @@ -209,14 +209,14 @@ void RCS::undoLast() { lyxerr[Debug::LYXVC] << "LyXVC: undoLast" << endl; doVCCommand("rcs -o" + version() + " " - + QuoteName(OnlyFilename(owner_->fileName())), + + quoteName(onlyFilename(owner_->fileName())), owner_->filePath()); } void RCS::getLog(string const & tmpf) { - doVCCommand("rlog " + QuoteName(OnlyFilename(owner_->fileName())) + doVCCommand("rlog " + quoteName(onlyFilename(owner_->fileName())) + " > " + tmpf, owner_->filePath()); } @@ -234,8 +234,8 @@ string const CVS::find_file(string const & file) { // First we look for the CVS/Entries in the same dir // where we have file. - string const dir = OnlyPath(file) + "/CVS/Entries"; - string const tmpf = "/" + OnlyFilename(file) + "/"; + string const dir = onlyPath(file) + "/CVS/Entries"; + string const tmpf = "/" + onlyFilename(file) + "/"; lyxerr[Debug::LYXVC] << "LyXVC: checking in `" << dir << "' for `" << tmpf << '\'' << endl; if (fs::is_readable(dir)) { @@ -259,7 +259,7 @@ void CVS::scanMaster() << master_ << endl; // Ok now we do the real scan... ifstream ifs(master_.c_str()); - string tmpf = "/" + OnlyFilename(file_) + "/"; + string tmpf = "/" + onlyFilename(file_) + "/"; lyxerr[Debug::LYXVC] << "\tlooking for `" << tmpf << '\'' << endl; string line; static regex const reg("/(.*)/(.*)/(.*)/(.*)/(.*)"); @@ -303,7 +303,7 @@ void CVS::scanMaster() void CVS::registrer(string const & msg) { doVCCommand("cvs -q add -m \"" + msg + "\" " - + QuoteName(OnlyFilename(owner_->fileName())), + + quoteName(onlyFilename(owner_->fileName())), owner_->filePath()); } @@ -311,7 +311,7 @@ void CVS::registrer(string const & msg) void CVS::checkIn(string const & msg) { doVCCommand("cvs -q commit -m \"" + msg + "\" " - + QuoteName(OnlyFilename(owner_->fileName())), + + quoteName(onlyFilename(owner_->fileName())), owner_->filePath()); } @@ -327,7 +327,7 @@ void CVS::revert() { // Reverts to the version in CVS repository and // gets the updated version from the repository. - string const fil = QuoteName(OnlyFilename(owner_->fileName())); + string const fil = quoteName(onlyFilename(owner_->fileName())); doVCCommand("rm -f " + fil + "; cvs update " + fil, owner_->filePath()); @@ -346,7 +346,7 @@ void CVS::undoLast() void CVS::getLog(string const & tmpf) { - doVCCommand("cvs log " + QuoteName(OnlyFilename(owner_->fileName())) + doVCCommand("cvs log " + quoteName(onlyFilename(owner_->fileName())) + " > " + tmpf, owner_->filePath()); } -- 2.39.5