aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexlib/CatalogueModules.h
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
commitc8136baf0e923ea16cb5e75d75539ca61129925a (patch)
treed3502729c2955f1bf6b0b554ecafc641b59156c0 /lexlib/CatalogueModules.h
parent46a02c988454c5c29943475a7b44bc0bdafefb55 (diff)
downloadscintilla-mirror-c8136baf0e923ea16cb5e75d75539ca61129925a.tar.gz
Backport: 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. Backport of changeset 8299:8473e407264e.
Diffstat (limited to 'lexlib/CatalogueModules.h')
-rw-r--r--lexlib/CatalogueModules.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/lexlib/CatalogueModules.h b/lexlib/CatalogueModules.h
index 00ac88d62..b290a74ea 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;
}
- ILexer *Create(unsigned int index) {
+ ILexer *Create(unsigned int index) const {
const LexerModule *plm = lexerCatalogue[index];
if (!plm) {
return nullptr;