Changeset 20011 for trunk/FACT++/src
- Timestamp:
- 12/21/20 16:05:29 (4 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/root2csv.cc
r19960 r20011 679 679 cout << "\n-------------------------- Converting file -------------------------" << endl; 680 680 681 vector< ofstream> outfiles;681 vector<unique_ptr<ofstream>> outfiles; 682 682 683 683 if (split.empty()) … … 688 688 return rc; 689 689 690 outfiles.emplace_back( path.Data(), append ? ios::app : ios::trunc);690 outfiles.emplace_back(new ofstream(path.Data(), append ? ios::app : ios::trunc)); 691 691 if (rc==-1 || (force && rc==0 && !append)) 692 WriteHeader( outfiles.back(), vec, formulas, skip, header);692 WriteHeader(*outfiles.back(), vec, formulas, skip, header); 693 693 } 694 694 else … … 703 703 if (rc>0) 704 704 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)); 706 706 if (rc==-1 || (force && rc==0 && !append)) 707 WriteHeader( outfiles.back(), vec, formulas, skip, header);707 WriteHeader(*outfiles.back(), vec, formulas, skip, header); 708 708 } 709 709 } … … 749 749 join.emplace_back(to_string((*v)->EvalInstance(0))); 750 750 751 outfiles[index] << boost::join(join, " ") << "\n";751 *outfiles[index] << boost::join(join, " ") << "\n"; 752 752 } 753 753 … … 755 755 { 756 756 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++) 758 758 cout << "File " << i << ": nrows=" << ncount[i] << '\n'; 759 759 cout << '\n'; -
trunk/FACT++/src/rootifysql.cc
r19967 r20011 937 937 // ------------------------- Open the ascii files -------------------------- 938 938 939 vector< ofstream> fout;939 vector<unique_ptr<ofstream>> fout; 940 940 if (!write.empty()) 941 941 { … … 949 949 for (auto it=names.cbegin(); it!=names.cend(); it++) 950 950 { 951 fout.emplace_back( *it);951 fout.emplace_back(new ofstream(*it)); 952 952 if (!*fout.rbegin()) 953 953 cout << "WARNING: Writing to '" << write << "' failed: " << strerror(errno) << endl; … … 997 997 for (auto ff=fout.begin(); ff!=fout.end(); ff++) 998 998 { 999 * ff << contents;1000 * ff << "# " << htxt.str() << endl;999 **ff << contents; 1000 **ff << "# " << htxt.str() << endl; 1001 1001 } 1002 1002 … … 1016 1016 cout << rtxt.str() << '\n'; 1017 1017 if (!fout.empty()) 1018 fout[index] << rtxt.str() << '\n';1018 *fout[index] << rtxt.str() << '\n'; 1019 1019 1020 1020 size_t idx=0;
Note:
See TracChangeset
for help on using the changeset viewer.