userver: userver/formats/serialize/boost_uuid.hpp Source File
Loading...
Searching...
No Matches
boost_uuid.hpp
Go to the documentation of this file.
1#pragma once
2
6
7#include <boost/uuid/uuid.hpp>
8#include <string>
9
11
12USERVER_NAMESPACE_BEGIN
13
14namespace formats::serialize {
15
16namespace detail {
17
18std::string ToString(const boost::uuids::uuid& value);
19
20} // namespace detail
21
23template <typename Value>
24Value Serialize(const boost::uuids::uuid& value, To<Value>) {
25 return typename Value::Builder(detail::ToString(value)).ExtractValue();
26}
27
28template <typename StringBuilder>
29void WriteToStream(const boost::uuids::uuid& value, StringBuilder& sw) {
30 WriteToStream(detail::ToString(value), sw);
31}
32
33} // namespace formats::serialize
34
35USERVER_NAMESPACE_END