CanonicalizePath() static private method

static private CanonicalizePath ( String path ) : String
path String
return String
Exemplo n.º 1
0
 public void AddExpressions(string str)
 {
     if (str == null)
     {
         throw new ArgumentNullException("str");
     }
     if (str.Length == 0)
     {
         return;
     }
     str = this.ProcessWholeString(str);
     this.m_expressions      = this.m_expressions != null ? this.m_expressions + StringExpressionSet.m_separators[0].ToString() + str : str;
     this.m_expressionsArray = (string[])null;
     string[] strArray = this.Split(str);
     if (this.m_list == null)
     {
         this.m_list = new ArrayList();
     }
     for (int index = 0; index < strArray.Length; ++index)
     {
         if (strArray[index] != null && !strArray[index].Equals(""))
         {
             string path   = this.ProcessSingleString(strArray[index]);
             int    length = path.IndexOf(char.MinValue);
             if (length != -1)
             {
                 path = path.Substring(0, length);
             }
             if (path != null && !path.Equals(""))
             {
                 if (this.m_throwOnRelative)
                 {
                     if (Path.IsRelative(path))
                     {
                         throw new ArgumentException(Environment.GetResourceString("Argument_AbsolutePathRequired"));
                     }
                     path = StringExpressionSet.CanonicalizePath(path);
                 }
                 this.m_list.Add((object)path);
             }
         }
     }
     this.Reduce();
 }
Exemplo n.º 2
0
        internal static ArrayList CreateListFromExpressions(string[] str, bool needFullPath)
        {
            if (str == null)
            {
                throw new ArgumentNullException("str");
            }
            ArrayList arrayList = new ArrayList();

            for (int index = 0; index < str.Length; ++index)
            {
                if (str[index] == null)
                {
                    throw new ArgumentNullException("str");
                }
                string str1 = StringExpressionSet.StaticProcessWholeString(str[index]);
                if (str1 != null && str1.Length != 0)
                {
                    string path   = StringExpressionSet.StaticProcessSingleString(str1);
                    int    length = path.IndexOf(char.MinValue);
                    if (length != -1)
                    {
                        path = path.Substring(0, length);
                    }
                    if (path != null && path.Length != 0)
                    {
                        if (Path.IsRelative(path))
                        {
                            throw new ArgumentException(Environment.GetResourceString("Argument_AbsolutePathRequired"));
                        }
                        string str2 = StringExpressionSet.CanonicalizePath(path, needFullPath);
                        arrayList.Add((object)str2);
                    }
                }
            }
            return(arrayList);
        }