using namespace ICoCo;
using std::string;
-Field::Field()
-{
+Field::Field() {
+ _name=new string;
}
-Field::~Field()
-{
+Field::~Field() {
+ delete _name;
}
-void Field::setName(const string& name)
-{
- _name=name;
+void Field::setName(const string& name) {
+ *_name=name;
}
-const string& Field::getName() const
-{
- return _name;
+const string& Field::getName() const {
+ return *_name;
}
-const char *Field::getCharName() const
-{
- return _name.c_str();
+const char* Field::getCharName() const {
+ return _name->c_str();
}
#ifndef _ICoCoField_included_
#define _ICoCoField_included_
-
#include <string>
-namespace ICoCo
-{
- class Field
- {
+
+namespace ICoCo {
+
+ class Field {
public:
Field();
virtual ~Field();
void setName(const std::string& name);
const std::string& getName() const;
- const char *getCharName() const;
+ const char* getCharName() const;
+
private:
- std::string _name;
+ std::string* _name;
};
}
-
#endif