Added an API in rocksdb for checking for "invalid argument" and "not supported" for leveldb::Status

Summary: a function added to status.h to check whether Status::code is InvalidArgument and similarly for NotSupported state

Test Plan: visual inspection

Reviewers: heyongqiang, dhruba

Reviewed By: dhruba

CC: leveldb

Differential Revision: https://reviews.facebook.net/D7989
This commit is contained in:
amayank 2013-01-16 14:25:09 -08:00
parent 7d5a4383bb
commit 4b1e9f0a35

View File

@ -57,6 +57,12 @@ class Status {
// Returns true iff the status indicates a Corruption error.
bool IsCorruption() const { return code() == kCorruption; }
// Returns true iff the status indicates a NotSupported error.
bool IsNotSupported() const { return code() == kNotSupported; }
// Returns true iff the status indicates an InvalidArgument error.
bool IsInvalidArgument() const { return code() == kInvalidArgument; }
// Returns true iff the status indicates an IOError.
bool IsIOError() const { return code() == kIOError; }