diff options
author | Adam Midvidy <amidvidy@gmail.com> | 2015-05-18 11:28:33 -0400 |
---|---|---|
committer | Adam Midvidy <amidvidy@gmail.com> | 2015-05-18 19:22:13 -0400 |
commit | 43dedc33efa736e91d3389d9a972c93fef78e06a (patch) | |
tree | b21b952b3d17fc4ed8307be83059f91f75783f2a /src/mongo/bson/bson_validate.h | |
parent | 73f9656f8750bfffc41333e92ea4f0bd805e2f2c (diff) | |
download | mongo-43dedc33efa736e91d3389d9a972c93fef78e06a.tar.gz |
SERVER-18167 add method for validating input/output to a DataRange
Diffstat (limited to 'src/mongo/bson/bson_validate.h')
-rw-r--r-- | src/mongo/bson/bson_validate.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mongo/bson/bson_validate.h b/src/mongo/bson/bson_validate.h index dadad6d2c4b..abf48c4e882 100644 --- a/src/mongo/bson/bson_validate.h +++ b/src/mongo/bson/bson_validate.h @@ -29,12 +29,14 @@ #pragma once -#include "mongo/base/status.h" +#include "mongo/base/data_type_validated.h" #include "mongo/base/string_data.h" #include "mongo/bson/bsontypes.h" #include "mongo/platform/cstdint.h" namespace mongo { + class BSONObj; + class Status; /** * @param buf - bson data @@ -43,5 +45,9 @@ namespace mongo { */ Status validateBSON( const char* buf, uint64_t maxLength ); -} + template<> struct Validator<BSONObj> { + static Status validateLoad(const char* ptr, size_t length); + static Status validateStore(const BSONObj& toStore); + }; +} // namespace mongo |