1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-31 18:24:25 +03:00

Implement wsrep:🆔:to_string()

This commit is contained in:
Teemu Ollakka
2023-09-21 12:51:46 +03:00
parent db7ddd0b11
commit 349a9e51db
2 changed files with 12 additions and 0 deletions

View File

@ -93,6 +93,11 @@ namespace wsrep
{
return undefined_;
}
/**
* Return id in string representation.
*/
std::string to_string() const;
private:
static const wsrep::id undefined_;
native_type data_;

View File

@ -50,6 +50,13 @@ wsrep::id::id(const std::string& str)
}
}
std::string wsrep::id::to_string() const
{
std::ostringstream os;
os << *this;
return os.str();
}
std::ostream& wsrep::operator<<(std::ostream& os, const wsrep::id& id)
{
const char* ptr(static_cast<const char*>(id.data()));