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
main
amayank 12 years ago
parent 7d5a4383bb
commit 4b1e9f0a35
  1. 6
      include/leveldb/status.h

@ -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; }

Loading…
Cancel
Save