SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
MngrRole.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 namespace SWC { namespace DB { namespace Types { namespace MngrRole {
9 
10 
11 namespace {
12  const char MngrRole_SCHEMAS[] = "SCHEMAS";
13  const char MngrRole_RANGERS[] = "RANGERS";
14  const char MngrRole_COLUMNS[] = "COLUMNS";
15  const char MngrRole_NO_COLUMNS[] = "NO_COLUMNS";
16 }
17 
18 
19 std::string to_string(uint8_t role) {
20  std::string s;
21 
22  if(role & SCHEMAS) {
23  s.append(MngrRole_SCHEMAS);
24  }
25 
26  if(role & RANGERS) {
27  if(!s.empty())
28  s.append(",");
29  s.append(MngrRole_RANGERS);
30  }
31 
32  if(role & COLUMNS) {
33  if(!s.empty())
34  s.append(",");
35  s.append(MngrRole_COLUMNS);
36  }
37 
38  if(role & NO_COLUMNS) {
39  if(!s.empty())
40  s.append(",");
41  s.append(MngrRole_NO_COLUMNS);
42  }
43 
44  return s;
45 }
46 
47 }}}}
SWC::DB::Types::MngrRole::NO_COLUMNS
const uint8_t NO_COLUMNS
Definition: MngrRole.h:17
MngrRole.h
SWC::DB::Types::MngrRole::SCHEMAS
const uint8_t SCHEMAS
Definition: MngrRole.h:15
SWC
The SWC-DB C++ namespace 'SWC'.
Definition: main.cc:12
SWC::DB::Types::MngrRole::RANGERS
const uint8_t RANGERS
Definition: MngrRole.h:16
SWC::DB::Types::MngrRole::COLUMNS
const uint8_t COLUMNS
Definition: MngrRole.h:14
SWC::DB::Types::MngrRole::to_string
std::string to_string(uint8_t role)
Definition: MngrRole.cc:19