Changeset 10230


Ignore:
Timestamp:
Mar 9, 2011, 8:35:04 AM (9 years ago)
Author:
tbretz
Message:
Added compatibility with boost V1.40
Location:
trunk/FACT++
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/configure

    r10216 r10230  
    1812018120
    1812118121if test "x$want_boost" = "xyes"; then
    18122         boost_lib_version_req=1.42
     18122        boost_lib_version_req=1.40
    1812318123        boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([0-9]*\.[0-9]*\)'`
    1812418124        boost_lib_version_req_major=`expr $boost_lib_version_req : '\([0-9]*\)'`
  • trunk/FACT++/configure.ac

    r10216 r10230  
    120120######################################################################
    121121
    122 AX_BOOST_BASE([1.42], [],
     122AX_BOOST_BASE([1.40], [],
    123123   [
    124124      echo "Error! The boost C++ libraries are not properly installed."
  • trunk/FACT++/src/Configuration.cc

    r10220 r10230  
    264264#include "Configuration.h"
    265265
     266#include <fstream>
    266267#include <iostream>
    267268
    268269#include <boost/regex.hpp>
    269 #include <boost/filesystem.hpp>
     270//#include <boost/filesystem.hpp>
    270271#include <boost/program_options.hpp>
    271272
     
    759760//!    - describe what happens in a more general way
    760761//!    - print a waring when no default coonfig file is read
     762//!    - proper handling and error messages if files not available
    761763//
    762764const po::variables_map &Configuration::Parse(int argc, char **argv)
     
    829831    const bool checkf    = !getfiles.count("dont-check-files") && !getfiles.count("dont-check");
    830832    const bool defaulted = getfiles.count("default") && getfiles["default"].defaulted();
    831     const bool exists    = boost::filesystem::exists(fDefaultFile);
    832 
     833    //const bool exists    = boost::filesystem::exists(fDefaultFile);
     834
     835    ifstream indef(fDefaultFile.c_str());
     836    // ===> FIXME: Proper handling of missing file or wrong file name
    833837    const po::parsed_options parsed_defaultfile =
    834         !exists && defaulted ?
     838        !indef && defaulted ?
    835839        po::parsed_options(&opt_configfile) :
    836         po::parse_config_file<char>(fDefaultFile.c_str(), opt_configfile, !checkf);
     840        po::parse_config_file<char>(indef, opt_configfile, !checkf);
    837841
    838842    // ------------------------ (6) --------------------------
     
    840844    if (getfiles.count("print-default") || getfiles.count("print-all"))
    841845    {
    842         if (!exists && defaulted)
     846        if (!indef && defaulted)
    843847            cout << "No configuration file by --default option specified." << endl;
    844848        else
     
    861865    }
    862866
    863     //        cout << "PRIO : " << fPriorityFile << endl;
    864 
     867    ifstream inpri(fPriorityFile.c_str());
     868    // ===> FIXME: Proper handling of missing file or wrong file name
    865869    const po::parsed_options parsed_priorityfile =
    866870        fPriorityFile.empty() ? po::parsed_options(&opt_configfile) :
    867         po::parse_config_file<char>(fPriorityFile.c_str(), opt_configfile, !checkf);
     871        po::parse_config_file<char>(inpri, opt_configfile, !checkf);
    868872
    869873    // ------------------------ (8) --------------------------
     
    888892    po::store(parsed_defaultfile,  getdatabase);
    889893
    890     //        cout << "NODB : " << getdatabase.count("no-database") << endl;
    891 
    892894    if (getdatabase.count("database") && !getdatabase.count("no-database"))
    893895    {
     
    896898    }
    897899
    898     //        cout << "DB   : " << fDatabase << endl;
    899900    const bool checkdb = !getdatabase.count("dont-check-database") && !getdatabase.count("dont-check");
    900901
  • trunk/FACT++/src/argv.cc

    r10222 r10230  
    149149    catch (std::exception &e)
    150150    {
     151#if BOOST_VERSION > 104000
    151152        po::multiple_occurrences *MO = dynamic_cast<po::multiple_occurrences*>(&e);
    152153        if (MO)
    153154            cout << "Error: " << e.what() << " of '" << MO->get_option_name() << "' option." << endl;
    154155        else
     156#endif
    155157            cout << "Error: " << e.what() << endl;
    156158        cout << endl;
  • trunk/FACT++/src/dclient5.cc

    r10221 r10230  
    491491    catch (std::exception &e)
    492492    {
     493#if BOOST_VERSION > 104000
    493494        po::multiple_occurrences *MO = dynamic_cast<po::multiple_occurrences*>(&e);
    494495        if (MO)
    495496            cout << "Error: " << e.what() << " of '" << MO->get_option_name() << "' option." << endl;
    496497        else
     498#endif
    497499            cout << "Error: " << e.what() << endl;
    498500        cout << endl;
  • trunk/FACT++/src/test3.cc

    r10221 r10230  
    6262    catch (std::exception &e)
    6363    {
     64#if BOOST_VERSION > 104000
    6465        po::multiple_occurrences *MO = dynamic_cast<po::multiple_occurrences*>(&e);
    6566        if (MO)
    6667            cout << "Error: " << e.what() << " of '" << MO->get_option_name() << "' option." << endl;
    6768        else
     69#endif
    6870            cout << "Error: " << e.what() << endl;
    6971        cout << endl;
Note: See TracChangeset for help on using the changeset viewer.