1#ifndef __JGIZMO__JROOTOBJECTID__
2#define __JGIZMO__JROOTOBJECTID__
60 const std::string&
name) :
75 const std::string& dir,
76 const std::string&
name) :
90 std::istringstream(full_name) >> *
this;
123 return TString(
name.c_str());
209 for (
int bracket = 0; in.peek() != EOF; ) {
211 const char c = (char) in.get();
221 }
else if (isspace(c)) {
233 if (pos != string::npos) {
235 object.file_name = buffer.substr(0, pos);
236 object.name = buffer.substr(pos + 1);
240 if (pos != string::npos) {
242 object.directory =
object.name.substr(0, pos);
243 object.name =
object.name.substr(pos + 1);
246 }
else if (!buffer.empty()) {
248 throw JParseError(
"JRootObjectID error parsing " + buffer);
264 return out <<
object.getFilename() <<
FILENAME_SEPARATOR <<
object.getFullObjectName();
Auxiliary class to handle file name, ROOT directory and object name.
JRootObjectID(const std::string &file_name, const std::string &dir, const std::string &name)
Constructor.
TString getObjectName() const
Get object name.
friend std::istream & operator>>(std::istream &in, JRootObjectID &object)
Read object identifier from input.
JRootObjectID()
Default constructor.
static const char PATHNAME_SEPARATOR
path name separator
JRootObjectID(const std::string &full_name)
Constructor.
friend bool operator==(const JRootObjectID &first, const JRootObjectID &second)
Equal operator for object identifiers.
static const char LABEL_L_BRACKET
left bracket for label
TString getFullFilename() const
Get full file name, including path.
friend std::ostream & operator<<(std::ostream &out, const JRootObjectID &object)
Write object identifier to output.
static const char LABEL_R_BRACKET
right bracket for label
TString getDirectory() const
Get directory.
const std::string & getFilename() const
Get file name.
bool is_valid() const
Check validity.
static const char FILENAME_SEPARATOR
file name separator
JRootObjectID(const std::string &file_name, const std::string &name)
Constructor.
TString getFullObjectName() const
Get full object name, including path.
Exception for parsing value.
Auxiliary applications for use of ROOT and more.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).