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; }
22 const std::string&
type()
const {
return m_type; }
23 const std::string&
name()
const {
return m_name; }
28 inline std::ostream&
operator<< (std::ostream&
s,
const TypeNameString& tn) {
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.
TypeNameString(const char tn[])
void init(const std::string &tn, const std::string &deftyp)
const std::string & type() const
const std::string & name() const
Helper functions to set/get the application return code.