1 #ifndef GAUDIKERNEL_TYPENAMESTRING_H
2 #define GAUDIKERNEL_TYPENAMESTRING_H
12 void init(
const std::string& tn,
const std::string& deftyp) {
13 const std::string::size_type slash_pos = tn.find_first_of(
"/");
14 m_haveType = slash_pos != std::string::npos;
15 m_name = (
m_haveType) ? tn.substr( slash_pos + 1) : tn;
16 m_type = (
m_haveType) ? tn.substr( 0, slash_pos ) : deftyp;
21 TypeNameString(
const std::string& tn,
const std::string& deftyp) {
init(tn, deftyp); m_haveType =
true; }
29 return s << tn.
type() <<
'/' << tn.
name();
35 #endif // GAUDIKERNEL_TYPENAMESTRING_H
std::ostream & operator<<(std::ostream &s, const TypeNameString &tn)
Output stream operator for TypeNameString instances.
Helper class to parse a string of format "type/name".
TypeNameString(const char tn[])
TypeNameString(const std::string &tn, const std::string &deftyp)
void init(const std::string &tn, const std::string &deftyp)
const std::string & type() const
TypeNameString(const std::string &tn)
const std::string & name() const
Helper functions to set/get the application return code.