FileID

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
#ifndef DataFormats_Provenance_FileID_h
#define DataFormats_Provenance_FileID_h

/*----------------------------------------------------------------------

Holds a unique file identifier in string form.

----------------------------------------------------------------------*/

#include <string>

namespace edm {

  class FileID {
  public:
    FileID() : fid_() {}
    explicit FileID(std::string const& id) : fid_(id) {}
    bool isValid() const { return !fid().empty(); }
    std::string const& fid() const { return fid_; }

  private:
    std::string fid_;
  };

  inline bool operator==(FileID const& lh, FileID const& rh) { return lh.fid() == rh.fid(); }

  inline bool operator!=(FileID const& lh, FileID const& rh) { return !(lh == rh); }

  std::ostream& operator<<(std::ostream& os, FileID const& id);
}  // namespace edm
#endif