Skip to content

Utils class

Represents different type conversion functions and other useful procedures

public static class Korzh.EasyQuery.Utils
TypeNameDescription
RegexMacroRegex
TypeNameDescription
StringInternalDateFormatGets the internal date format (yyyy-MM-dd).
StringInternalTimeFormatGets the internal time format (HH:mm:ss).
TypeNameDescription
BooleanAreCompatibleTypes(DataType type1, DataType type2)Returns true if type1 can be converted to type2.
StringComposeKey(String parent, String child)Composes the key (for attributes, entities, etc). Returns “parent.key” if both parent and key are not empty/null
BooleanContainsNonAscii(String s)Checks string for inclusion of non-ASCII symbols.
DataKindDataKindByName(String kindName)Gets the DataKind value by its text representation.
DataTypeDataTypeByName(String typeName)Returns DataType value by its string representation
StringDateTimeToInternalFormat(DateTime dt, DataType dataType)Converts DateTime value to its string representation in internal format (yyyy-MM-dd).
StringDateTimeToUserFormat(DateTime dt, DataType dataType)Converts DateTime value to its string representation in current system format.
StringFormatDateTimeValue(String val, String format, DataType dataType, Int32 timezoneOffset = 0)Formats the date time value.
CultureInfoGetCurrentCulture()Returns current culture
CultureInfoGetCurrentUICulture()Returns current UI culture
DataTypeGetDataTypeBySystemType(Type systemType)Gets the type of the data type by system type.
StringGetDateTimeInternalFormat(DataType dataType, Boolean shortTime = False)Gets the format used for internal textual representation of date/time values. EasyQuery uses “yyyy-MM-dd” format.
StringGetElementContentAsString(XmlReader reader)Reads the content of current XML element (as string)
IList<Int32>GetEnumValues(Type oEnumType)Gets all values of the enum.
IFormatProviderGetInternalFormatProvider()Gets the internal format provider. This provider defines the format used to store date/time and numeric values internally and it saved queries
DateTimeGetSpecialDateByName(String name, Boolean utc)
DateTimeGetSpecialDateByNameEx(String name, Boolean utc, DataType& dt)
DateTimeGetSpecialDateValue(SpecialDateTime sdt, Boolean utc)
DateTimeGetSpecialDateValueEx(SpecialDateTime sdt, Boolean utc, DataType& dt)
TypeGetSystemTypeByDataType(DataType type)Gets the system type by data type.
TypeGetSystemTypeByDataType(DataType dtype, Type defaultType)Gets the system type by data type.
DateTimeInternalFormatToDateTime(String val, DataType dataType)Convert string representation in internal format to DateTime value.
BooleanIsStrNullOrEmpty(String s)Determines whether specified string is null or empty.
BooleanMatchMacro(String s, String& macroName)
BooleanMoveToAttribute(XmlReader reader, String attrName)Moves current position of XmlReader into specified attribute.
DateTimeOldFormatToDateTime(String val)Convert string representation in old format to DateTime value.
BooleanSafeParseBool(String value, Boolean defValue = False)Converts the string representation of a boolean value. This method does not throw an exception. Instead - it returns some pre-defined value for unsuccessful conversions.
Int32SafeParseInt(String s, Int32 defValue = 0)Converts the string representation of a number to its 32-bit signed integer equivalent. This method does not throw an exception. Instead - it returns some pre-defined value for unsuccessful conversions.
StringStrToIdentifier(String s)Converts any string to an identifier (changes all symbols like ’.’ ’;’ ’?’ etc to ’_‘)
BooleanTextEq(String s1, String s2)Provides case-insensitive string comparision
BooleanTryGetSpecialDate(String macroName, Boolean useUtcTime, DateTime& dateVal, DataType& dt)