From 4b1e9f0a359fef1f21faf368ab3dd743e1567a22 Mon Sep 17 00:00:00 2001 From: amayank Date: Wed, 16 Jan 2013 14:25:09 -0800 Subject: [PATCH] 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 --- include/leveldb/status.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/leveldb/status.h b/include/leveldb/status.h index 11dbd4b47..355c839f0 100644 --- a/include/leveldb/status.h +++ b/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; }