3 /// Misc. utility functions for command line tools.
7 Copyright (C) 2012, Net Direct Inc. (http://www.netdirect.ca/)
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU General Public License in the COPYING file at the
19 root directory of this project for more details.
24 #include <barry/barry.h>
25 #ifdef __BARRY_SYNC_MODE__
26 #include <barry/barrysync.h>
33 using namespace Barry
;
35 void ShowParsers(bool show_fields
, bool show_mime_support
)
37 cout
<< "Supported Database parsers:\n";
39 #ifdef __BARRY_SYNC_MODE__
40 if( show_mime_support
)
41 cout
<< " (* = can display in vformat MIME mode)\n";
43 #define MIME_DOT(tname) (MimeDump<tname>::Supported() && show_mime_support ? " *" : "")
46 #define MIME_DOT(tname) ""
50 #define HANDLE_PARSER(tname) \
52 cout << " " << tname::GetDBName() << MIME_DOT(tname) << "\n"; \
55 FieldHandle<tname>::ListT::const_iterator \
56 fhi = tname::GetFieldHandles().begin(), \
57 fhe = tname::GetFieldHandles().end(); \
58 for( int count = 0, len = 6; fhi != fhe; ++fhi, ++count ) { \
63 std::string name = fhi->GetIdentity().Name; \
64 if( len + name.size() >= 75 ) { \
75 ALL_KNOWN_PARSER_TYPES
82 cout
<< "Supported Database builders:\n";
85 #define HANDLE_BUILDER(tname) cout << " " << tname::GetDBName() << "\n";
86 ALL_KNOWN_BUILDER_TYPES