Changeset 10296 for trunk/FACT++/src/Configuration.cc
- Timestamp:
- 04/07/11 10:10:33 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/Configuration.cc
r10230 r10296 267 267 #include <iostream> 268 268 269 #include <boost/bind.hpp> 269 270 #include <boost/regex.hpp> 270 271 //#include <boost/filesystem.hpp> … … 442 443 ("help-database", "Print available options retreived from the database.") 443 444 ("help-config", "Print available configuration file options.") 445 ("version,V", "Print version information.") 444 446 ("print-all", "Print all options as parsed from all the different sources.") 445 447 ("print", "Print options as parsed from the commandline.") … … 678 680 //! 679 681 // 680 void Configuration::SetNameMapper(const boost::function 1<std::string, std::string> &func)682 void Configuration::SetNameMapper(const boost::function<std::string(std::string)> &func) 681 683 { 682 684 fNameMapper = func; … … 686 688 { 687 689 fNameMapper = bind1st(mem_fun(&Configuration::DefaultMapper), this); 690 } 691 692 void Configuration::SetPrintUsage(const boost::function<void(void)> &func) 693 { 694 fPrintUsage = func; 695 } 696 697 void Configuration::SetPrintUsage() 698 { 699 fPrintUsage = boost::bind(&Configuration::PrintUsage, this); 688 700 } 689 701 … … 803 815 804 816 if (getfiles.count("help")) 805 cout << endl << fOptionsCommandline[kVisible] << endl; 817 { 818 fPrintUsage(); 819 cout << fOptionsCommandline[kVisible] << endl; 820 } 806 821 if (getfiles.count("help-config")) 807 cout << endl <<fOptionsConfigfile[kVisible] << endl;822 cout << fOptionsConfigfile[kVisible] << endl; 808 823 if (getfiles.count("help-env")) 809 cout << endl <<fOptionsEnvironment[kVisible] << endl;824 cout << fOptionsEnvironment[kVisible] << endl; 810 825 if (getfiles.count("help-database")) 811 cout << endl <<fOptionsDatabase[kVisible] << endl;826 cout << fOptionsDatabase[kVisible] << endl; 812 827 813 828 // ------------------------ (4) -------------------------- … … 826 841 { 827 842 fDefaultFile = getfiles["default"].as<string>(); 828 c out<< "Reading configuration from '" << fDefaultFile << "'." << endl;843 cerr << "Reading configuration from '" << fDefaultFile << "'." << endl; 829 844 } 830 845 … … 862 877 { 863 878 fPriorityFile = getfiles["config"].as<string>(); 864 c out<< "Retrieved option from '" << fPriorityFile << "'." << endl;879 cerr << "Retrieved option from '" << fPriorityFile << "'." << endl; 865 880 } 866 881 … … 895 910 { 896 911 fDatabase = getdatabase["database"].as<string>(); 897 c out<< "Retrieving configuration from '" << fDatabase << "'." << endl;912 cerr << "Retrieving configuration from '" << fDatabase << "'." << endl; 898 913 } 899 914
Note:
See TracChangeset
for help on using the changeset viewer.