diff --git a/include/rocksdb/utilities/ldb_cmd.h b/include/rocksdb/utilities/ldb_cmd.h index a3ecb03b09ebbb25a3d567d9a13e0d47a3652212..a91505ebe380b244f352c62526dee3066a332fa6 100644 --- a/include/rocksdb/utilities/ldb_cmd.h +++ b/include/rocksdb/utilities/ldb_cmd.h @@ -53,12 +53,19 @@ class LDBCommand { static const std::string ARG_CREATE_IF_MISSING; static const std::string ARG_NO_VALUE; - template + // parameters: cmd, cmdParams, option_map, flags + // The same interface as SelectCommand() + typedef std::function&, + const std::map&, + const std::vector&)> + RocksDBLDBSelectFunc; + static LDBCommand* InitFromCmdLineArgs( const std::vector& args, const Options& options, const LDBOptions& ldb_options, const std::vector* column_families, - Selector selector = SelectCommand); + const RocksDBLDBSelectFunc& selector = SelectCommand); static LDBCommand* InitFromCmdLineArgs( int argc, char** argv, const Options& options, diff --git a/tools/ldb_cmd.cc b/tools/ldb_cmd.cc index b226614e01d6b25850a5db49c5075a619659cbe5..f5758f88219abc2f6706119b7d995c089b2e0555 100644 --- a/tools/ldb_cmd.cc +++ b/tools/ldb_cmd.cc @@ -98,12 +98,11 @@ LDBCommand* LDBCommand::InitFromCmdLineArgs( * Command name is not included in args. * Returns nullptr if the command-line cannot be parsed. */ -template LDBCommand* LDBCommand::InitFromCmdLineArgs( const std::vector& args, const Options& options, const LDBOptions& ldb_options, const std::vector* column_families, - Selector selector) { + const RocksDBLDBSelectFunc& selector) { // --x=y command line arguments are added as x->y map entries. std::map option_map;