OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 DBObjectTypeToString (DBObjectType type)
 
DBObjectType DBObjectTypeFromString (const std::string &type)
 

Function Documentation

DBObjectType DBObjectTypeFromString ( const std::string &  type)

Definition at line 110 of file DBObject.cpp.

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

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

110  {
111  if (type.compare("DATABASE") == 0) {
112  return DatabaseDBObjectType;
113  } else if (type.compare("TABLE") == 0) {
114  return TableDBObjectType;
115  } else if (type.compare("DASHBOARD") == 0) {
116  return DashboardDBObjectType;
117  } else if (type.compare("VIEW") == 0) {
118  return ViewDBObjectType;
119  } else if (type.compare("SERVER") == 0) {
120  return ServerDBObjectType;
121  } else {
122  throw std::runtime_error("DB object type " + type + " is not supported.");
123  }
124 }

+ Here is the caller graph for this function:

std::string DBObjectTypeToString ( DBObjectType  type)

Definition at line 92 of file DBObject.cpp.

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

Referenced by Catalog_Namespace::anonymous_namespace{Catalog.cpp}::convert_object_owners_map_to_string(), and Parser::verifyObject().

92  {
93  switch (type) {
95  return "DATABASE";
96  case TableDBObjectType:
97  return "TABLE";
99  return "DASHBOARD";
100  case ViewDBObjectType:
101  return "VIEW";
102  case ServerDBObjectType:
103  return "SERVER";
104  default:
105  CHECK(false);
106  }
107  return "not possible";
108 }
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the caller graph for this function: