diff options
| author | 2022-04-10 23:43:43 +0100 | |
|---|---|---|
| committer | 2022-04-10 23:43:43 +0100 | |
| commit | 79b1c44721776765173191dc7cba612169a8b601 (patch) | |
| tree | 577dce049a869900582210b3ed41cbc2e4cc949c /src/configparser.cpp | |
| parent | Fix <security announceinvites="dynamic"> when halfop is not loaded. (diff) | |
| download | inspircd++-79b1c44721776765173191dc7cba612169a8b601.tar.gz inspircd++-79b1c44721776765173191dc7cba612169a8b601.tar.bz2 inspircd++-79b1c44721776765173191dc7cba612169a8b601.zip | |
Add a method to ConfigTag to help with retrieving a single character.
Diffstat (limited to 'src/configparser.cpp')
| -rw-r--r-- | src/configparser.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/configparser.cpp b/src/configparser.cpp index e05dcd6ff..e5a12d319 100644 --- a/src/configparser.cpp +++ b/src/configparser.cpp @@ -755,6 +755,16 @@ bool ConfigTag::getBool(const std::string &key, bool def) return def; } +unsigned char ConfigTag::getCharacter(const std::string &key, unsigned char def) +{ + std::string result; + if (!readString(key, result) || result.size() != 1) + return def; + + return result[0]; +} + + std::string ConfigTag::getTagLocation() { return src_name + ":" + ConvToStr(src_line); |
