Namespace: Consultingwerk.Util
Class 
DataTypeHelper Copy to Clipboard
Parent classes:
Inherits: Progress.Lang.Object

File:DataTypeHelper
Syntax:Static methods only, private constructor to disallow
instance creation
Author(s):Mike Fechner / Consultingwerk Ltd.
Created:Wed Dec 01 16:49:22 CET 2010
Notes:This file is intended for GUI for .NET only



Top Method Summary
Options Name Purpose
+ CHARACTER ByteArrayToCharacter (Byte[]) Converts a .NET System.Byte[] into an ABL Character value
+ MEMPTR ByteArrayToMemptr (Byte[]) Converts a .NET Byte[] to an ABL MEMPTR
+ System.Byte[] CharacterToByteArray (character) Converts an ABL Charcater value into a .NET System.Byte[]
+ System.Byte[] CharacterToByteArray (longchar) Converts an ABL Longchar value into a .NET System.Byte[]
+ CHARACTER DefaultFormat (character) Returns the ABL Default Format for the given data type
+ CHARACTER DefaultXmlSchemaType (character) Returns the XML default data-type for the given ABL data type
+ LOGICAL FromDefaultableBoolean (DefaultableBoolean) Converts a Infragistics DefaultableBoolean to a Progress LOGICAL
+ LOGICAL IsAblDataType (character) Returns true when the passed in data type name is an ABL primitive type
+ System.Byte[] MemptrToByteArray (memptr) Converts (copies) a Progress MEMPTR to a .NET System.Byte[]
+ System.Drawing.Image MemPtrToImage (memptr) Converts a Progress MEMPTR (or a BLOB Image to a System.Drawing.Image)
+ CHARACTER ToAblDataType (DataType) Converts a Progress.Data.DataType Enum member to the corresponding ABL DataType in a Character representation
+ CHARACTER ToAblDataType (Type) Converts a System.Type to the corresponding ABL DataType in a Character representation
+ DATE ToDate (character) Returns an DATE value from a CHARACTER value
+ DATETIME ToDateTime (character) Returns an DATETIME value from a CHARACTER value
+ DATETIME-TZ ToDateTimeTz (character) Returns an DATETIME value from a CHARACTER value
+ DECIMAL ToDecimal (character) Returns an DECIMAL value from a CHARACTER value
+ Infragistics.Win.DefaultableBoolean ToDefaultableBoolean (logical) Converts a Progress LOGICAL into an Infragistics DefaultableBoolean
+ Progress.Data.DataType ToEnum (character) Returns the Progress.Data.DataType Enum member matching a Progress DATA-TYPE
+ INT64 ToInt64 (character) Returns an INT64 value from a CHARACTER value
+ INTEGER ToInteger (character) Returns an INTEGER value from a CHARACTER value
+ LOGICAL ToLogical (character) Converts common string representations to a logical value (true/false/?)
+ System.Object ToSystemObject (character, character) Convers an primitive value (in an ABL Character) into a .NET System.Object
+ System.Type ToSystemType (character) Returns the System.Typematching a Progress DATA-TYPE
+ CHARACTER UnabbreviateDataTypeName (character) Returns the unabbreviated ABL Data Type Name

Top Constructor Summary
Options Name Purpose
# DataTypeHelper () Disallow instance creation


Method Detail
Top

PUBLIC CHARACTER ByteArrayToCharacter (Byte[])

Purpose: Converts a .NET System.Byte[] into an ABL Character value
Notes:

Parameters:
poBytes System.Byte[]
The System.Bytes[] to convert
Returns CHARACTER
The resulting ABL Character value
Top

PUBLIC MEMPTR ByteArrayToMemptr (Byte[])

Purpose: Converts a .NET Byte[] to an ABL MEMPTR
Notes:

Parameters:
poBytes System.Byte[]
The System.Byte[] to convert to a MEMPTR
Returns MEMPTR
The new MEMPTR with the data from the Byte[]
Top

PUBLIC System.Byte[] CharacterToByteArray (character)

Purpose: Converts an ABL Charcater value into a .NET System.Byte[]
Notes:

Parameters:
pcValue CHARACTER
The Character value to convert
Returns System.Byte[]
The resulting System.Byte[]
Top

PUBLIC System.Byte[] CharacterToByteArray (longchar)

Purpose: Converts an ABL Longchar value into a .NET System.Byte[]
Notes:

Parameters:
pcValue LONGCHAR
The Character value to convert
Returns System.Byte[]
The resulting System.Byte[]
Top

PUBLIC CHARACTER DefaultFormat (character)

Purpose: Returns the ABL Default Format for the given data type
Notes: Creates a single field temp-table and returns the format of the field

Parameters:
pcDataType CHARACTER
The ABL DataType
Returns CHARACTER
The default format for the data type
Top

PUBLIC CHARACTER DefaultXmlSchemaType (character)

Purpose: Returns the XML default data-type for the given ABL data type
Notes: Creates a single field temp-table and returns the XML-DATA-TYPE of the field

Parameters:
pcDataType CHARACTER
The ABL DataType
Returns CHARACTER
The default XML data type for the data type
Top

PUBLIC LOGICAL FromDefaultableBoolean (DefaultableBoolean)

Purpose: Converts a Infragistics DefaultableBoolean to a Progress LOGICAL
Notes: Maps DefaultableBoolean:Default to ?

Parameters:
poValue Infragistics.Win.DefaultableBoolean
The DefaultableBoolean value to convert to LOGICAL
Returns LOGICAL
The equivalent LOGICAL value
Top

PUBLIC LOGICAL IsAblDataType (character)

Purpose: Returns true when the passed in data type name is an ABL primitive type
Notes:

Parameters:
pcDataType CHARACTER
An Character value that should be tested for a valid ABL data type
Returns LOGICAL
True when the passed in data type name is an ABL primitive type
Top

PUBLIC System.Byte[] MemptrToByteArray (memptr)

Purpose: Converts (copies) a Progress MEMPTR to a .NET System.Byte[]
Notes:

Parameters:
pmptr MEMPTR
The ABL MEMPTR containing the source data
Returns System.Byte[]
A .NET System.Byte[] containing the same data
Top

PUBLIC System.Drawing.Image MemPtrToImage (memptr)

Purpose: Converts a Progress MEMPTR (or a BLOB Image to a System.Drawing.Image)
Notes: The caller is responsible for cleaning up the MEMPTR (SET-SIZE () = 0)
Orignal source code from http://knowledgebase.progress.com/articles/Article/P145740

Parameters:
pmPtr MEMPTR
The data to be converted to the Image
Returns System.Drawing.Image
The System.Drawing.Image from the data in the MEMPTR
Top

PUBLIC CHARACTER ToAblDataType (DataType)

Purpose: Converts a Progress.Data.DataType Enum member to the corresponding
ABL DataType in a Character representation
Notes:

Parameters:
poType Progress.Data.DataType
The Progress.Data.DataType to convert into an ABL DataType
Returns CHARACTER
The ABL DataType as a CHARACTER Value
Top

PUBLIC CHARACTER ToAblDataType (Type)

Purpose: Converts a System.Type to the corresponding ABL DataType in a Character
representation
Notes: Assumes CHARACTER for System.String, not LONGCHAR or BLOB
Returns BLOB for System.Byte[]

Parameters:
poType System.Type
The System.Type to convert into an ABL DataType
Returns CHARACTER
The ABL DataType as a CHARACTER Value
Top

PUBLIC DATE ToDate (character)

Purpose: Returns an DATE value from a CHARACTER value
Notes: Does return ? on invalid value

Parameters:
pcString CHARACTER
The string value
Returns DATE
The date time value
Top

PUBLIC DATETIME ToDateTime (character)

Purpose: Returns an DATETIME value from a CHARACTER value
Notes: Does return ? on invalid value

Parameters:
pcString CHARACTER
The string value
Returns DATETIME
The date time value
Top

PUBLIC DATETIME-TZ ToDateTimeTz (character)

Purpose: Returns an DATETIME value from a CHARACTER value
Notes: Does return ? on invalid value

Parameters:
pcString CHARACTER
The string value
Returns DATETIME-TZ
The date time tz value
Top

PUBLIC DECIMAL ToDecimal (character)

Purpose: Returns an DECIMAL value from a CHARACTER value
Notes: Does return ? on invalid value

Parameters:
pcString CHARACTER
The string value
Returns DECIMAL
The integer value
Top

PUBLIC Infragistics.Win.DefaultableBoolean ToDefaultableBoolean (logical)

Purpose: Converts a Progress LOGICAL into an Infragistics DefaultableBoolean
Notes: Maps ? to DefaultableBoolean:Default

Parameters:
plValue LOGICAL
The LOGICAL value to convert to DefaultableBoolean
Returns Infragistics.Win.DefaultableBoolean
The equivalent Infragistics.Win.DefaultableBoolean enum value
Top

PUBLIC Progress.Data.DataType ToEnum (character)

Purpose: Returns the Progress.Data.DataType Enum member matching a Progress
DATA-TYPE
Notes:

Parameters:
pcDataType CHARACTER
The ABL DataType to convert from
Returns Progress.Data.DataType
The Progress.Data.DataType Value
Top

PUBLIC INT64 ToInt64 (character)

Purpose: Returns an INT64 value from a CHARACTER value
Notes: Does return ? on invalid value

Parameters:
pcString CHARACTER
The string value
Returns INT64
The int64 value
Top

PUBLIC INTEGER ToInteger (character)

Purpose: Returns an INTEGER value from a CHARACTER value
Notes: Does return ? on invalid value

Parameters:
pcString CHARACTER
The string value
Returns INTEGER
The integer value
Top

PUBLIC LOGICAL ToLogical (character)

Purpose: Converts common string representations to a logical value (true/false/?)
Notes: Supported input values for TRUE: TRUE, YES, 1, JA, WAHR, +
Supported input values for FALSE: FALSE, NO, 0, NEIN, FALSCH, -

Parameters:
pcValue CHARACTER
The CHARACTER expression to parse
Returns LOGICAL
The equivalent LOGICAL value
Top

PUBLIC System.Object ToSystemObject (character, character)

Purpose: Convers an primitive value (in an ABL Character) into a .NET
System.Object
Notes: Supports CHARACTER, DATE, DECIMAL, INTEGER, INT64, LOGICAL

Parameters:
pcValue CHARACTER
The ABL Value to convert
pcDataType CHARACTER
The ABL Primitive Data Type
Returns System.Object
The .NET System.Object
Top

PUBLIC System.Type ToSystemType (character)

Purpose: Returns the System.Typematching a Progress DATA-TYPE
Notes:

Parameters:
pcDataType CHARACTER
The ABL DataType to convert from
Returns System.Type
The System.Type reference
Top

PUBLIC CHARACTER UnabbreviateDataTypeName (character)

Purpose: Returns the unabbreviated ABL Data Type Name
Notes: Returns ? when the data type name is not an unabbreviated ABL data
type name

Parameters:
pcDataType CHARACTER
The potentially abbreviated data type name
Returns CHARACTER
The unabbreviated data type name or ? when the data type is not a valid abbreviation of an ABL data type name


Constructor Detail
Top

PROTECTED DataTypeHelper ()

Purpose: Disallow instance creation
Notes:



©2006-2016 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       26.08.2016 08:46:20