OmniSciDB  a47db9e897
 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 88 of file DBObject.cpp.

References DashboardDBObjectType, DatabaseDBObjectType, TableDBObjectType, and ViewDBObjectType.

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

88  {
89  if (type.compare("DATABASE") == 0) {
90  return DatabaseDBObjectType;
91  } else if (type.compare("TABLE") == 0) {
92  return TableDBObjectType;
93  } else if (type.compare("DASHBOARD") == 0) {
94  return DashboardDBObjectType;
95  } else if (type.compare("VIEW") == 0) {
96  return ViewDBObjectType;
97  } else {
98  throw std::runtime_error("DB object type " + type + " is not supported.");
99  }
100 }

+ Here is the caller graph for this function:

std::string ObjectPermissionTypeToString ( DBObjectType  type)

Definition at line 72 of file DBObject.cpp.

References CHECK(), DashboardDBObjectType, DatabaseDBObjectType, TableDBObjectType, and ViewDBObjectType.

72  {
73  switch (type) {
75  return "DATABASE";
76  case TableDBObjectType:
77  return "TABLE";
79  return "DASHBOARD";
80  case ViewDBObjectType:
81  return "VIEW";
82  default:
83  CHECK(false);
84  }
85  return "not possible";
86 }
CHECK(cgen_state)

+ Here is the call graph for this function: