OmniSciDB  06b3bd477c
 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 99 of file DBObject.cpp.

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

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

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

+ Here is the caller graph for this function:

std::string ObjectPermissionTypeToString ( DBObjectType  type)

Definition at line 81 of file DBObject.cpp.

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

81  {
82  switch (type) {
84  return "DATABASE";
85  case TableDBObjectType:
86  return "TABLE";
88  return "DASHBOARD";
89  case ViewDBObjectType:
90  return "VIEW";
91  case ServerDBObjectType:
92  return "SERVER";
93  default:
94  CHECK(false);
95  }
96  return "not possible";
97 }
CHECK(cgen_state)

+ Here is the call graph for this function: