cli: Add cmd to print security info from the db to console

Usage: sparkd md dump --db
This commit is contained in:
John Colvin committed 2025-01-03 16:59:07 +00:00
1 parent 4a285fa581
commit 73356e0d61
4 files changed
+141 -4

No files matched your search

+18
View File
@@ -14,6 +14,9 @@ bool copy_to_array(
template <class UIntType>
bool parse_uint(const std::string &s, UIntType &i);
void to_upper(std::string &str);
std::string copy_to_upper(const std::string &str);
//////////////////////////////////////////////////
// Definition
//////////////////////////////////////////////////
@@ -83,4 +86,19 @@ inline bool parse_uint(const std::string &s, UIntType &i) {
return true;
}
inline void to_upper(std::string &str) {
for (char &c : str) {
c = toupper(c);
}
}
inline std::string copy_to_upper(const std::string &str) {
std::string s;
s.reserve(str.size());
for (char c : str) {
s.push_back(toupper(c));
}
return s;
}
} // namespace bts::system::string_utils