Author: wyoung
Date: Tue Dec 11 06:55:05 2007
New Revision: 1995
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1995&view=rev
Log:
Made previously-public member variable mysql_type_info::_length private
and renamed it to length_ to match current naming scheme. Similar for
_max_length. Not only was it just bad style, nothing outside the class
actually accessed these; we already have accessor methods for them,
which presumably anyone who cares about these values is using.
Modified:
trunk/Wishlist
trunk/lib/type_info.h
Modified: trunk/Wishlist
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/Wishlist?rev=1995&r1=1994&r2=1995&view=diff
==============================================================================
--- trunk/Wishlist (original)
+++ trunk/Wishlist Tue Dec 11 06:55:05 2007
@@ -11,8 +11,6 @@
---------
o Can we move the position enum inside the SSQLS? E.g., in
custom5, stock_price becomes stock::price_pos or similar?
-
- o Why are _length and _max_length public in type_info.h?
o Redesign Result to be a real container of Rows:
Modified: trunk/lib/type_info.h
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/type_info.h?rev=1995&r1=1994&r2=1995&view=diff
==============================================================================
--- trunk/lib/type_info.h (original)
+++ trunk/lib/type_info.h Tue Dec 11 06:55:05 2007
@@ -137,8 +137,8 @@
/// If you don't, we have arranged a pretty spectacular crash for
/// your program. So there.
mysql_type_info() :
- _length(0),
- _max_length(0),
+ length_(0),
+ max_length_(0),
num_(static_cast<unsigned char>(-1))
{
}
@@ -150,8 +150,8 @@
/// \param _null if true, this type can hold a SQL null
mysql_type_info(enum_field_types t, bool _unsigned = false,
bool _null = false) :
- _length(0),
- _max_length(0),
+ length_(0),
+ max_length_(0),
num_(type(t, _unsigned, _null))
{
}
@@ -160,8 +160,8 @@
///
/// \param f field from which we extract the type info
mysql_type_info(const MYSQL_FIELD& f) :
- _length(f.length),
- _max_length(f.max_length),
+ length_(f.length),
+ max_length_(f.max_length),
num_(type(f.type, (f.flags & UNSIGNED_FLAG) != 0,
(f.flags & NOT_NULL_FLAG) == 0))
{
@@ -169,8 +169,8 @@
/// \brief Create object as a copy of another
mysql_type_info(const mysql_type_info& t) :
- _length(t._length),
- _max_length(t._max_length),
+ length_(t.length_),
+ max_length_(t.max_length_),
num_(t.num_)
{
}
@@ -188,8 +188,8 @@
mysql_type_info& operator =(const mysql_type_info& t)
{
num_ = t.num_;
- _length = t._length;
- _max_length = t._max_length;
+ length_ = t.length_;
+ max_length_ = t.max_length_;
return *this;
}
@@ -224,13 +224,13 @@
///
/// This only works if you initialized this object from a
/// MYSQL_FIELD object.
- const unsigned int length() const { return _length; }
+ const unsigned int length() const { return length_; }
/// \brief Return maximum length of data in this field
///
/// This only works if you initialized this object from a
/// MYSQL_FIELD object.
- const unsigned int max_length() const { return _max_length; }
+ const unsigned int max_length() const { return max_length_; }
/// \brief Returns the type_info for the C++ type inside of the
/// mysqlpp::Null type.
@@ -280,9 +280,6 @@
/// We expose this because other parts of MySQL++ need to know
/// what the string constant is at the moment.
static const enum_field_types string_type = MYSQL_TYPE_STRING;
-
- unsigned int _length; ///< field length, from MYSQL_FIELD
- unsigned int _max_length; ///< max data length, from MYSQL_FIELD
private:
typedef mysql_ti_sql_type_info sql_type_info;
@@ -320,6 +317,8 @@
}
unsigned char num_;
+ unsigned int length_;
+ unsigned int max_length_;
};
/// \brief Returns true if two mysql_type_info objects are equal.
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits