Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to std::filesystem #30825

Merged
merged 1 commit into from
Jul 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DataFormats/OnlineMetaData/test/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<use name="cppunit"/>
<use name="DataFormats/FEDRawData"/>
<use name="DataFormats/OnlineMetaData"/>
<use name="stdcxx-fs"/>
<bin name="testDataFormatsOnlineMetaData" file="testRunner.cpp,onlineMetaDataRecord_t.cpp">
</bin>
5 changes: 2 additions & 3 deletions DataFormats/OnlineMetaData/test/onlineMetaDataRecord_t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@

#include <cstdint>
#include <cstdlib>
#include <filesystem>
#include <fstream>
#include <sstream>
#include <string.h>
#include <vector>

#include <boost/filesystem.hpp>

class TestOnlineMetaDataRecord : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(TestOnlineMetaDataRecord);
CPPUNIT_TEST(testDCSRecord_v1);
Expand Down Expand Up @@ -46,7 +45,7 @@ const unsigned char* TestOnlineMetaDataRecord::readPayload(const std::string& du
const std::string CMSSW_BASE(std::getenv("CMSSW_BASE"));
const std::string CMSSW_RELEASE_BASE(std::getenv("CMSSW_RELEASE_BASE"));
const std::string dumpFilePath = "/src/DataFormats/OnlineMetaData/test/" + dumpFileName;
const std::string fullPath = boost::filesystem::exists((CMSSW_BASE + dumpFilePath).c_str())
const std::string fullPath = std::filesystem::exists((CMSSW_BASE + dumpFilePath).c_str())
? CMSSW_BASE + dumpFilePath
: CMSSW_RELEASE_BASE + dumpFilePath;

Expand Down
2 changes: 1 addition & 1 deletion IORawData/CaloPatterns/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
<use name="CondFormats/DataRecord"/>
<use name="CondFormats/HcalObjects"/>
<use name="root"/>
<use name="boost_filesystem"/>
<use name="stdcxx-fs"/>
<use name="CalibCalorimetry/HcalAlgos"/>
<flags EDM_PLUGIN="1"/>
6 changes: 3 additions & 3 deletions IORawData/CaloPatterns/src/HtrXmlPatternTool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#include "HtrXmlPatternWriter.h"
#include "TFile.h"
#include "TH1.h"
#include <iostream>
#include <filesystem>
#include <fstream>
#include "boost/filesystem/operations.hpp"
#include <iostream>

HtrXmlPatternTool::HtrXmlPatternTool(HtrXmlPatternToolParameters* params) {
m_params = params;
Expand Down Expand Up @@ -107,7 +107,7 @@ void HtrXmlPatternTool::Fill(const HcalElectronicsId HEID, HODigiCollection::con
std::cerr << "Bad (crate): (" << HEID.readoutVMECrateId() << ")" << std::endl;
}

void HtrXmlPatternTool::prepareDirs() { boost::filesystem::create_directory(m_params->m_output_directory); }
void HtrXmlPatternTool::prepareDirs() { std::filesystem::create_directory(m_params->m_output_directory); }

void HtrXmlPatternTool::writeXML() {
std::cout << "Writing XML..." << std::endl;
Expand Down
1 change: 1 addition & 0 deletions L1TriggerConfig/L1GtConfigProducers/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<use name="HLTrigger/HLTcore"/>
<use name="Utilities/Xerces"/>
<use name="xerces-c"/>
<use name="stdcxx-fs"/>
<export>
<lib name="1"/>
</export>
6 changes: 2 additions & 4 deletions L1TriggerConfig/L1GtConfigProducers/src/L1GtVhdlWriter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@
#include "L1TriggerConfig/L1GtConfigProducers/interface/L1GtVhdlWriter.h"

// system include files
#include <filesystem>
#include <iostream>
#include <sys/stat.h>

// user include files
#include "boost/filesystem.hpp"

// base class
#include "FWCore/Framework/interface/EDAnalyzer.h"

Expand Down Expand Up @@ -102,7 +100,7 @@ void L1GtVhdlWriter::analyze(const edm::Event& iEvent, const edm::EventSetup& ev
channelVector.push_back("-- ca10: free");

// check, weather output directory exists and create it on the fly if not
if (boost::filesystem::is_directory(outputDir_)) {
if (std::filesystem::is_directory(outputDir_)) {
std::cout << std::endl << "Ok - Output directory exists!" << std::endl;
} else {
if (!mkdir(outputDir_.c_str(), 0666))
Expand Down