Changeset 20011


Ignore:
Timestamp:
12/21/20 16:05:29 (4 years ago)
Author:
tbretz
Message:
Had to change to pointers, emplace_back and ofstream do not work in gcc 4.8(\!) ... ARGH\! CentOS 7 technology from the 80s
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/root2csv.cc

    r19960 r20011  
    679679        cout << "\n-------------------------- Converting file -------------------------" << endl;
    680680
    681     vector<ofstream> outfiles;
     681    vector<unique_ptr<ofstream>> outfiles;
    682682
    683683    if (split.empty())
     
    688688            return rc;
    689689
    690         outfiles.emplace_back(path.Data(), append ? ios::app : ios::trunc);
     690        outfiles.emplace_back(new ofstream(path.Data(), append ? ios::app : ios::trunc));
    691691        if (rc==-1 || (force && rc==0 && !append))
    692             WriteHeader(outfiles.back(), vec, formulas, skip, header);
     692            WriteHeader(*outfiles.back(), vec, formulas, skip, header);
    693693    }
    694694    else
     
    703703            if (rc>0)
    704704                return rc;
    705             outfiles.emplace_back(path.Data(), append ? ios::app : ios::trunc);
     705            outfiles.emplace_back(new ofstream(path.Data(), append ? ios::app : ios::trunc));
    706706            if (rc==-1 || (force && rc==0 && !append))
    707                 WriteHeader(outfiles.back(), vec, formulas, skip, header);
     707                WriteHeader(*outfiles.back(), vec, formulas, skip, header);
    708708        }
    709709    }
     
    749749            join.emplace_back(to_string((*v)->EvalInstance(0)));
    750750
    751         outfiles[index] << boost::join(join, " ") << "\n";
     751        *outfiles[index] << boost::join(join, " ") << "\n";
    752752    }
    753753
     
    755755    {
    756756        cout << "\nTotal: N=" << count << " out of " << num << " row(s) written [N=" << first << ".." << num-1 << "]." << endl;
    757         for (int i=0; i<split.size(); i++)
     757        for (size_t i=0; i<split.size(); i++)
    758758            cout << "File " << i << ": nrows=" << ncount[i] << '\n';
    759759        cout << '\n';
  • trunk/FACT++/src/rootifysql.cc

    r19967 r20011  
    937937    // ------------------------- Open the ascii files --------------------------
    938938
    939     vector<ofstream> fout;
     939    vector<unique_ptr<ofstream>> fout;
    940940    if (!write.empty())
    941941    {
     
    949949        for (auto it=names.cbegin(); it!=names.cend(); it++)
    950950        {
    951             fout.emplace_back(*it);
     951            fout.emplace_back(new ofstream(*it));
    952952            if (!*fout.rbegin())
    953953                cout << "WARNING: Writing to '" << write << "' failed: " << strerror(errno) << endl;
     
    997997    for (auto ff=fout.begin(); ff!=fout.end(); ff++)
    998998    {
    999         *ff << contents;
    1000         *ff << "# " << htxt.str() << endl;
     999        **ff << contents;
     1000        **ff << "# " << htxt.str() << endl;
    10011001    }
    10021002
     
    10161016            cout << rtxt.str() << '\n';
    10171017        if (!fout.empty())
    1018             fout[index] << rtxt.str() << '\n';
     1018            *fout[index] << rtxt.str() << '\n';
    10191019
    10201020        size_t idx=0;
Note: See TracChangeset for help on using the changeset viewer.