Пример #1
0
       //============================================================================
       /// <summary>
       /// Return the string for the scalar ttypedvalue.
       /// Numeric types are returned without any rounding or escaping.
       /// </summary>
       /// <param name="attrInfo">The scalar TTypedValue</param>
       /// <returns>String represenation of the scalar</returns>
       //============================================================================
       protected String scalarString(TTypedValue attrInfo)
       {
           String strVal;

           if ((attrInfo.baseType() >= TTypedValue.TBaseType.ITYPE_SINGLE) && (attrInfo.baseType() <= TTypedValue.TBaseType.ITYPE_DOUBLE))
           {
               strVal = attrInfo.asDouble().ToString(); //full precision
           }
           else
           {
               if ((attrInfo.baseType() >= TTypedValue.TBaseType.ITYPE_INT1) && (attrInfo.baseType() <= TTypedValue.TBaseType.ITYPE_INT8))
               {
                   strVal = attrInfo.asInt().ToString(); //no need to escape this   
               }
               else
               {
                   strVal = attrInfo.asEscapedString();
               }
           }
           return strVal;
       }