// make_file_dataset.cxx // // David Adams // June 2003 // // Create a ATLAS-POOL event dataset from a file. #include #include #include #include "dataset_util/FileStatus.h" #include "dataset_util/FileName.h" #include "dataset_util/Environment.h" #include "dataset_util/XmlElement.h" #include "dataset_util/DtdRegistry.h" #include "dataset_xml/XmlParser.h" #include "dataset_id/UniqueIdGenerator.h" #include "dataset_file/Url.h" #include "dataset_file/FileManagementSystem.h" #include "dataset_credential/GssCredentialManager.h" #include "dataset_base/SingleFileDataset.h" using std::string; using std::cout; using std::cerr; using std::endl; using dset::Url; using dset::FileManagementSystem; using dset::GssCredentialManager; using dset::Dataset; using dset::SingleFileDataset; //********************************************************************** int main(int argc, char* argv[]) { // Fetch arguments. string arg0 = argv[0]; // First argument. string dstype = ""; string content_label = ""; string xfile = "dataset.xml"; bool putfile = false; string ifname = ""; int stat = 0; // Print help and exit. bool help = false; // Flag to insert file into file catalog. for ( int iarg=1; iargis_valid() ) { cerr << "Unable to create dataset" << endl; if ( pdst != 0 ) { int err = pdst->error(); cerr << "Dataset reports error " << err << endl; } return 15; } // Create XML. const XmlElement* pele = pdst->xml(); if ( pele == 0 ) { cerr << "Unable to create XML" << endl; return 17; } // Write XML description. if ( xfile.size() ) { XmlParser parser; int wstat = parser.write(xfile, *pele); if ( wstat ) { cerr << "Error writing XML: " << wstat << endl; cerr << *pele << endl; } else { cerr << "Output in " << xfile << endl; } delete pele; } }