Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/redis/resp3/impl/type.ipp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* Copyright (c) 2018-2023 Marcelo Zimbres Silva (mzimbres@gmail.com)
0002  *
0003  * Distributed under the Boost Software License, Version 1.0. (See
0004  * accompanying file LICENSE.txt)
0005  */
0006 
0007 #include <boost/redis/resp3/type.hpp>
0008 #include <boost/assert.hpp>
0009 
0010 namespace boost::redis::resp3 {
0011 
0012 auto to_string(type t) noexcept -> char const*
0013 {
0014    switch (t) {
0015       case type::array: return "array";
0016       case type::push: return "push";
0017       case type::set: return "set";
0018       case type::map: return "map";
0019       case type::attribute: return "attribute";
0020       case type::simple_string: return "simple_string";
0021       case type::simple_error: return "simple_error";
0022       case type::number: return "number";
0023       case type::doublean: return "doublean";
0024       case type::boolean: return "boolean";
0025       case type::big_number: return "big_number";
0026       case type::null: return "null";
0027       case type::blob_error: return "blob_error";
0028       case type::verbatim_string: return "verbatim_string";
0029       case type::blob_string: return "blob_string";
0030       case type::streamed_string: return "streamed_string";
0031       case type::streamed_string_part: return "streamed_string_part";
0032       default: return "invalid";
0033    }
0034 }
0035 
0036 auto operator<<(std::ostream& os, type t) -> std::ostream&
0037 {
0038    os << to_string(t);
0039    return os;
0040 }
0041 
0042 } // boost::redis::resp3