hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
soci_string_view.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_SOCI_STD_STRING_VIEW_HPP
7 #define IROHA_SOCI_STD_STRING_VIEW_HPP
8 
9 #include <soci/type-conversion-traits.h>
10 
11 #include <string_view>
12 
14 
15 namespace soci {
16 
17  template <typename T>
18  struct type_conversion<
19  T,
20  std::enable_if_t<
21  // clang-format off
22  std::is_same_v<std::decay_t<T>, std::string_view> or
23  std::is_same_v<std::decay_t<T>, shared_model::interface::types::PublicKeyHexStringView>
24  // clang-format on
25  >> {
26  using base_type = std::string;
27 
28  static void from_base(base_type const &in,
29  indicator ind,
30  std::string_view &out) {
31  // TODO IR-726 @mboldyrev 07.05.2020 prevent silent acceptance
32  // of std::string to soci::into
33  }
34 
35  static void to_base(std::string_view const &in,
36  base_type &out,
37  indicator &ind) {
38  out.assign(in);
39  }
40  };
41 
42 } // namespace soci
43 
44 #endif
Definition: peer.hpp:48
Definition: pool_wrapper.hpp:11