OmniSciDB  85c2d10cdc
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DBObject.cpp File Reference
#include "DBObject.h"
#include "Catalog.h"
+ Include dependency graph for DBObject.cpp:

Go to the source code of this file.

Functions

std::string ObjectPermissionTypeToString (DBObjectType type)
 
DBObjectType DBObjectTypeFromString (const std::string &type)
 

Function Documentation

DBObjectType DBObjectTypeFromString ( const std::string &  type)

Definition at line 101 of file DBObject.cpp.

References DashboardDBObjectType, DatabaseDBObjectType, ServerDBObjectType, TableDBObjectType, and ViewDBObjectType.

Referenced by Parser::GrantPrivilegesStmt::execute(), Parser::RevokePrivilegesStmt::execute(), and Parser::ShowPrivilegesStmt::execute().

101  {
102  if (type.compare("DATABASE") == 0) {
103  return DatabaseDBObjectType;
104  } else if (type.compare("TABLE") == 0) {
105  return TableDBObjectType;
106  } else if (type.compare("DASHBOARD") == 0) {
107  return DashboardDBObjectType;
108  } else if (type.compare("VIEW") == 0) {
109  return ViewDBObjectType;
110  } else if (type.compare("SERVER") == 0) {
111  return ServerDBObjectType;
112  } else {
113  throw std::runtime_error("DB object type " + type + " is not supported.");
114  }
115 }

+ Here is the caller graph for this function:

std::string ObjectPermissionTypeToString ( DBObjectType  type)

Definition at line 83 of file DBObject.cpp.

References CHECK, DashboardDBObjectType, DatabaseDBObjectType, ServerDBObjectType, TableDBObjectType, and ViewDBObjectType.

83  {
84  switch (type) {
86  return "DATABASE";
87  case TableDBObjectType:
88  return "TABLE";
90  return "DASHBOARD";
91  case ViewDBObjectType:
92  return "VIEW";
93  case ServerDBObjectType:
94  return "SERVER";
95  default:
96  CHECK(false);
97  }
98  return "not possible";
99 }
#define CHECK(condition)
Definition: Logger.h:197