* Add the given key to the authorized keys, when it is not already contained. * @param key The key to add. * @return \c true when the key was added, \c false when the key already existed or the key was empty. */
| 188 | * @return \c true when the key was added, \c false when the key already existed or the key was empty. |
| 189 | */ |
| 190 | bool NetworkAuthorizedKeys::Add(std::string_view key) |
| 191 | { |
| 192 | if (key.empty()) return false; |
| 193 | |
| 194 | auto iter = FindKey(this, key); |
| 195 | if (iter != this->end()) return false; |
| 196 | |
| 197 | this->emplace_back(key); |
| 198 | return true; |
| 199 | } |
| 200 | |
| 201 | /** |
| 202 | * Remove the given key from the authorized keys, when it is exists. |