mirror of https://gitee.com/bigwinds/arangodb
Add de/stringifyier for transaction type enum
This commit is contained in:
parent
ffbfc9e9e3
commit
f97044952e
|
@ -64,6 +64,19 @@
|
|||
/// @brief whether or not a transaction consists of a single operation
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
TRI_transaction_type_e TRI_GetTransactionTypeFromStr(const char* s) {
|
||||
if (!strcmp(s, "read")) {
|
||||
return TRI_TRANSACTION_READ;
|
||||
}
|
||||
else if (!strcmp(s, "write")) {
|
||||
return TRI_TRANSACTION_WRITE;
|
||||
}
|
||||
else {
|
||||
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_INTERNAL, "invalid transaction type");
|
||||
}
|
||||
}
|
||||
|
||||
static triagens::wal::LogfileManager* GetLogfileManager () {
|
||||
return triagens::wal::LogfileManager::instance();
|
||||
}
|
||||
|
|
|
@ -177,6 +177,17 @@ TRI_transaction_collection_t;
|
|||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- constructors / destructors
|
||||
// -----------------------------------------------------------------------------
|
||||
inline const char* TRI_TransactionTypeGetStr(TRI_transaction_type_e t) {
|
||||
switch (t) {
|
||||
case TRI_TRANSACTION_READ:
|
||||
return "read";
|
||||
case TRI_TRANSACTION_WRITE:
|
||||
return "write";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
TRI_transaction_type_e TRI_GetTransactionTypeFromStr(const char* s);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief create a new transaction
|
||||
|
|
Loading…
Reference in New Issue