Joshi.Utils.Imap.Imap.ParseLanguage C# (CSharp) 메소드

ParseLanguage() 개인적인 메소드

Parse the language or list of languages in body structure
private ParseLanguage ( string &sBodyStruct, string &sString ) : bool
sBodyStruct string Bosy structure
sString string Languages
리턴 bool
        bool ParseLanguage(ref string sBodyStruct, ref string sString)
        {
            sString = "";

            // remove any spaces at the beginning and the end
            sBodyStruct = sBodyStruct.Trim();

            if (sBodyStruct[0] == '(')
            { // Language list

                // remove the opening paranthesis
                if (!FindAndRemove( ref sBodyStruct, '('))
                    return false;

                // TO DO
                // Logic for parsing language list is not yet
                // written. To be added in the future.

                // remove the closing paranthesis
                if (!FindAndRemove( ref sBodyStruct, ')'))
                    return false;
            }
            else
            { // One or no language

                if (!ParseQuotedString(ref sBodyStruct, ref sString))
                {
                    Log(LogTypeEnum.ERROR, "Failed getting Content Language.");
                    return false;
                }
            }

            return true;
        }