You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by gw...@apache.org on 2007/02/09 18:21:41 UTC

svn commit: r505382 - in /incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo: DataTypeInfo.h SDODataConverter.cpp SDODataConverter.h

Author: gwinn
Date: Fri Feb  9 09:21:40 2007
New Revision: 505382

URL: http://svn.apache.org/viewvc?view=rev&rev=505382
Log:
TUSCANY-1103

Modified:
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataTypeInfo.h
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDODataConverter.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDODataConverter.h

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataTypeInfo.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataTypeInfo.h?view=diff&rev=505382&r1=505381&r2=505382
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataTypeInfo.h (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataTypeInfo.h Fri Feb  9 09:21:40 2007
@@ -126,13 +126,6 @@
 
             static const SDOString& convertTypeEnumToString(TrueDataType dataType);
 
-            // We sometimes need to convert primitive data types into an
-            // equivalent string representation and for that we need a
-            // temporary buffer. Rather than fret too much about how big each
-            // one can be we choose a size that should be adequate for any of them
-
-            static const int MAX_TRANSIENT_SIZE = 48;
-
          private:
             // Array of text strings that correspond to TrueDataType enumeration values
             static SDO_API const SDOString rawTypeNames[];

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDODataConverter.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDODataConverter.cpp?view=diff&rev=505382&r1=505381&r2=505382
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDODataConverter.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDODataConverter.cpp Fri Feb  9 09:21:40 2007
@@ -34,6 +34,8 @@
    namespace sdo
    {
 
+      const int SDODataConverter::MAX_TRANSIENT_SIZE = 48;
+
       const bool SDODataConverter::convertToBoolean(const DataTypeInfo::SDODataTypeUnion& sourceValue,
                                                     const DataTypeInfo::TrueDataType& dataType)
       {
@@ -137,7 +139,7 @@
 
             case DataTypeInfo::TDTWideString:
             {
-               // char tmpstr[DataTypeInfo::MAX_TRANSIENT_SIZE];
+               // char tmpstr[SDODataConverter::MAX_TRANSIENT_SIZE];
                char* tmpstr = new char[sourceValue.WideString.length + 1];
                for (unsigned int j = 0; j < sourceValue.WideString.length; j++)
                {
@@ -601,7 +603,7 @@
       SDOString* SDODataConverter::convertToSDOString(const DataTypeInfo::SDODataTypeUnion& sourceValue,
                                                       const DataTypeInfo::TrueDataType& dataType)
       {
-         char buffer[DataTypeInfo::MAX_TRANSIENT_SIZE];
+         char buffer[SDODataConverter::MAX_TRANSIENT_SIZE];
          buffer[0] = 0;
 
          switch (dataType)
@@ -752,7 +754,7 @@
 
             case DataTypeInfo::TDTshort:
             {
-               char tmpstr[DataTypeInfo::MAX_TRANSIENT_SIZE];
+               char tmpstr[SDODataConverter::MAX_TRANSIENT_SIZE];
                unsigned int j = 0;
 
                sprintf(tmpstr, "%ld", sourceValue.Short);
@@ -770,7 +772,7 @@
             }
             case DataTypeInfo::TDTlong:
             {
-               char tmpstr[DataTypeInfo::MAX_TRANSIENT_SIZE];
+               char tmpstr[SDODataConverter::MAX_TRANSIENT_SIZE];
                unsigned int j = 0;
                
                sprintf(tmpstr, "%ld", sourceValue.Integer);
@@ -788,7 +790,7 @@
             }
             case DataTypeInfo::TDTint64_t:
             {
-               char tmpstr[DataTypeInfo::MAX_TRANSIENT_SIZE];
+               char tmpstr[SDODataConverter::MAX_TRANSIENT_SIZE];
                unsigned int j = 0;
                
                sprintf(tmpstr, "%lld", sourceValue.Int64);
@@ -806,7 +808,7 @@
             }
             case DataTypeInfo::TDTfloat:
             {
-               char tmpstr[DataTypeInfo::MAX_TRANSIENT_SIZE];
+               char tmpstr[SDODataConverter::MAX_TRANSIENT_SIZE];
                unsigned int j = 0;
                
                sprintf(tmpstr, "%.3e", sourceValue.Float);
@@ -824,7 +826,7 @@
             }
             case DataTypeInfo::TDTdouble:
             {
-               char tmpstr[DataTypeInfo::MAX_TRANSIENT_SIZE];
+               char tmpstr[SDODataConverter::MAX_TRANSIENT_SIZE];
                unsigned int j = 0;
                
                sprintf(tmpstr, "%.3Le", sourceValue.Double);
@@ -973,7 +975,7 @@
 
             case DataTypeInfo::TDTshort:
             {
-               char tmpstr[DataTypeInfo::MAX_TRANSIENT_SIZE];
+               char tmpstr[SDODataConverter::MAX_TRANSIENT_SIZE];
                unsigned int j = 0;
                
                sprintf(tmpstr, "%ld", sourceValue.Short);
@@ -991,7 +993,7 @@
 
             case DataTypeInfo::TDTlong:
             {
-               char tmpstr[DataTypeInfo::MAX_TRANSIENT_SIZE];
+               char tmpstr[SDODataConverter::MAX_TRANSIENT_SIZE];
                unsigned int j = 0;
                
                sprintf(tmpstr, "%ld", sourceValue.Integer);
@@ -1009,7 +1011,7 @@
 
             case DataTypeInfo::TDTint64_t:
             {
-               char tmpstr[DataTypeInfo::MAX_TRANSIENT_SIZE];
+               char tmpstr[SDODataConverter::MAX_TRANSIENT_SIZE];
                unsigned int j = 0;
                
                sprintf(tmpstr, "%lld", sourceValue.Integer);
@@ -1027,7 +1029,7 @@
 
             case DataTypeInfo::TDTfloat:
             {
-               char tmpstr[DataTypeInfo::MAX_TRANSIENT_SIZE];
+               char tmpstr[SDODataConverter::MAX_TRANSIENT_SIZE];
                unsigned int j = 0;
                
                sprintf(tmpstr, "%.3e", sourceValue.Float);
@@ -1045,7 +1047,7 @@
 
             case DataTypeInfo::TDTdouble:
             {
-               char tmpstr[DataTypeInfo::MAX_TRANSIENT_SIZE];
+               char tmpstr[SDODataConverter::MAX_TRANSIENT_SIZE];
                unsigned int j = 0;
                
                sprintf(tmpstr, "%.3Le", sourceValue.Double);

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDODataConverter.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDODataConverter.h?view=diff&rev=505382&r1=505381&r2=505382
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDODataConverter.h (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDODataConverter.h Fri Feb  9 09:21:40 2007
@@ -69,6 +69,13 @@
                                                 const DataTypeInfo::TrueDataType& dataType,
                                                 wchar_t* outptr,
                                                 unsigned int max_length);
+         private:
+            // We sometimes need to convert primitive data types into an
+            // equivalent string representation and for that we need a
+            // temporary buffer. Rather than fret too much about how big each
+            // one can be we choose a size that should be adequate for any of them
+
+            static const int MAX_TRANSIENT_SIZE;
       };
    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org