SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
CellKeyVec.cc
Go to the documentation of this file.
1 /*
2  * SWC-DB© Copyright since 2019 Alex Kashirin <kashirin.alex@gmail.com>
3  * License details at <https://github.com/kashirin-alex/swc-db/#license>
4  */
5 
7 
8 
9 namespace SWC { namespace DB { namespace Cell {
10 
11 
12 
13 void KeyVec::print(std::ostream& out) const {
14  out << "Key(";
15  if(!size()) {
16  out << ')';
17  return;
18  }
19  out << "sz=" << size() << " [";
20  char hex[5];
21  hex[4] = 0;
22  for(auto it = cbegin(); it != cend(); ) {
23  out << '"';
24  for(auto chrp = it->cbegin(); chrp != it->cend(); ++chrp) {
25  if(*chrp == '"')
26  out << '\\';
27  if(31 < *chrp && *chrp < 127) {
28  out << *chrp;
29  } else {
30  sprintf(hex, "0x%X", *chrp);
31  out << hex;
32  }
33  }
34  out << '"';
35  if(++it != cend())
36  out << ',';
37  }
38  out << "])";
39 }
40 
41 
42 
43 }}}
CellKeyVec.h
SWC
The SWC-DB C++ namespace 'SWC'.
Definition: main.cc:12
SWC::DB::Cell::KeyVec::size
constexpr SWC_CAN_INLINE size_type size() const noexcept
Definition: Vector.h:189
SWC::DB::Cell::KeyVec::print
void print(std::ostream &out) const
Definition: CellKeyVec.cc:13
SWC::Core::Vector::cend
constexpr SWC_CAN_INLINE const_iterator cend() const noexcept
Definition: Vector.h:232
SWC::Core::Vector::cbegin
constexpr SWC_CAN_INLINE const_iterator cbegin() const noexcept
Definition: Vector.h:216