]> git.lyx.org Git - features.git/commitdiff
Style.
authorRichard Heck <rgheck@comcast.net>
Fri, 14 Aug 2009 15:28:06 +0000 (15:28 +0000)
committerRichard Heck <rgheck@comcast.net>
Fri, 14 Aug 2009 15:28:06 +0000 (15:28 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31034 a592a061-630c-0410-9148-cb99ea01b6c8

src/ModuleList.cpp
src/ModuleList.h

index 4e279c64dc59c63bd3db205d0d5ac4bae5bd1d2d..f5412b8ead7ae96e9971a830ba54676dfe3ac1d5 100644 (file)
@@ -37,11 +37,11 @@ LyXModule::LyXModule(string const & n, string const & i,
                           string const & d, vector<string> const & p,
                           vector<string> const & r, vector<string> const & e,
                           string const & c):
-       name(n), id(i), description(d), packageList(p), 
-       requiredModules(r), excludedModules(e), category_(c),
-       checked(false)
+       name_(n), id_(i), description_(d), package_list_(p), 
+       required_modules_(r), excluded_modules_(e), category_(c),
+       checked_(false)
 {
-       filename = id + ".module";
+       filename_ = id_ + ".module";
 }
 
 
@@ -49,40 +49,40 @@ bool LyXModule::isAvailable() {
 #ifdef TEX2LYX
        return true;
 #else
-       if (packageList.empty())
+       if (package_list_.empty())
                return true;
-       if (checked)
-               return available;
-       checked = true;
+       if (checked_)
+               return available_;
+       checked_ = true;
        //check whether all of the required packages are available
-       vector<string>::const_iterator it  = packageList.begin();
-       vector<string>::const_iterator end = packageList.end(); 
+       vector<string>::const_iterator it  = package_list_.begin();
+       vector<string>::const_iterator end = package_list_.end(); 
        for (; it != end; ++it) {
                if (!LaTeXFeatures::isAvailable(*it)) {
-                       available = false;
-                       return available;
+                       available_ = false;
+                       return available_;
                }
        }
-       available = true;
-       return available;
+       available_ = true;
+       return available_;
 #endif
 }
 
 
-bool LyXModule::isCompatible(string const & modName) const
+bool LyXModule::isCompatible(string const & modname) const
 {
        // do we exclude it?
-       if (find(excludedModules.begin(), excludedModules.end(), modName) !=
-                       excludedModules.end())
+       if (find(excluded_modules_.begin(), excluded_modules_.end(), modname) !=
+                       excluded_modules_.end())
                return false;
 
-       LyXModule const * const lm = moduleList[modName];
+       LyXModule const * const lm = moduleList[modname];
        if (!lm)
                return true;
 
        // does it exclude us?
-       vector<string> const excMods = lm->getExcludedModules();
-       if (find(excMods.begin(), excMods.end(), id) != excMods.end())
+       vector<string> const excmods = lm->getExcludedModules();
+       if (find(excmods.begin(), excmods.end(), id_) != excmods.end())
                return false;
 
        return true;
@@ -149,8 +149,8 @@ bool ModuleList::read()
                        finished = true;
                        break;
                default:
-                       string const modName = lex.getString();
-                       LYXERR(Debug::TCLASS, "Module name: " << modName);
+                       string const modname = lex.getString();
+                       LYXERR(Debug::TCLASS, "Module name: " << modname);
                        if (!lex.next())
                                break;
                        string const fname = lex.getString();
@@ -196,7 +196,7 @@ bool ModuleList::read()
                        LYXERR(Debug::TCLASS, "Category: " << catgy);
                        // This code is run when we have
                        // modName, fname, desc, pkgs, req, exc, and catgy
-                       addLayoutModule(modName, fname, desc, pkgs, req, exc, catgy);
+                       addLayoutModule(modname, fname, desc, pkgs, req, exc, catgy);
                } // end switch
        } //end while
        
@@ -208,12 +208,12 @@ bool ModuleList::read()
 }
 
 
-void ModuleList::addLayoutModule(string const & moduleName, 
+void ModuleList::addLayoutModule(string const & modname, 
        string const & filename, string const & description,
        vector<string> const & pkgs, vector<string> const & req,
        vector<string> const & exc, string const & catgy)
 {
-       LyXModule lm(moduleName, filename, description, pkgs, req, exc, catgy);
+       LyXModule lm(modname, filename, description, pkgs, req, exc, catgy);
        modlist_.push_back(lm);
 }
 
index 6e88f6b8ecbe214aa35823ab2b0e1849a0f89ad1..7ff5e19b88aceefdadd56b994d0cdea29cf78cd1 100644 (file)
@@ -50,61 +50,62 @@ namespace lyx {
 class LyXModule {
 public:
        ///
-       LyXModule(std::string const & n, std::string const & i, 
-                 std::string const & d, std::vector<std::string> const & p,
-                 std::vector<std::string> const & r, 
-                 std::vector<std::string> const & e,
-                 std::string const & c);
+       LyXModule(std::string const & name, std::string const & id, 
+                 std::string const & description, 
+                 std::vector<std::string> const & packagelist,
+                 std::vector<std::string> const & requires, 
+                 std::vector<std::string> const & excludes,
+                 std::string const & catgy);
        /// whether the required packages are available
        bool isAvailable();
        ///
-       std::string const & getName() const { return name; }
+       std::string const & getName() const { return name_; }
        ///
-       std::string const & getID() const { return id; }
+       std::string const & getID() const { return id_; }
        ///
-       std::string const & getFilename() const { return filename; }
+       std::string const & getFilename() const { return filename_; }
        ///
-       std::string const & getDescription() const { return description; }
+       std::string const & getDescription() const { return description_; }
        ///
        std::vector<std::string> const & getPackageList() const
-               { return packageList; }
+               { return package_list_; }
        ///
        std::vector<std::string> const & getRequiredModules() const 
-               { return requiredModules; }
+               { return required_modules_; }
        /// Modules this one excludes: the list should be treated disjunctively
        std::vector<std::string> const & getExcludedModules() const 
-               { return excludedModules; }
+               { return excluded_modules_; }
        ///
        std::string category() const { return category_; }
        /// \return true if the module is compatible with this one, i.e.,
        /// it does not exclude us and we do not exclude it.
-       /// this will also return true if modName is unknown and we do not
+       /// this will also return true if modname is unknown and we do not
        /// exclude it, since in that case we cannot check its exclusions.
-       bool isCompatible(std::string const & modName) const;
+       bool isCompatible(std::string const & modname) const;
        ///
        static bool areCompatible(std::string const & mod1, std::string const & mod2);
 private:
        /// what appears in the ui
-       std::string name;
+       std::string name_;
        /// the module's unique identifier
        /// at present, this is the filename, without the extension
-       std::string id;
+       std::string id_;
        /// the filename
-       std::string filename;
+       std::string filename_;
        /// a short description for use in the ui
-       std::string description;
+       std::string description_;
        /// the LaTeX packages on which this depends, if any
-       std::vector<std::string> packageList;
+       std::vector<std::string> package_list_;
        /// Modules this one requires: at least one
-       std::vector<std::string> requiredModules;
+       std::vector<std::string> required_modules_;
        /// Modules this one excludes: none of these
-       std::vector<std::string> excludedModules;
-       ///
+       std::vector<std::string> excluded_modules_;
+       /// Category, also used in the UI
        std::string category_;
        ///
-       bool checked;
+       bool checked_;
        ///
-       bool available;
+       bool available_;
 };
 
 typedef std::vector<LyXModule> LyXModuleList;