Skip to content
Snippets Groups Projects
Commit 58be07a8 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

infohash: add to_view()

parent 6c61ac53
No related branches found
No related tags found
No related merge requests found
...@@ -249,6 +249,8 @@ public: ...@@ -249,6 +249,8 @@ public:
template <size_t M> template <size_t M>
OPENDHT_PUBLIC friend std::istream& operator>> (std::istream& s, Hash<M>& h); OPENDHT_PUBLIC friend std::istream& operator>> (std::istream& s, Hash<M>& h);
/** Returns view to thread-allocated memory, only valid until the next call to this function. */
std::string_view to_view() const { return std::string_view(to_c_str(), N*2); }
const char* to_c_str() const; const char* to_c_str() const;
std::string toString() const; std::string toString() const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment