Example #1
0
        // Token: 0x0600019F RID: 415 RVA: 0x00007578 File Offset: 0x00005778
        private bool IsQuotingRequired(MimeString mimeStr, bool allowUTF8)
        {
            AddressItem.WriteState writeState = AddressItem.WriteState.Begin;
            MimeString             mimeString = new MimeString(AddressItem.WordBreakBytes, 0, AddressItem.WordBreakBytes.Length);
            int num;
            int num2;

            byte[] data = mimeStr.GetData(out num, out num2);
            while (num2 != 0)
            {
                switch (writeState)
                {
                case AddressItem.WriteState.Begin:
                {
                    int num3 = 0;
                    int num4 = MimeScan.FindEndOf(MimeScan.Token.Atom, data, num, num2, out num3, allowUTF8);
                    if (num4 == 0)
                    {
                        if (num2 <= 3 || num != 0 || !mimeString.HasPrefixEq(data, 0, 3))
                        {
                            return(true);
                        }
                        num       += 3;
                        num2      -= 3;
                        writeState = AddressItem.WriteState.Begin;
                    }
                    else
                    {
                        num       += num4;
                        num2      -= num4;
                        writeState = AddressItem.WriteState.Atom;
                    }
                    break;
                }

                case AddressItem.WriteState.Atom:
                    if ((num2 < 2 || data[num] != 32) && (num2 < 1 || data[num] != 46))
                    {
                        return(true);
                    }
                    num++;
                    num2--;
                    writeState = AddressItem.WriteState.Begin;
                    break;
                }
            }
            return(false);
        }
        // Token: 0x06000325 RID: 805 RVA: 0x00011B14 File Offset: 0x0000FD14
        private static bool IsUUEncodeBegin(byte[] data, int line, int nextNL)
        {
            MimeString mimeString = new MimeString(data, line, nextNL - line);

            if (mimeString.Length < 13 || !mimeString.HasPrefixEq(MimeParser.UUBegin, 0, 6))
            {
                return(false);
            }
            int num = 6;

            while (num < 10 && 48 <= mimeString[num] && 55 >= mimeString[num])
            {
                num++;
            }
            return(num != 6 && 32 == mimeString[num]);
        }
        // Token: 0x06000326 RID: 806 RVA: 0x00011B84 File Offset: 0x0000FD84
        private static bool IsUUEncodeEnd(byte[] data, int line, int nextNL)
        {
            MimeString mimeString = new MimeString(data, line, nextNL - line);

            return(mimeString.Length >= 3 && mimeString.HasPrefixEq(MimeParser.UUEnd, 0, 3));
        }