StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Named.cxx
1 // Named.cpp: implementation of the Named class.
2 //
4 
5 #include "Sti/Base/Named.h"
6 #include <string.h>
7 
8 Named::Named(const string & aName)
9 {
10  setName(aName);
11 }
12 
13 Named::~Named()
14 {}
15 void Named::setName(const string & aName)
16 {
17  int i = aName.size()-1;
18  for(;i>=0 && aName[i]==' ';i--) {};
19  _name = string(aName,0,i+1);
20 }
21 
22 const string& Named::getName() const
23 {
24  return _name;
25 }
26 
27 bool Named::isName(const string &aName) const
28 {
29  int i = aName.size()-1;
30  for(;i>=0 && aName[i]==' ';i--) {}
31  return _name==string(aName,0,i+1);
32 }
33 
34 
35 
bool isName(const string &aName) const
Determine whether name equals given name.
Definition: Named.cxx:27
void setName(const string &newName)
Set the name of the object.
Definition: Named.cxx:15
Named(const string &aName=" ")
Only derived class are Named.
Definition: Named.cxx:8
const string & getName() const
Get the name of the object.
Definition: Named.cxx:22