[11261] Get rid of two const_casts by storing const char* instead of char*

This commit is contained in:
zergtmn 2011-03-16 20:02:29 +05:00
parent b588ea9db3
commit df89544baa
2 changed files with 6 additions and 6 deletions

View file

@ -35,7 +35,7 @@ class Field
};
Field() : mValue(NULL), mType(DB_TYPE_UNKNOWN) {}
Field(const char *value, enum DataTypes type) : mType(type) { mValue = const_cast<char * >(value); }
Field(const char* value, enum DataTypes type) : mValue(value), mType(type) {}
~Field() {}
@ -69,13 +69,13 @@ class Field
void SetType(enum DataTypes type) { mType = type; }
//no need for memory allocations to store resultset field strings
//all we need is to cache pointers returned by different DBMS APIs
void SetValue(const char *value) { mValue = const_cast<char * >(value); };
void SetValue(const char* value) { mValue = value; };
private:
Field(Field &f);
Field& operator=(const Field& );
Field(Field const&);
Field& operator=(Field const&);
char *mValue;
const char* mValue;
enum DataTypes mType;
};
#endif