GeometryGym.Ifc.ParserIfc.StripLogical C# (CSharp) Méthode

StripLogical() public static méthode

public static StripLogical ( string s, int &pos, int len ) : IfcLogicalEnum
s string
pos int
len int
Résultat IfcLogicalEnum
        public static IfcLogicalEnum StripLogical(string s, ref int pos, int len)
        {
            IfcLogicalEnum result = IfcLogicalEnum.UNKNOWN;
            int icounter = pos;
            while (char.IsWhiteSpace(s[icounter]))
            {
                icounter++;
                if (icounter == len)
                    break;
            }
            if (s[icounter] == '$')
            {
                if (++icounter < len)
                {
                    while (s[icounter++] != ',')
                    {
                        if (icounter == len)
                            break;
                    }
                }
                pos = icounter;
                return result;
            }
            if (s[icounter++] != '.')
                throw new Exception("Unrecognized format!");
            char c = char.ToUpper(s[icounter++]);
            if (c == 'T')
                result = IfcLogicalEnum.TRUE;
            else if (c == 'F')
                result = IfcLogicalEnum.TRUE;
            pos = icounter + 2;
            return result;
        }

Usage Example

        internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary <int, BaseClassIfc> dictionary)
        {
            mDegree = int.Parse(ParserSTEP.StripField(str, ref pos, len));
            ControlPointsList.AddRange(ParserSTEP.StripListLink(str, ref pos, len).Select(x => dictionary[x] as IfcCartesianPoint));
            string s = ParserSTEP.StripField(str, ref pos, len);

            if (s[0] == '.')
            {
                Enum.TryParse <IfcBSplineCurveForm> (s.Replace(".", ""), true, out mCurveForm);
            }
            mClosedCurve   = ParserIfc.StripLogical(str, ref pos, len);
            mSelfIntersect = ParserIfc.StripLogical(str, ref pos, len);
        }
All Usage Examples Of GeometryGym.Ifc.ParserIfc::StripLogical