OpenPetra
Free Administration Software for Non-Profits
|
a class for the storage of values in different representations; Conversion functions are provided. More...
Public Member Functions | |
TVariant (System.Object value) | |
constructor from any object More... | |
TVariant () | |
default constructor More... | |
TVariant (TVariant value) | |
copy constructor More... | |
TVariant (System.DateTime value, String AFormat) | |
constructor for dates More... | |
TVariant (System.DateTime value) | |
constructor for dates More... | |
TVariant (decimal value, String AFormat) | |
constructor for decimal More... | |
TVariant (decimal value) | |
constructor for decimal More... | |
TVariant (double value) | |
constructor for double (will be converted to decimal) More... | |
TVariant (char value) | |
constructor for single characters More... | |
TVariant (System.Int32 value) | |
constructor for integer More... | |
TVariant (System.Int64 value) | |
constructor for long integer More... | |
TVariant (String value, String AFormat) | |
constructor for string will look at the content of the string and generate a typed representation if you want to force a string value, use the other overloaded constructor below More... | |
TVariant (String value) | |
constructor for string More... | |
TVariant (String value, bool ExplicitString) | |
constructor for string if you want the content to be kept as a string, and not converted to int (e.g. cost centre: 0200) More... | |
TVariant (bool value) | |
constructor for boolean More... | |
void | Add (TVariant value, String AFormatString, Boolean AConcatenateStrings) |
This either adds the new value to an already existing composite (list of several values), or it changes the current non composite variable to be a composite, by adding the current value as the first member to the list, and then adding the new value; ToString will concatenate the values, but ToDecimal, ToBoolean etc will only convert the first value in the composite More... | |
void | Add (TVariant value, String AFormatString) |
overload for Add More... | |
void | Add (TVariant value) |
overload for Add More... | |
TVariant | FirstCompositeValue () |
returns the first value of the list, or an empty value, if the list is empty More... | |
String | EncodeToString () |
This function creates an encoded string, that holds the value and the type More... | |
void | Assign (TVariant value) |
copy the value to the current object instance More... | |
System.Object | ToObject () |
Convert TVariant to Object More... | |
System.Int32 | ToInt () |
convert to Integer More... | |
System.Int32 | ToInt32 () |
convert to Integer More... | |
System.Int64 | ToInt64 () |
convert to Integer More... | |
bool | ToBool () |
convert to Boolean More... | |
double | ToDouble () |
convert to Double More... | |
decimal | ToDecimal () |
convert to Decimal More... | |
ArrayList | ToComposite () |
convert to list of TVariant More... | |
String | ToJson () |
return the json representation of the value More... | |
override String | ToString () |
will call ToString(false), which means it will not print "NOTFOUND" for an empty value, for debugging call toString(true) More... | |
String | ToString (bool printNotFound) |
print to string More... | |
OdbcParameter | ToOdbcParameter (string AName) |
convert the value to an ODBC parameter More... | |
System.DateTime | ToDate () |
convert to Date More... | |
String | DateToString (String format) |
print date to string More... | |
String | ToFormattedString (String ACurrencyFormat, String AOutputType) |
Format the current value to be exported to CSV or to be printed with the local culture format settings (for currencies and dates); More... | |
String | ToFormattedString (String ACurrencyFormat) |
overload of ToFormattedString More... | |
String | ToFormattedString () |
overload of ToFormattedString More... | |
void | ApplyFormatString (String AFormatString) |
apply the string format to the current variable More... | |
bool | IsZeroOrNull () |
evaluate if the current value is zero or null More... | |
bool | IsNil () |
check if the value is empty More... | |
System.Int16 | CompareTo (TVariant v) |
System.Int16 | CompareToI (TVariant v) |
compare case insenstive More... | |
virtual void | GetObjectData (SerializationInfo info, StreamingContext ctx) |
serialize TVariant as a string. This helps to avoid problems with .net Remoting and DateTime More... | |
Static Public Member Functions | |
static string | StripDecimalAndZeros (string s) |
remove all trailing zeros, and the decimal point, if there are no decimals left More... | |
static TVariant | DecodeFromString (String encodedValue) |
This static function is used to create a variant with the correct type, when the variant is restored from an encoded string, that could e.g. be stored in a datatable (only strings) More... | |
Public Attributes | |
eVariantTypes | TypeVariant |
the type of the value stored in this instance More... | |
String | FormatString = "" |
for currencies and dayofyear (date) More... | |
Protected Member Functions | |
TVariant (SerializationInfo info, StreamingContext ctx) | |
serialize TVariant as a string. This helps to avoid problems with .net Remoting and DateTime More... | |
a class for the storage of values in different representations; Conversion functions are provided.
|
inline |
constructor from any object
value | any type of object |
|
inline |
default constructor
|
inline |
copy constructor
value |
|
inline |
constructor for dates
value | date time value |
AFormat | can be dayofyear (for birthdays) |
|
inline |
constructor for dates
value | date time value |
|
inline |
constructor for decimal
value | decimal value |
AFormat | requested format |
|
inline |
constructor for decimal
value | decimal value |
|
inline |
constructor for double (will be converted to decimal)
value | double value |
|
inline |
constructor for single characters
value | character value |
|
inline |
constructor for integer
value | integer value |
|
inline |
constructor for long integer
value | long integer value |
|
inline |
constructor for string will look at the content of the string and generate a typed representation if you want to force a string value, use the other overloaded constructor below
value | string value |
AFormat | requested format |
|
inline |
constructor for string
value | string value |
|
inline |
constructor for string if you want the content to be kept as a string, and not converted to int (e.g. cost centre: 0200)
value | |
ExplicitString |
|
inline |
constructor for boolean
value | boolean value |
|
inlineprotected |
|
inline |
overload for Add
value | value to be added |
|
inline |
overload for Add
value | value to be added |
AFormatString | requested format for the value |
|
inline |
This either adds the new value to an already existing composite (list of several values), or it changes the current non composite variable to be a composite, by adding the current value as the first member to the list, and then adding the new value; ToString will concatenate the values, but ToDecimal, ToBoolean etc will only convert the first value in the composite
|
inline |
apply the string format to the current variable
AFormatString | format to be used |
|
inline |
copy the value to the current object instance
value | value to be copied |
|
inline |
|
inline |
compare case insenstive
v |
|
inline |
print date to string
format | the requested format to be used |
|
inlinestatic |
This static function is used to create a variant with the correct type, when the variant is restored from an encoded string, that could e.g. be stored in a datatable (only strings)
|
inline |
This function creates an encoded string, that holds the value and the type
|
inline |
returns the first value of the list, or an empty value, if the list is empty
|
inlinevirtual |
|
inline |
check if the value is empty
|
inline |
evaluate if the current value is zero or null
|
inlinestatic |
remove all trailing zeros, and the decimal point, if there are no decimals left
s |
|
inline |
convert to Boolean
|
inline |
|
inline |
convert to Date
|
inline |
convert to Decimal
|
inline |
convert to Double
|
inline |
overload of ToFormattedString
|
inline |
overload of ToFormattedString
ACurrencyFormat | format to use |
|
inline |
Format the current value to be exported to CSV or to be printed with the local culture format settings (for currencies and dates);
ACurrencyFormat | CurrencyThousands or CurrencyWithoutDecimals |
AOutputType | Localized or CSV |
|
inline |
convert to Integer
|
inline |
convert to Integer
|
inline |
convert to Integer
|
inline |
return the json representation of the value
|
inline |
|
inline |
convert the value to an ODBC parameter
|
inline |
will call ToString(false), which means it will not print "NOTFOUND" for an empty value, for debugging call toString(true)
|
inline |
print to string
printNotFound | print something so that it is clear that the value was invalid |
String Ict.Common.TVariant.FormatString = "" |
for currencies and dayofyear (date)
eVariantTypes Ict.Common.TVariant.TypeVariant |
the type of the value stored in this instance