/// <summary> /// Creates an IFCData object as IfcText. /// </summary> /// <param name="value">The string value.</param> /// <returns>The IFCData object.</returns> public static IFCData CreateAsText(string value) { if (value == null) { return(null); } return(IFCData.CreateStringOfType(value, "IfcText")); }
/// <summary> /// Creates an IFCData object as IfcIdentifier. /// </summary> /// <param name="value">The string value.</param> /// <returns>The IFCData object.</returns> public static IFCData CreateAsIdentifier(string value) { if (value == null) { return(null); } return(IFCData.CreateStringOfType(value.Length > 255 ? value.Remove(255) : value, "IfcIdentifier")); }
/// <summary> /// Creates an IFCData object as IfcLabel. /// </summary> /// <param name="value">The string value.</param> /// <returns>The IFCData object.</returns> public static IFCData CreateAsLabel(string value) { if (value == null) { return(null); } if (value.Length > IFCLimits.MAX_IFCLABEL_STR_LEN) { OnIFCStringTooLongWarn(value, IFCLimits.MAX_IFCLABEL_STR_LEN); value = value.Remove(IFCLimits.MAX_IFCLABEL_STR_LEN); } return(IFCData.CreateStringOfType(value, "IfcLabel")); }
/// <summary> /// Creates an IFCData object as IfcIdentifier. /// </summary> /// <param name="value">The string value.</param> /// <returns>The IFCData object.</returns> public static IFCData CreateAsIdentifier(string value) { if (value == null) { return(null); } if (value.Length > IFCLimits.MAX_IFCIDENTIFIER_STR_LEN) { OnIFCStringTooLongWarn(value, IFCLimits.MAX_IFCIDENTIFIER_STR_LEN); value = value.Remove(IFCLimits.MAX_IFCIDENTIFIER_STR_LEN); } return(IFCData.CreateStringOfType(value, "IfcIdentifier")); }
/// <summary> /// Creates an IFCData object as IfcLabel. /// </summary> /// <param name="value">The string value.</param> /// <returns>The IFCData object.</returns> public static IFCData CreateAsLabel(string value) { if (value == null) { return(null); } value = new string(value.Where(c => !char.IsControl(c)).ToArray()); if (value.Length > IFCLimits.MAX_IFCLABEL_STR_LEN) { OnIFCStringTooLongWarn(value, IFCLimits.MAX_IFCLABEL_STR_LEN); value = value.Remove(IFCLimits.MAX_IFCLABEL_STR_LEN); } return(IFCData.CreateStringOfType(value, "IfcLabel")); }
/// <summary> /// Creates an IFCData object as IfcText. /// </summary> /// <param name="value">The string value.</param> /// <returns>The IFCData object.</returns> public static IFCData CreateAsText(string value) { if (value == null) { return(null); } int maxStrLen = IFCLimits.CalculateMaxAllowedSize(value); if (value.Length > maxStrLen) { OnIFCStringTooLongWarn(value, maxStrLen); value = value.Remove(maxStrLen); } return(IFCData.CreateStringOfType(value, "IfcText")); }
/// <summary> /// Creates an IFCData object as IfcText. /// </summary> /// <param name="value">The string value.</param> /// <returns>The IFCData object.</returns> public static IFCData CreateAsText(string value) { if (value == null) { return(null); } value = new string(value.Where(c => !char.IsControl(c)).ToArray()); int maxStrLen = IFCLimits.CalculateMaxAllowedSize(value); if (value.Length > maxStrLen) { OnIFCStringTooLongWarn(value, maxStrLen); value = value.Remove(maxStrLen); } return(IFCData.CreateStringOfType(value, "IfcText")); }
/// <summary> /// Creates an IFCData object as IfcIdentifier. /// </summary> /// <param name="value">The string value.</param> /// <returns>The IFCData object.</returns> public static IFCData CreateAsIdentifier(string value) { return(IFCData.CreateStringOfType(value, "IfcIdentifier")); }
/// <summary> /// Creates an IFCData object as IfcLabel. /// </summary> /// <param name="value">The string value.</param> /// <returns>The IFCData object.</returns> public static IFCData CreateAsLabel(string value) { return(IFCData.CreateStringOfType(value, "IfcLabel")); }