diff options
Diffstat (limited to 'tools/tool.h')
-rw-r--r-- | tools/tool.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/tools/tool.h b/tools/tool.h index 18996ec..330fc2d 100644 --- a/tools/tool.h +++ b/tools/tool.h @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2010 10gen Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + // Tool.h #pragma once @@ -19,7 +35,7 @@ namespace mongo { class Tool { public: - Tool( string name , string defaultDB="test" , string defaultCollection=""); + Tool( string name , bool localDBAllowed=true, string defaultDB="test" , string defaultCollection=""); virtual ~Tool(); int main( int argc , char ** argv ); @@ -39,6 +55,11 @@ namespace mongo { return _params[name.c_str()].as<string>(); return def; } + int getParam( string name , int def ){ + if ( _params.count( name ) ) + return _params[name.c_str()].as<int>(); + return def; + } bool hasParam( string name ){ return _params.count( name ); } |