aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2020-06-11 10:07:30 +1000
committerNeil <nyamatongwe@gmail.com>2020-06-11 10:07:30 +1000
commitb34e1a6efefd7b39f14daa867510b2e2d453a0bb (patch)
tree7f074b6cc1fcb0518184098fd21ed5f07858e37a
parent0726bab82b290a92e30a1c4dd0d85df42ef6c4c6 (diff)
downloadscintilla-mirror-b34e1a6efefd7b39f14daa867510b2e2d453a0bb.tar.gz
Use const and noexcept for CatalogueModules.
While CatalogueModules is in lexlib, it is newer with few users so does not have to remain as fixed as other files in lexlib.
-rw-r--r--lexlib/CatalogueModules.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/lexlib/CatalogueModules.h b/lexlib/CatalogueModules.h
index 197a66460..267a7b82b 100644
--- a/lexlib/CatalogueModules.h
+++ b/lexlib/CatalogueModules.h
@@ -15,7 +15,7 @@ namespace Scintilla {
class CatalogueModules {
std::vector<LexerModule *> lexerCatalogue;
public:
- const LexerModule *Find(int language) {
+ const LexerModule *Find(int language) const {
for (const LexerModule *lm : lexerCatalogue) {
if (lm->GetLanguage() == language) {
return lm;
@@ -24,7 +24,7 @@ public:
return nullptr;
}
- const LexerModule *Find(const char *languageName) {
+ const LexerModule *Find(const char *languageName) const noexcept {
if (languageName) {
for (const LexerModule *lm : lexerCatalogue) {
if (lm->languageName && (0 == strcmp(lm->languageName, languageName))) {
@@ -39,11 +39,11 @@ public:
lexerCatalogue.push_back(plm);
}
- unsigned int Count() {
+ unsigned int Count() const noexcept {
return static_cast<unsigned int>(lexerCatalogue.size());
}
- const char *Name(unsigned int index) {
+ const char *Name(unsigned int index) const noexcept {
if (index < static_cast<unsigned int>(lexerCatalogue.size())) {
return lexerCatalogue[index]->languageName;
} else {
@@ -51,12 +51,12 @@ public:
}
}
- LexerFactoryFunction Factory(unsigned int index) {
+ LexerFactoryFunction Factory(unsigned int index) const noexcept {
// Works for object lexers but not for function lexers
return lexerCatalogue[index]->fnFactory;
}
- ILexer5 *Create(unsigned int index) {
+ ILexer5 *Create(unsigned int index) const {
const LexerModule *plm = lexerCatalogue[index];
if (!plm) {
return nullptr;