List:Commits« Previous MessageNext Message »
From:pharvey Date:January 31 2006 10:38pm
Subject:Connector/ODBC 5 commit: r53 - in MYODBCDes: MYODBCDesLib include
View as plain text  
Modified:
   MYODBCDes/MYODBCDesLib/MYODBCDesRec.cpp
   MYODBCDes/MYODBCDesLib/MYODBCDesRecAPD.cpp
   MYODBCDes/include/MYODBCDesRec.h
Log:
UNICODE:
- some code cleanup in MYODBCDesRecAPD


Modified: MYODBCDes/MYODBCDesLib/MYODBCDesRec.cpp
===================================================================
--- MYODBCDes/MYODBCDesLib/MYODBCDesRec.cpp	2006-01-31 09:47:34 UTC (rev 52)
+++ MYODBCDes/MYODBCDesLib/MYODBCDesRec.cpp	2006-01-31 22:38:03 UTC (rev 53)
@@ -976,6 +976,46 @@
     MYODBCDbgReturn( SQL_SUCCESS );
 }
 
+MYODBCDesRec &MYODBCDesRec::operator=( const MYODBCDesRec &desrec )
+{
+    desrec.nAutoUniqueValue             = nAutoUniqueValue;
+    desrec.nCaseSensitive               = nCaseSensitive;
+    desrec.nConciseType                 = nConciseType;
+    desrec.nDatetimeIntervalCode        = nDatetimeIntervalCode;
+    desrec.nDatetimeIntervalPrecision   = nDatetimeIntervalPrecision;
+    desrec.nDisplaySize                 = nDisplaySize;
+    desrec.nFixedPrecScale              = nFixedPrecScale;
+    desrec.nLength                      = nLength;
+    desrec.nNullable                    = nNullable;
+    desrec.nNumPrecRadix                = nNumPrecRadix;
+    desrec.nOctetLength                 = nOctetLength;
+    desrec.nParamterType                = nParamterType;
+    desrec.nPrecision                   = nPrecision;
+    desrec.nRowver                      = nRowver;
+    desrec.nScale                       = nScale;
+    desrec.nSearchable                  = nSearchable;
+    desrec.nType                        = nType;
+    desrec.nUnnamed                     = nUnnamed;
+    desrec.nUnsigned                    = nUnsigned;
+    desrec.nUpdatable                   = nUpdatable;
+    desrec.pDataPtr                     = pDataPtr;
+    desrec.pnIndicatorPtr               = pnIndicatorPtr;
+    desrec.pnOctetLengthPtr             = pnOctetLengthPtr;
+    desrec.stringBaseColumnName         = stringBaseColumnName;
+    desrec.stringBaseTableName          = stringBaseTableName;
+    desrec.stringCatalogName            = stringCatalogName;
+    desrec.stringLabel                  = stringLabel;
+    desrec.stringLiteralPrefix          = stringLiteralPrefix;
+    desrec.stringLiteralSuffix          = stringLiteralSuffix;
+    desrec.stringLocalTypeName          = stringLocalTypeName;
+    desrec.stringName                   = stringName;
+    desrec.stringSchemaName             = stringSchemaName;
+    desrec.stringTableName              = stringTableName;
+    desrec.stringTypeName               = stringTypeName;
+
+    MYODBCDbgReturn3( "%p", *this );
+}
+
 SQLRETURN MYODBCDesRec::setIntervalCode( SQLSMALLINT nDateTimeIntervalCode )
 {
     MYODBCDbgEnter();

Modified: MYODBCDes/MYODBCDesLib/MYODBCDesRecAPD.cpp
===================================================================
--- MYODBCDes/MYODBCDesLib/MYODBCDesRecAPD.cpp	2006-01-31 09:47:34 UTC (rev 52)
+++ MYODBCDes/MYODBCDesLib/MYODBCDesRecAPD.cpp	2006-01-31 22:38:03 UTC (rev 53)
@@ -25,6 +25,8 @@
 {
     MYODBCDbgEnter();
 
+    SQLRETURN nReturn = SQL_SUCCESS;
+
     /*! \internal ODBC Rule
 
         If an application calls SQLSetDescField to set any field other than
SQL_DESC_COUNT or the 
@@ -70,7 +72,8 @@
                 
                 APD: Unused
             */
-            MYODBCDbgReturn( getDes()->getDia()->doAppend( MYODBC_DIA_HY091, 0,
NULL ) );
+            nReturn = getDes()->getDia()->doAppend( MYODBC_DIA_HY091, 0, NULL );
+            break;
 
         case SQL_DESC_CONCISE_TYPE:
             /*!
@@ -78,7 +81,8 @@
                 
                 APD: R/W                  
             */
-            MYODBCDbgReturn( setConciseTypeC( (SQLSMALLINT)pValuePtr ) );
+            nReturn = setConciseTypeC( (SQLSMALLINT)pValuePtr );
+            break;
 
         case SQL_DESC_DATA_PTR:
             /*!
@@ -117,7 +121,7 @@
                 if ( bHasInfo )
                     MYODBCDbgReturn( SQL_SUCCESS_WITH_INFO );
             }
-            MYODBCDbgReturn( SQL_SUCCESS );
+            break;
 
         case SQL_DESC_DATETIME_INTERVAL_CODE:
             /*!
@@ -125,7 +129,8 @@
               
                 APD: R/W
             */
-            MYODBCDbgReturn( setIntervalCode( (SQLSMALLINT)pValuePtr ) );
+            nReturn = setIntervalCode( (SQLSMALLINT)pValuePtr );
+            break;
 
         case SQL_DESC_DATETIME_INTERVAL_PRECISION:
             /*!
@@ -144,7 +149,8 @@
                 or SQL_INTERVAL_SECOND data type. This field is undefined for 
                 all other data types.
             */
-            MYODBCDbgReturn( setDatetimeIntervalPrecision( (SQLSMALLINT)pValuePtr ) ); 
+            nReturn = setDatetimeIntervalPrecision( (SQLSMALLINT)pValuePtr );
+            break;
 
         case SQL_DESC_DISPLAY_SIZE:
             /*!
@@ -158,7 +164,8 @@
       
                 APD: Unused
             */
-            MYODBCDbgReturn( getDes()->getDia()->doAppend( MYODBC_DIA_HY091, 0,
NULL ) );
+            nReturn = getDes()->getDia()->doAppend( MYODBC_DIA_HY091, 0, NULL );
+            break;
 
         case SQL_DESC_INDICATOR_PTR:
             /*!
@@ -166,7 +173,8 @@
       
                 APD: R/W
             */
-            MYODBCDbgReturn( setIndicatorPtr( (SQLINTEGER*)pValuePtr ) );
+            nReturn = setIndicatorPtr( (SQLINTEGER*)pValuePtr );
+            break;
 
         case SQL_DESC_LABEL:
             /*!
@@ -174,7 +182,8 @@
       
                 APD: Unused
             */
-            MYODBCDbgReturn( getDes()->getDia()->doAppend( MYODBC_DIA_HY091, 0,
NULL ) );
+            nReturn = getDes()->getDia()->doAppend( MYODBC_DIA_HY091, 0, NULL );
+            break;
 
         case SQL_DESC_LENGTH:
             /*!
@@ -182,7 +191,8 @@
       
                 APD: R/W
             */
-            MYODBCDbgReturn( setLength( (SQLUINTEGER)pValuePtr ) );
+            nReturn = setLength( (SQLUINTEGER)pValuePtr );
+            break;
 
         case SQL_DESC_LITERAL_PREFIX:
             /*!
@@ -214,7 +224,8 @@
       
                 APD: Unused
             */
-            MYODBCDbgReturn( getDes()->getDia()->doAppend( MYODBC_DIA_HY091, 0,
NULL ) );
+            nReturn = getDes()->getDia()->doAppend( MYODBC_DIA_HY091, 0, NULL );
+            break;
 
         case SQL_DESC_NUM_PREC_RADIX:
             /*!
@@ -238,10 +249,11 @@
                 SQLINTEGER n = (SQLINTEGER)pValuePtr;
 
                 if ( n != 0 && n != 2 && n != 10 )
-                    MYODBCDbgReturn( getDes()->getDia()->doAppend(
MYODBC_DIA_HY092, 0, NULL ) );
+                    nReturn = getDes()->getDia()->doAppend( MYODBC_DIA_HY092, 0,
NULL );
+                else
+                    nReturn = setNumPrecRadix( (SQLINTEGER)pValuePtr );
             }
-            
-            MYODBCDbgReturn( setNumPrecRadix( (SQLINTEGER)pValuePtr ) );
+            break;
 
         case SQL_DESC_OCTET_LENGTH:
             /*!
@@ -256,7 +268,8 @@
                 For APDs, this field is defined only for output or input/output 
                 parameters.
             */
-            MYODBCDbgReturn( setOctetLength( (SQLINTEGER)pValuePtr ) );
+            nReturn = setOctetLength( (SQLINTEGER)pValuePtr );
+            break;
 
         case SQL_DESC_OCTET_LENGTH_PTR:
             /*!
@@ -279,7 +292,8 @@
                 set to a value uniquely identifying the parameter to help the 
                 application determine which parameter is being requested.
             */
-            MYODBCDbgReturn( setOctetLengthPtr( (SQLINTEGER*)pValuePtr ) );
+            nReturn = setOctetLengthPtr( (SQLINTEGER*)pValuePtr );
+            break;
 
         case SQL_DESC_PARAMETER_TYPE:
             /*!
@@ -287,7 +301,8 @@
       
                 APD: Unused
             */
-            MYODBCDbgReturn( getDes()->getDia()->doAppend( MYODBC_DIA_HY091, 0,
NULL ) );
+            nReturn = getDes()->getDia()->doAppend( MYODBC_DIA_HY091, 0, NULL );
+            break;
 
         case SQL_DESC_PRECISION:
             /*!
@@ -306,7 +321,8 @@
                 SQL_TYPE_TIMESTAMP, or SQL_INTERVAL_SECOND data type. This field 
                 is undefined for all other data types.
             */
-            MYODBCDbgReturn( setPrecision( (SQLSMALLINT)pValuePtr ) );
+            nReturn = setPrecision( (SQLSMALLINT)pValuePtr );
+            break;
 
         case SQL_DESC_ROWVER:
             /*!
@@ -314,7 +330,8 @@
       
                 APD: Unused
             */
-            MYODBCDbgReturn( getDes()->getDia()->doAppend( MYODBC_DIA_HY091, 0,
NULL ) );
+            nReturn = getDes()->getDia()->doAppend( MYODBC_DIA_HY091, 0, NULL );
+            break;
 
         case SQL_DESC_SCALE:
             /*!
@@ -330,7 +347,8 @@
                 decimal and numeric data types. The field is undefined for all 
                 other data types.
             */
-            MYODBCDbgReturn( setScale( (SQLSMALLINT)pValuePtr ) );
+            nReturn = setScale( (SQLSMALLINT)pValuePtr );
+            break;
 
         case SQL_DESC_SCHEMA_NAME:
             /*!
@@ -350,7 +368,8 @@
       
                 APD: Unused
             */
-            MYODBCDbgReturn( getDes()->getDia()->doAppend( MYODBC_DIA_HY091, 0,
NULL ) );
+            nReturn = getDes()->getDia()->doAppend( MYODBC_DIA_HY091, 0, NULL );
+            break;
 
         case SQL_DESC_TYPE:
             /*!
@@ -358,7 +377,8 @@
       
                 APD: R/W
             */
-            MYODBCDbgReturn( setTypeC( (SQLSMALLINT)pValuePtr ) );
+            nReturn = setTypeC( (SQLSMALLINT)pValuePtr );
+            break;
 
         case SQL_DESC_TYPE_NAME:
             /*!
@@ -384,17 +404,24 @@
       
                 APD: Unused
             */
-            MYODBCDbgReturn( getDes()->getDia()->doAppend( MYODBC_DIA_HY091, 0,
NULL ) );
+            nReturn = getDes()->getDia()->doAppend( MYODBC_DIA_HY091, 0, NULL );
+            break;
+
+        default:
+            nReturn = getDes()->getDia()->doAppend( MYODBC_DIA_HY091, 0, NULL );
+            break;
     }   
 
-    MYODBCDbgReturn( getDes()->getDia()->doAppend( MYODBC_DIA_HY091, 0, NULL ) );
+    MYODBCDbgReturn( nReturn );
 }
 
 SQLRETURN MYODBCDesRecAPD::setConciseType( SQLSMALLINT nConciseType )
 {
     MYODBCDbgEnter();
 
-    MYODBCDbgReturn( setConciseTypeC( nConciseType ) );
+    SQLRETURN nReturn = setConciseTypeC( nConciseType );
+
+    MYODBCDbgReturn( nReturn );
 }
 
 

Modified: MYODBCDes/include/MYODBCDesRec.h
===================================================================
--- MYODBCDes/include/MYODBCDesRec.h	2006-01-31 09:47:34 UTC (rev 52)
+++ MYODBCDes/include/MYODBCDesRec.h	2006-01-31 22:38:03 UTC (rev 53)
@@ -73,12 +73,9 @@
     virtual SQLRETURN setUpdatable( SQLSMALLINT nUpdatable );
 
     /* getters */
+    virtual SQLRETURN   getDescRec( SQLWCHAR *pszName, SQLSMALLINT nBufferLength,
SQLSMALLINT *pnStringLengthPtr, SQLSMALLINT *pnTypePtr, SQLSMALLINT *pnSubTypePtr,
SQLINTEGER *pnLengthPtr, SQLSMALLINT *pnPrecisionPtr, SQLSMALLINT *pnScalePtr,
SQLSMALLINT *pnNullablePtr );
+    virtual SQLRETURN   getDescField( SQLSMALLINT nFieldIdentifier, SQLPOINTER pValuePtr,
SQLINTEGER nBufferLength, SQLINTEGER *pnStringLengthPtr );
 
-    /* ODBC validated */
-    virtual SQLRETURN getDescRec( SQLWCHAR *pszName, SQLSMALLINT nBufferLength,
SQLSMALLINT *pnStringLengthPtr, SQLSMALLINT *pnTypePtr, SQLSMALLINT *pnSubTypePtr,
SQLINTEGER *pnLengthPtr, SQLSMALLINT *pnPrecisionPtr, SQLSMALLINT *pnScalePtr,
SQLSMALLINT *pnNullablePtr );
-    virtual SQLRETURN getDescField( SQLSMALLINT nFieldIdentifier, SQLPOINTER pValuePtr,
SQLINTEGER nBufferLength, SQLINTEGER *pnStringLengthPtr );
-
-    /* record fields */
     virtual SQLINTEGER  getAutoUniqueValue();
     virtual QString     getBaseColumnName();
     virtual QString     getBaseTableName();

Thread
Connector/ODBC 5 commit: r53 - in MYODBCDes: MYODBCDesLib includepharvey31 Jan