]> git.lyx.org Git - features.git/commitdiff
support/textutils.h:
authorAndré Pönitz <poenitz@gmx.net>
Sat, 8 Apr 2006 09:09:57 +0000 (09:09 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Sat, 8 Apr 2006 09:09:57 +0000 (09:09 +0000)
support/filetools.h: rename IsDirWriteable IsFileReadable IsLyXFilename
IsSGMLFilename IsLineSeparatorChar IsLetterChar IsPrintable
IsPrintableNonspace IsDigit to lower case initial

lyxvc.C:
LaTeXFeatures.C:
lyx_cb.C:
insets/insetbibtex.C:
insets/insetexternal.C:
insets/insetgraphics.C:
insets/ExternalSupport.C:
insets/insetinclude.C:
BufferView_pimpl.C:
graphics/GraphicsCacheItem.C:
text2.C:
converter.C:
buffer.C:
lyxfunc.C:
frontends/gtk/ghelpers.C:
frontends/controllers/ControlGraphics.C:
frontends/controllers/ControlInclude.C:
frontends/controllers/ControlSpellchecker.C:
support/filetools.C:
support/filetools.h: adjust

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13595 a592a061-630c-0410-9148-cb99ea01b6c8

26 files changed:
src/BufferView_pimpl.C
src/LaTeXFeatures.C
src/buffer.C
src/converter.C
src/frontends/controllers/ControlGraphics.C
src/frontends/controllers/ControlInclude.C
src/frontends/controllers/ControlSpellchecker.C
src/frontends/gtk/ghelpers.C
src/graphics/GraphicsCacheItem.C
src/insets/ExternalSupport.C
src/insets/insetbibtex.C
src/insets/insetexternal.C
src/insets/insetgraphics.C
src/insets/insetinclude.C
src/lyx_cb.C
src/lyxfunc.C
src/lyxtextclass.C
src/lyxvc.C
src/paragraph.C
src/rowpainter.C
src/support/filetools.C
src/support/filetools.h
src/support/textutils.h
src/tex2lyx/tex2lyx.C
src/text.C
src/text2.C

index 09829977b1b11a050da6b9628e5e87e189c2e588..e793188284de4dffd18fa397ed3283c559a65bb1 100644 (file)
@@ -89,7 +89,7 @@ using lyx::support::bformat;
 using lyx::support::FileFilterList;
 using lyx::support::FileSearch;
 using lyx::support::ForkedcallsController;
-using lyx::support::IsDirWriteable;
+using lyx::support::isDirWriteable;
 using lyx::support::MakeDisplayPath;
 using lyx::support::MakeAbsPath;
 using lyx::support::package;
@@ -907,7 +907,7 @@ void BufferView::Pimpl::MenuInsertLyXFile(string const & filenm)
                if (available()) {
                        string const trypath = owner_->buffer()->filePath();
                        // If directory is writeable, use this as default.
-                       if (IsDirWriteable(trypath))
+                       if (isDirWriteable(trypath))
                                initpath = trypath;
                }
 
index 6dee6f82c891211827592d019433210efcd53948..bcda1dc5be0ff49cbabb31c0440bc4b8710ec905 100644 (file)
@@ -30,7 +30,7 @@
 
 #include <sstream>
 
-using lyx::support::IsSGMLFilename;
+using lyx::support::isSGMLFilename;
 using lyx::support::LibFileSearch;
 using lyx::support::MakeRelPath;
 using lyx::support::OnlyPath;
@@ -509,7 +509,7 @@ string const LaTeXFeatures::getIncludedFiles(string const & fname) const
        for (FileMap::const_iterator fi = IncludedFiles_.begin();
             fi != end; ++fi)
                sgmlpreamble << "\n<!ENTITY " << fi->first
-                            << (IsSGMLFilename(fi->second) ? " SYSTEM \"" : " \"")
+                            << (isSGMLFilename(fi->second) ? " SYSTEM \"" : " \"")
                             << MakeRelPath(fi->second, basename) << "\">";
 
        return sgmlpreamble.str();
index 0dc0229063dd209618ff1d7e398c56cad322e746..77b6e46bb14d3eafe11b19bcb0f1ee035ee9427b 100644 (file)
@@ -101,7 +101,7 @@ using lyx::support::cmd_ret;
 using lyx::support::createBufferTmpDir;
 using lyx::support::destroyDir;
 using lyx::support::getFormatFromContents;
-using lyx::support::IsDirWriteable;
+using lyx::support::isDirWriteable;
 using lyx::support::LibFileSearch;
 using lyx::support::latex_path;
 using lyx::support::ltrim;
@@ -531,7 +531,7 @@ void Buffer::insertStringAsLines(ParagraphList & pars,
                                }
                                space_inserted = true;
                        }
-               } else if (!IsPrintable(*cit)) {
+               } else if (!isPrintable(*cit)) {
                        // Ignore unprintables
                        continue;
                } else {
index c9df81fc83d948b2e8424e4cf4b1d0af72714995..334f790beee41f914e78ba32e5a6ecd1236a74e8 100644 (file)
@@ -36,7 +36,7 @@ using lyx::support::compare_ascii_no_case;
 using lyx::support::contains;
 using lyx::support::DirList;
 using lyx::support::GetExtension;
-using lyx::support::IsFileReadable;
+using lyx::support::isFileReadable;
 using lyx::support::LibFileSearch;
 using lyx::support::LibScriptSearch;
 using lyx::support::MakeRelPath;
@@ -310,7 +310,7 @@ bool Converters::convert(Buffer const * buffer,
                                << command << endl;
                        Systemcall one;
                        one.startscript(Systemcall::Wait, command);
-                       if (IsFileReadable(to_file)) {
+                       if (isFileReadable(to_file)) {
                                return true;
                        }
                }
index f409c02b0e0d2a715eb656e2ec2583a29e882115..e7c5e4157f9d93f2bd3d2513659641ea34d12c5c 100644 (file)
@@ -44,7 +44,7 @@ namespace lyx {
 
 using support::AddName;
 using support::FileFilterList;
-using support::IsFileReadable;
+using support::isFileReadable;
 using support::MakeAbsPath;
 using support::package;
 using support::readBB_from_PSFile;
@@ -133,7 +133,7 @@ bool ControlGraphics::isFilenameValid(string const & fname) const
 {
        // It may be that the filename is relative.
        string const name = MakeAbsPath(fname, kernel().bufferFilepath());
-       return IsFileReadable(name);
+       return isFileReadable(name);
 }
 
 
index 92e5e50a2d74b277a6f54d6689f9316bd7f10828..96b57156b10716e3424ff3b310163f6104c4545f 100644 (file)
@@ -35,7 +35,7 @@ using std::string;
 namespace lyx {
 
 using support::FileFilterList;
-using support::IsFileReadable;
+using support::isFileReadable;
 using support::MakeAbsPath;
 using support::OnlyPath;
 
@@ -114,7 +114,7 @@ bool ControlInclude::fileExists(string const & file)
                = MakeAbsPath(file,
                              OnlyPath(kernel().buffer().fileName()));
 
-       if (IsFileReadable(fileWithAbsPath))
+       if (isFileReadable(fileWithAbsPath))
                return true;
 
        return false;
index 2ff7e4fcd3cdd9c5b8e2a505f644d74d8e236ce1..64a9d5532c26794930a76172c182cefe0148dc32 100644 (file)
@@ -161,7 +161,7 @@ WordLangTuple nextWord(DocIterator & cur, ptrdiff_t & progress,
                                Paragraph::value_type const c =
                                        cur.paragraph().getChar(cur.pos());
                                word += c;
-                               if (IsDigit(c))
+                               if (isDigit(c))
                                        ignoreword = true;
                        }
                } else { // !isLetter(cur)
index fa894a3cad32afea798791f12b4ee5fa4fef626b..5d0b89fb87df3683fd483a989034443da0b5d5c2 100644 (file)
@@ -257,7 +257,7 @@ string const findGladeFile(string const & name)
        filename = lyx::support::ChangeExtension(name, ".glade");
        filename = lyx::support::AddName(dir, filename);
 
-       if (!lyx::support::IsFileReadable(filename)) {
+       if (!lyx::support::isFileReadable(filename)) {
                lyxerr << "Unable to find glade file \"" << name
                       << "\". libglade is going to crash..." << std::endl;
        }
index ee9441d125911d73b6c040cba0e88a9236904d5f..e0cd2c7a95f061dd97c80d77e6db92fc2ba91871 100644 (file)
@@ -30,7 +30,7 @@ namespace support = lyx::support;
 
 using support::ChangeExtension;
 using support::FileMonitor;
-using support::IsFileReadable;
+using support::isFileReadable;
 using support::MakeDisplayPath;
 using support::OnlyFilename;
 using support::tempName;
@@ -267,7 +267,7 @@ void CacheItem::Impl::imageConverted(bool success)
        converter_.reset();
        cc_.disconnect();
 
-       success = !file_to_load_.empty() && IsFileReadable(file_to_load_);
+       success = !file_to_load_.empty() && isFileReadable(file_to_load_);
 
        if (!success) {
                lyxerr[Debug::GRAPHICS] << "Unable to find converted file!"
@@ -378,7 +378,7 @@ void CacheItem::Impl::convertToDisplayFormat()
        setStatus(Converting);
 
        // First, check that the file exists!
-       if (!IsFileReadable(filename_)) {
+       if (!isFileReadable(filename_)) {
                if (status_ != ErrorNoFile) {
                        setStatus(ErrorNoFile);
                        lyxerr[Debug::GRAPHICS]
index 17cb9ba44dda8a28a081b42a3112548100c0bb76..c52a0c7d13b96aa64b4a2962922073de748df1b2 100644 (file)
@@ -172,11 +172,11 @@ string const doSubstitution(InsetExternalParams const & params,
                string const file = result.substr(pos + 12, end - (pos + 12));
                string contents;
 
-               string const filepath = support::IsFileReadable(file) ?
+               string const filepath = support::isFileReadable(file) ?
                        buffer.filePath() : m_buffer->temppath();
                support::Path p(filepath);
 
-               if (support::IsFileReadable(file))
+               if (support::isFileReadable(file))
                        contents = support::GetFileContents(file);
 
                result = support::subst(result,
index 6e33f4c82381199d85d0250db09cd0b0195c73d6..2a5ee6f4ce1b5eb1575948f38c746dbe8978603a 100644 (file)
@@ -43,7 +43,7 @@ using lyx::support::contains;
 using lyx::support::copy;
 using lyx::support::FileName;
 using lyx::support::findtexfile;
-using lyx::support::IsFileReadable;
+using lyx::support::isFileReadable;
 using lyx::support::latex_path;
 using lyx::support::ltrim;
 using lyx::support::MakeAbsPath;
@@ -112,7 +112,7 @@ 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))
+       if (AbsolutePath(name) || !isFileReadable(fname + ext))
                return name;
        else if (!runparams.nice)
                return fname;
@@ -162,7 +162,7 @@ int InsetBibtex::latex(Buffer const & buffer, ostream & os,
                string const in_file = database + ".bib";
 
                if (!runparams.inComment && !runparams.nice &&
-                   IsFileReadable(in_file)) {
+                   isFileReadable(in_file)) {
 
                        // mangledFilename() needs the extension
                        database = removeExtension(FileName(in_file).mangledFilename());
@@ -217,7 +217,7 @@ int InsetBibtex::latex(Buffer const & buffer, ostream & os,
                // This prevents problems with spaces and 8bit charcaters
                // in the file name.
                if (!runparams.inComment && !runparams.nice &&
-                   IsFileReadable(in_file)) {
+                   isFileReadable(in_file)) {
                        // use new style name
                        base = removeExtension(
                                        FileName(in_file).mangledFilename());
index e93ca9e49f7863b19074be6ad09e352350199fcd..5124aaf2421e3b94ae51b9f7e6a254f5335c4a4b 100644 (file)
@@ -801,7 +801,7 @@ bool preview_wanted(InsetExternalParams const & params)
        string const included_file = params.filename.absFilename();
 
        return params.display == external::PreviewDisplay &&
-               support::IsFileReadable(included_file);
+               support::isFileReadable(included_file);
 }
 
 
index 9104b77ba39db3b50291db4b06b93ea8f391f264..9ea6508a33cfea4fc74eb209cfed1b7856508282 100644 (file)
@@ -98,7 +98,7 @@ using lyx::support::contains;
 using lyx::support::FileName;
 using lyx::support::float_equal;
 using lyx::support::GetExtension;
-using lyx::support::IsFileReadable;
+using lyx::support::isFileReadable;
 using lyx::support::latex_path;
 using lyx::support::OnlyFilename;
 using lyx::support::removeExtension;
@@ -576,7 +576,7 @@ string const InsetGraphics::prepareFile(Buffer const & buf,
        // not exist.
        // We are not going to change the extension or using the name of the
        // temporary file, the code is already complicated enough.
-       if (runparams.inComment || !IsFileReadable(orig_file))
+       if (runparams.inComment || !isFileReadable(orig_file))
                return params().filename.outputFilename(m_buffer->filePath());
 
        // We place all temporary files in the master buffer's temp dir.
@@ -726,7 +726,7 @@ int InsetGraphics::latex(Buffer const & buf, ostream & os,
                params().filename.relFilename(buf.filePath());
 
        string const file_ = params().filename.absFilename();
-       bool const file_exists = !file_.empty() && IsFileReadable(file_);
+       bool const file_exists = !file_.empty() && isFileReadable(file_);
        string const message = file_exists ?
                string() : string("bb = 0 0 200 100, draft, type=eps");
        // if !message.empty() then there was no existing file
index bddd0977029fd72fe8cdfe236ab83c916771703d..7f015aeddf50d9ae29c7190d1a2aaf7c4de4f235 100644 (file)
@@ -61,8 +61,8 @@ using lyx::support::contains;
 using lyx::support::copy;
 using lyx::support::FileName;
 using lyx::support::GetFileContents;
-using lyx::support::IsFileReadable;
-using lyx::support::IsLyXFilename;
+using lyx::support::isFileReadable;
+using lyx::support::isLyXFilename;
 using lyx::support::latex_path;
 using lyx::support::MakeAbsPath;
 using lyx::support::MakeDisplayPath;
@@ -307,7 +307,7 @@ bool loadIfNeeded(Buffer const & buffer, InsetCommandParams const & params)
                return false;
 
        string const included_file = includedFilename(buffer, params);
-       if (!IsLyXFilename(included_file))
+       if (!isLyXFilename(included_file))
                return false;
 
        Buffer * buf = bufferlist.getBuffer(included_file);
@@ -417,7 +417,7 @@ int InsetInclude::latex(Buffer const & buffer, ostream & os,
                                                      exportfile);
 
                // \input wants file with extension (default is .tex)
-               if (!IsLyXFilename(included_file)) {
+               if (!isLyXFilename(included_file)) {
                        incfile = latex_path(incfile);
                        os << '\\' << params_.getCmdName() << '{' << incfile << '}';
                } else {
@@ -553,7 +553,7 @@ void InsetInclude::validate(LaTeXFeatures & features) const
 
        string const included_file = includedFilename(buffer, params_);
 
-       if (IsLyXFilename(included_file))
+       if (isLyXFilename(included_file))
                writefile = ChangeExtension(included_file, ".sgml");
        else
                writefile = included_file;
@@ -692,7 +692,7 @@ bool preview_wanted(InsetCommandParams const & params, Buffer const & buffer)
        string const included_file = includedFilename(buffer, params);
 
        return type(params) == INPUT && params.preview() &&
-               IsFileReadable(included_file);
+               isFileReadable(included_file);
 }
 
 
index 5445ef21c9a8307ede7c9756bcf2600041591dbe..b379076ff7ca189a82aaf62931f26561366afb95 100644 (file)
@@ -59,7 +59,7 @@ using lyx::support::bformat;
 using lyx::support::destroyDir;
 using lyx::support::FileFilterList;
 using lyx::support::ForkedProcess;
-using lyx::support::IsLyXFilename;
+using lyx::support::isLyXFilename;
 using lyx::support::LibFileSearch;
 using lyx::support::MakeAbsPath;
 using lyx::support::MakeDisplayPath;
@@ -135,7 +135,7 @@ bool WriteAs(Buffer * buffer, string const & filename)
                        make_pair(string(_("Templates|#T#t")),
                                  string(lyxrc.template_path)));
 
-               if (!IsLyXFilename(fname))
+               if (!isLyXFilename(fname))
                        fname += ".lyx";
 
                FileFilterList const filter (_("LyX Documents (*.lyx)"));
@@ -155,7 +155,7 @@ bool WriteAs(Buffer * buffer, string const & filename)
 
                // Make sure the absolute filename ends with appropriate suffix
                fname = MakeAbsPath(fname);
-               if (!IsLyXFilename(fname))
+               if (!isLyXFilename(fname))
                        fname += ".lyx";
        } else
                fname = filename;
index 57d52274325e392b6f7b273b35d043648a9509b9..fdced899f392e5468df90c4ea84f0da78896fac3 100644 (file)
@@ -110,8 +110,8 @@ using lyx::support::FileFilterList;
 using lyx::support::FileSearch;
 using lyx::support::ForkedcallsController;
 using lyx::support::i18nLibFileSearch;
-using lyx::support::IsDirWriteable;
-using lyx::support::IsFileReadable;
+using lyx::support::isDirWriteable;
+using lyx::support::isFileReadable;
 using lyx::support::isStrInt;
 using lyx::support::MakeAbsPath;
 using lyx::support::MakeDisplayPath;
@@ -515,7 +515,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
                else if (name == "character" || name == "mathpanel")
                        enable = cur.inset().lyxCode() != InsetBase::ERT_CODE;
                else if (name == "latexlog")
-                       enable = IsFileReadable(buf->getLogName().second);
+                       enable = isFileReadable(buf->getLogName().second);
 #if !defined (USE_ASPELL) && !defined (USE_ISPELL) && !defined (USE_PSPELL)
                else if (name == "spellchecker")
                        enable = false;
@@ -1696,7 +1696,7 @@ void LyXFunc::menuNew(string const & name, bool fromTemplate)
        if (view()->available()) {
                string const trypath = owner->buffer()->filePath();
                // If directory is writeable, use this as default.
-               if (IsDirWriteable(trypath))
+               if (isDirWriteable(trypath))
                        initpath = trypath;
        }
 
@@ -1746,7 +1746,7 @@ void LyXFunc::open(string const & fname)
        if (view()->available()) {
                string const trypath = owner->buffer()->filePath();
                // If directory is writeable, use this as default.
-               if (IsDirWriteable(trypath))
+               if (isDirWriteable(trypath))
                        initpath = trypath;
        }
 
@@ -1821,7 +1821,7 @@ void LyXFunc::doImport(string const & argument)
                if (view()->available()) {
                        string const trypath = owner->buffer()->filePath();
                        // If directory is writeable, use this as default.
-                       if (IsDirWriteable(trypath))
+                       if (isDirWriteable(trypath))
                                initpath = trypath;
                }
 
index 7fd0b30068636d1eca4d9fd0910159d0770482e0..bc522c40ed5f82f4d9c23b4c0956649c128aca34 100644 (file)
@@ -167,7 +167,7 @@ enum TextClassTags {
 // Reads a textclass structure from file.
 bool LyXTextClass::Read(string const & filename, bool merge)
 {
-       if (!lyx::support::IsFileReadable(filename)) {
+       if (!lyx::support::isFileReadable(filename)) {
                lyxerr << "Cannot read layout file `" << filename << "'."
                       << endl;
                return true;
index 0c67bef703d0b5251521ca4aa58b37fcc1199f0e..6d038b91892272d47b9f7c0abe1634f91163c2ef 100644 (file)
@@ -27,7 +27,7 @@
 #include "support/lyxlib.h"
 
 using lyx::support::bformat;
-using lyx::support::IsFileReadable;
+using lyx::support::isFileReadable;
 using lyx::support::MakeDisplayPath;
 using lyx::support::tempName;
 
@@ -89,7 +89,7 @@ void LyXVC::registrer()
        string const filename = owner_->fileName();
 
        // there must be a file to save
-       if (!IsFileReadable(filename)) {
+       if (!isFileReadable(filename)) {
                Alert::error(_("Document not saved"),
                             _("You must save the document "
                               "before it can be registered."));
@@ -100,7 +100,7 @@ void LyXVC::registrer()
        if (!vcs) {
                string const cvs_entries = "CVS/Entries";
 
-               if (IsFileReadable(cvs_entries)) {
+               if (isFileReadable(cvs_entries)) {
                        lyxerr[Debug::LYXVC]
                                << "LyXVC: registering "
                                << MakeDisplayPath(filename)
index bc4d9412f5197da05fbfde071c0c874d3b40695f..a33362f3b360d13083bd48a906ced874c380596b 100644 (file)
@@ -1461,7 +1461,7 @@ bool Paragraph::isNewline(pos_type pos) const
 bool Paragraph::isLineSeparator(pos_type pos) const
 {
        value_type const c = getChar(pos);
-       return IsLineSeparatorChar(c)
+       return isLineSeparatorChar(c)
                || (c == Paragraph::META_INSET && getInset(pos) &&
                getInset(pos)->isLineSeparator());
 }
@@ -1474,7 +1474,7 @@ bool Paragraph::isLetter(pos_type pos) const
                return getInset(pos)->isLetter();
        else {
                value_type const c = getChar(pos);
-               return IsLetterChar(c) || IsDigit(c);
+               return isLetterChar(c) || isDigit(c);
        }
 }
 
@@ -1547,7 +1547,7 @@ string const Paragraph::asString(Buffer const & buffer,
 
        for (pos_type i = 0; i < size(); ++i) {
                value_type c = getChar(i);
-               if (IsPrintable(c))
+               if (isPrintable(c))
                        s += c;
                else if (c == META_INSET &&
                         getInset(i)->lyxCode() == InsetBase::MATH_CODE) {
@@ -1586,7 +1586,7 @@ string const Paragraph::asString(Buffer const & buffer,
 
        for (pos_type i = beg; i < end; ++i) {
                value_type const c = getUChar(buffer.params(), i);
-               if (IsPrintable(c))
+               if (isPrintable(c))
                        os << c;
                else if (c == META_INSET)
                        getInset(i)->textString(buffer, os, runparams);
@@ -1811,7 +1811,7 @@ size_t Paragraph::pos2row(pos_type pos) const
 unsigned char Paragraph::transformChar(unsigned char c, pos_type pos) const
 {
        if (!Encodings::is_arabic(c))
-               if (lyxrc.font_norm_type == LyXRC::ISO_8859_6_8 && IsDigit(c))
+               if (lyxrc.font_norm_type == LyXRC::ISO_8859_6_8 && isDigit(c))
                        return c + (0xb0 - '0');
                else
                        return c;
index 11d9f05a837b1e29d2ad7119e150adc847b734ac..d7131d55cad93665ac4d250c2bc2cf5136fd78a4 100644 (file)
@@ -196,7 +196,7 @@ void RowPainter::paintHebrewComposeChar(pos_type & vpos, LyXFont const & font)
        for (pos_type i = pos - 1; i >= 0; --i) {
                c = par_.getChar(i);
                if (!Encodings::IsComposeChar_hebrew(c)) {
-                       if (IsPrintableNonspace(c)) {
+                       if (isPrintableNonspace(c)) {
                                int const width2 =
                                        text_.singleWidth(par_, i, c, text_.getFont(par_, i));
                                // dalet / resh
@@ -230,7 +230,7 @@ void RowPainter::paintArabicComposeChar(pos_type & vpos, LyXFont const & font)
        for (pos_type i = pos - 1; i >= 0; --i) {
                c = par_.getChar(i);
                if (!Encodings::IsComposeChar_arabic(c)) {
-                       if (IsPrintableNonspace(c)) {
+                       if (isPrintableNonspace(c)) {
                                int const width2 =
                                        text_.singleWidth(par_, i, c, text_.getFont(par_, i));
                                dx = (width2 - width) / 2;
@@ -270,7 +270,7 @@ void RowPainter::paintChars(pos_type & vpos, LyXFont font,
 
                char c = par_.getChar(pos);
 
-               if (!IsPrintableNonspace(c))
+               if (!isPrintableNonspace(c))
                        break;
 
                if (arabic && Encodings::IsComposeChar_arabic(c))
index ff8c46b4da1cd095373c1a3efc152fd92b5967dc..ad37ed96be48e9b808cbb63d033ade87df306ca1 100644 (file)
@@ -70,13 +70,13 @@ namespace fs = boost::filesystem;
 namespace lyx {
 namespace support {
 
-bool IsLyXFilename(string const & filename)
+bool isLyXFilename(string const & filename)
 {
        return suffixIs(ascii_lowercase(filename), ".lyx");
 }
 
 
-bool IsSGMLFilename(string const & filename)
+bool isSGMLFilename(string const & filename)
 {
        return suffixIs(ascii_lowercase(filename), ".sgml");
 }
@@ -142,7 +142,7 @@ string const QuoteName(string const & name)
 
 
 // Is a file readable ?
-bool IsFileReadable(string const & path)
+bool isFileReadable(string const & path)
 {
        return fs::exists(path) && !fs::is_directory(path) && fs::is_readable(path);
 }
@@ -150,9 +150,9 @@ bool IsFileReadable(string const & path)
 
 //returns true: dir writeable
 //       false: not writeable
-bool IsDirWriteable(string const & path)
+bool isDirWriteable(string const & path)
 {
-       lyxerr[Debug::FILES] << "IsDirWriteable: " << path << endl;
+       lyxerr[Debug::FILES] << "isDirWriteable: " << path << endl;
 
        string const tmpfl = tempName(path, "lyxwritetest");
 
@@ -246,14 +246,14 @@ string const FileSearch(string const & path, string const & name,
        string const tmpname = ReplaceEnvironmentPath(name);
        string fullname = MakeAbsPath(tmpname, path);
        // search first without extension, then with it.
-       if (IsFileReadable(fullname))
+       if (isFileReadable(fullname))
                return fullname;
        if (ext.empty())
                return string();
        // Is it not more reasonable to use ChangeExtension()? (SMiyata)
        fullname += '.';
        fullname += ext;
-       return IsFileReadable(fullname) ? fullname : string();
+       return isFileReadable(fullname) ? fullname : string();
 }
 
 
@@ -415,7 +415,7 @@ string const createLyXTmpDir(string const & deflt)
 #ifdef __EMX__
                        Path p(package().user_support());
 #endif
-                       if (IsDirWriteable(deflt)) {
+                       if (isDirWriteable(deflt)) {
                                // deflt could not be created because it
                                // did exist already, so let's create our own
                                // dir inside deflt.
@@ -797,7 +797,7 @@ string const GetExtension(string const & name)
 string const getFormatFromContents(string const & filename)
 {
        // paranoia check
-       if (filename.empty() || !IsFileReadable(filename))
+       if (filename.empty() || !isFileReadable(filename))
                return string();
 
        ifstream ifs(filename.c_str());
index 423c4d4743443a7f08d694f89c0a82a227823a16..b363033778a3d66e7dfe22b144b925e66bfa358b 100644 (file)
@@ -63,18 +63,18 @@ std::vector<std::string> const DirList(std::string const & dir,
     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.
  */
-bool IsFileReadable (std::string const & path);
+bool isFileReadable (std::string const & path);
 
 ///
-bool IsLyXFilename(std::string const & filename);
+bool isLyXFilename(std::string const & filename);
 
 ///
-bool IsSGMLFilename(std::string const & filename);
+bool isSGMLFilename(std::string const & filename);
 
 /** Returns the path of a library data file.
     Search the file name.ext in the subdirectory dir of
index 8c0ba08e8c6e2fb757171c8171f5c438b08d4d60..4424f6bcdaed86b4f00fe287d7567f2feef45e9f 100644 (file)
@@ -18,7 +18,7 @@
 
 /// return true if the char is a line separator
 inline
-bool IsLineSeparatorChar(char c)
+bool isLineSeparatorChar(char c)
 {
        return c == ' ';
 }
@@ -26,7 +26,7 @@ bool IsLineSeparatorChar(char c)
 
 /// return true if a char is alphabetical (including accented chars)
 inline
-bool IsLetterChar(unsigned char c)
+bool isLetterChar(unsigned char c)
 {
        return (c >= 'A' && c <= 'Z')
                || (c >= 'a' && c <= 'z')
@@ -36,7 +36,7 @@ bool IsLetterChar(unsigned char c)
 
 /// return true if the char is printable (masked to 7-bit ASCII)
 inline
-bool IsPrintable(unsigned char c)
+bool isPrintable(unsigned char c)
 {
        return (c & 127) >= ' ';
 }
@@ -44,15 +44,15 @@ bool IsPrintable(unsigned char c)
 
 /// return true if the char is printable and not a space (masked to 7-bit ASCII)
 inline
-bool IsPrintableNonspace(unsigned char c)
+bool isPrintableNonspace(unsigned char c)
 {
-       return IsPrintable(c) && c != ' ';
+       return isPrintable(c) && c != ' ';
 }
 
 
 /// completely pointless FIXME
 inline
-bool IsDigit(unsigned char ch)
+bool isDigit(unsigned char ch)
 {
        return ch >= '0' && ch <= '9';
 }
index 676d309278f8c74950b00b0b851e9ae108e3303b..9d2bea9366cc69c90c59255acdb367beaff3b06d 100644 (file)
@@ -58,7 +58,7 @@ using lyx::support::ltrim;
 using lyx::support::MakeAbsPath;
 using lyx::support::OnlyPath;
 using lyx::support::rtrim;
-using lyx::support::IsFileReadable;
+using lyx::support::isFileReadable;
 
 namespace fs = boost::filesystem;
 
@@ -450,7 +450,7 @@ bool tex2lyx(string const &infilename, std::ostream &os)
 
 bool tex2lyx(string const &infilename, string const &outfilename)
 {
-       if (IsFileReadable(outfilename)) {
+       if (isFileReadable(outfilename)) {
                if (overwrite_files) {
                        cerr << "Overwriting existing file "
                             << outfilename << endl;
index 1fd0370caf3527005282b15127ac10576eeb50e6..f27b38d61eb1fb106cda638cd54d162b72c4c23d 100644 (file)
@@ -427,7 +427,7 @@ int LyXText::singleWidth(Paragraph const & par,
                         pos_type pos, char c, LyXFont const & font) const
 {
        // The most common case is handled first (Asger)
-       if (IsPrintable(c)) {
+       if (isPrintable(c)) {
                Language const * language = font.language();
                if (language->RightToLeft()) {
                        if ((lyxrc.font_norm_type == LyXRC::ISO_8859_6_8 ||
@@ -1132,7 +1132,7 @@ void LyXText::insertChar(LCursor & cur, char c)
                static string const number_seperators = ".,:";
 
                if (current_font.number() == LyXFont::ON) {
-                       if (!IsDigit(c) && !contains(number_operators, c) &&
+                       if (!isDigit(c) && !contains(number_operators, c) &&
                            !(contains(number_seperators, c) &&
                              cur.pos() != 0 &&
                              cur.pos() != cur.lastpos() &&
@@ -1140,7 +1140,7 @@ void LyXText::insertChar(LCursor & cur, char c)
                              getFont(par, cur.pos() - 1).number() == LyXFont::ON)
                           )
                                number(cur); // Set current_font.number to OFF
-               } else if (IsDigit(c) &&
+               } else if (isDigit(c) &&
                           real_current_font.isVisibleRightToLeft()) {
                        number(cur); // Set current_font.number to ON
 
@@ -1169,7 +1169,7 @@ void LyXText::insertChar(LCursor & cur, char c)
 
        // When the free-spacing option is set for the current layout,
        // disable the double-space checking
-       if (!freeSpacing && IsLineSeparatorChar(c)) {
+       if (!freeSpacing && isLineSeparatorChar(c)) {
                if (cur.pos() == 0) {
                        static bool sent_space_message = false;
                        if (!sent_space_message) {
index 82f3cd52a6250d53a00277ef633165b06a9f871d..f907f329bef8a29c174a0f99682c60dcb0a4cdc2 100644 (file)
@@ -648,7 +648,7 @@ void LyXText::insertStringAsParagraphs(LCursor & cur, string const & str)
                                linestr[i] = ' ';
                                newline_inserted = true;
                        }
-               } else if (IsPrintable(linestr[i])) {
+               } else if (isPrintable(linestr[i])) {
                        newline_inserted = false;
                }
        }