IsEmpty() public method

public IsEmpty ( ) : bool
return bool
        public StringExpressionSet Intersect(StringExpressionSet ses)
        {
            if (this.IsEmpty() || ses == null || ses.IsEmpty())
            {
                return(this.CreateNewEmpty());
            }
            this.CheckList();
            ses.CheckList();
            StringExpressionSet newEmpty = this.CreateNewEmpty();

            for (int index1 = 0; index1 < this.m_list.Count; ++index1)
            {
                for (int index2 = 0; index2 < ses.m_list.Count; ++index2)
                {
                    if (this.StringSubsetString((string)this.m_list[index1], (string)ses.m_list[index2], this.m_ignoreCase))
                    {
                        if (newEmpty.m_list == null)
                        {
                            newEmpty.m_list = new ArrayList();
                        }
                        newEmpty.AddSingleExpressionNoDuplicates((string)this.m_list[index1]);
                    }
                    else if (this.StringSubsetString((string)ses.m_list[index2], (string)this.m_list[index1], this.m_ignoreCase))
                    {
                        if (newEmpty.m_list == null)
                        {
                            newEmpty.m_list = new ArrayList();
                        }
                        newEmpty.AddSingleExpressionNoDuplicates((string)ses.m_list[index2]);
                    }
                }
            }
            newEmpty.GenerateString();
            return(newEmpty);
        }
Example #2
0
        public StringExpressionSet Intersect(StringExpressionSet ses)
        {
            if (this.IsEmpty() || ses == null || ses.IsEmpty())
            {
                return(this.CreateNewEmpty());
            }
            this.CheckList();
            ses.CheckList();
            StringExpressionSet stringExpressionSet = this.CreateNewEmpty();

            for (int i = 0; i < this.m_list.Count; i++)
            {
                for (int j = 0; j < ses.m_list.Count; j++)
                {
                    if (this.StringSubsetString((string)this.m_list[i], (string)ses.m_list[j], this.m_ignoreCase))
                    {
                        if (stringExpressionSet.m_list == null)
                        {
                            stringExpressionSet.m_list = new ArrayList();
                        }
                        stringExpressionSet.AddSingleExpressionNoDuplicates((string)this.m_list[i]);
                    }
                    else if (this.StringSubsetString((string)ses.m_list[j], (string)this.m_list[i], this.m_ignoreCase))
                    {
                        if (stringExpressionSet.m_list == null)
                        {
                            stringExpressionSet.m_list = new ArrayList();
                        }
                        stringExpressionSet.AddSingleExpressionNoDuplicates((string)ses.m_list[j]);
                    }
                }
            }
            stringExpressionSet.GenerateString();
            return(stringExpressionSet);
        }
        [System.Security.SecurityCritical]  // auto-generated
        public StringExpressionSet Intersect(StringExpressionSet ses)
        {
            // If either set is empty, the intersection is empty

            if (this.IsEmpty() || ses == null || ses.IsEmpty())
            {
                return(CreateNewEmpty());
            }

            CheckList();
            ses.CheckList();

            // Do the intersection for real

            StringExpressionSet intersectSet = CreateNewEmpty();

            for (int this_index = 0; this_index < this.m_list.Count; ++this_index)
            {
                for (int ses_index = 0; ses_index < ses.m_list.Count; ++ses_index)
                {
                    if (StringSubsetString((String)this.m_list[this_index], (String)ses.m_list[ses_index], m_ignoreCase))
                    {
                        if (intersectSet.m_list == null)
                        {
                            intersectSet.m_list = new ArrayList();
                        }
                        intersectSet.AddSingleExpressionNoDuplicates((String)this.m_list[this_index]);
                    }
                    else if (StringSubsetString((String)ses.m_list[ses_index], (String)this.m_list[this_index], m_ignoreCase))
                    {
                        if (intersectSet.m_list == null)
                        {
                            intersectSet.m_list = new ArrayList();
                        }
                        intersectSet.AddSingleExpressionNoDuplicates((String)ses.m_list[ses_index]);
                    }
                }
            }

            intersectSet.GenerateString();

            return(intersectSet);
        }
Example #4
0
 public bool IsSubsetOfPathDiscovery(StringExpressionSet ses)
 {
     if (!this.IsEmpty())
     {
         if ((ses == null) || ses.IsEmpty())
         {
             return(false);
         }
         this.CheckList();
         ses.CheckList();
         for (int i = 0; i < this.m_list.Count; i++)
         {
             if (!StringSubsetStringExpressionPathDiscovery((string)this.m_list[i], ses, this.m_ignoreCase))
             {
                 return(false);
             }
         }
     }
     return(true);
 }
 public bool IsSubsetOfPathDiscovery(StringExpressionSet ses)
 {
     if (this.IsEmpty())
     {
         return(true);
     }
     if (ses == null || ses.IsEmpty())
     {
         return(false);
     }
     this.CheckList();
     ses.CheckList();
     for (int index = 0; index < this.m_list.Count; ++index)
     {
         if (!StringExpressionSet.StringSubsetStringExpressionPathDiscovery((string)this.m_list[index], ses, this.m_ignoreCase))
         {
             return(false);
         }
     }
     return(true);
 }
        [System.Security.SecurityCritical]  // auto-generated
        public StringExpressionSet Union(StringExpressionSet ses)
        {
            // If either set is empty, the union represents a copy of the other.

            if (ses == null || ses.IsEmpty())
            {
                return(this.Copy());
            }

            if (this.IsEmpty())
            {
                return(ses.Copy());
            }

            CheckList();
            ses.CheckList();

            // Perform the union
            // note: insert smaller set into bigger set to reduce needed comparisons

            StringExpressionSet bigger  = ses.m_list.Count > this.m_list.Count ? ses : this;
            StringExpressionSet smaller = ses.m_list.Count <= this.m_list.Count ? ses : this;

            StringExpressionSet unionSet = bigger.Copy();

            unionSet.Reduce();

            for (int index = 0; index < smaller.m_list.Count; ++index)
            {
                unionSet.AddSingleExpressionNoDuplicates((String)smaller.m_list[index]);
            }

            unionSet.GenerateString();

            return(unionSet);
        }
Example #7
0
        public StringExpressionSet Union(StringExpressionSet ses)
        {
            if (ses == null || ses.IsEmpty())
            {
                return(this.Copy());
            }
            if (this.IsEmpty())
            {
                return(ses.Copy());
            }
            this.CheckList();
            ses.CheckList();
            StringExpressionSet stringExpressionSet  = (ses.m_list.Count > this.m_list.Count) ? ses : this;
            StringExpressionSet stringExpressionSet2 = (ses.m_list.Count <= this.m_list.Count) ? ses : this;
            StringExpressionSet stringExpressionSet3 = stringExpressionSet.Copy();

            stringExpressionSet3.Reduce();
            for (int i = 0; i < stringExpressionSet2.m_list.Count; i++)
            {
                stringExpressionSet3.AddSingleExpressionNoDuplicates((string)stringExpressionSet2.m_list[i]);
            }
            stringExpressionSet3.GenerateString();
            return(stringExpressionSet3);
        }
Example #8
0
        public FileIOAccess Intersect( FileIOAccess operand )
        {
            if (operand == null)
            {
                return null;
            }
            
            Contract.Assert( this.m_pathDiscovery == operand.m_pathDiscovery, "Path discovery settings must match" );

            if (this.m_allFiles)
            {
                if (operand.m_allFiles)
                {
                    return new FileIOAccess( true, false, this.m_pathDiscovery );
                }
                else
                {
                    return new FileIOAccess( operand.m_set.Copy(), false, operand.m_allLocalFiles, this.m_pathDiscovery );
                }
            }
            else if (operand.m_allFiles)
            {
                return new FileIOAccess( this.m_set.Copy(), false, this.m_allLocalFiles, this.m_pathDiscovery );
            }

            StringExpressionSet intersectionSet = new StringExpressionSet( m_ignoreCase, true );

            if (this.m_allLocalFiles)
            {
                String[] expressions = operand.m_set.UnsafeToStringArray();
                
                if (expressions != null)
                {
                    for (int i = 0; i < expressions.Length; ++i)
                    {
                        String root = GetRoot( expressions[i] );
                        if (root != null && IsLocalDrive( GetRoot( root ) ) )
                        {
                            intersectionSet.AddExpressions( new String[] { expressions[i] }, true, false );
                        }
                    }
                }
            }

            if (operand.m_allLocalFiles)
            {
                String[] expressions = this.m_set.UnsafeToStringArray();

                if (expressions != null)
                {
                    for (int i = 0; i < expressions.Length; ++i)
                    {
                        String root = GetRoot( expressions[i] );
                        if (root != null && IsLocalDrive(GetRoot(root)))
                        {
                            intersectionSet.AddExpressions( new String[] { expressions[i] }, true, false );
                        }
                    }
                }
            }

            String[] regularIntersection = this.m_set.Intersect( operand.m_set ).UnsafeToStringArray();

            if (regularIntersection != null)
                intersectionSet.AddExpressions( regularIntersection, !intersectionSet.IsEmpty(), false );

            return new FileIOAccess( intersectionSet, false, this.m_allLocalFiles && operand.m_allLocalFiles, this.m_pathDiscovery );
        }
 [System.Security.SecurityCritical]  // auto-generated
 public StringExpressionSet Intersect( StringExpressionSet ses )
 {
     // If either set is empty, the intersection is empty
     
     if (this.IsEmpty() || ses == null || ses.IsEmpty())
         return CreateNewEmpty();
     
     CheckList();
     ses.CheckList();
     
     // Do the intersection for real
     
     StringExpressionSet intersectSet = CreateNewEmpty();
     
     for (int this_index = 0; this_index < this.m_list.Count; ++this_index)
     {
         for (int ses_index = 0; ses_index < ses.m_list.Count; ++ses_index)
         {
             if (StringSubsetString( (String)this.m_list[this_index], (String)ses.m_list[ses_index], m_ignoreCase ))
             {
                 if (intersectSet.m_list == null)
                 {
                     intersectSet.m_list = new ArrayList();
                 }
                 intersectSet.AddSingleExpressionNoDuplicates( (String)this.m_list[this_index] );
             }
             else if (StringSubsetString( (String)ses.m_list[ses_index], (String)this.m_list[this_index], m_ignoreCase ))
             {
                 if (intersectSet.m_list == null)
                 {
                     intersectSet.m_list = new ArrayList();
                 }
                 intersectSet.AddSingleExpressionNoDuplicates( (String)ses.m_list[ses_index] );
             }
         }
     }
     
     intersectSet.GenerateString();
     
     return intersectSet;
 }
     [System.Security.SecurityCritical]  // auto-generated
     public StringExpressionSet Union( StringExpressionSet ses )
     {
         // If either set is empty, the union represents a copy of the other.
         
         if (ses == null || ses.IsEmpty())
             return this.Copy();
 
         if (this.IsEmpty())
             return ses.Copy();
         
         CheckList();
         ses.CheckList();
         
         // Perform the union
         // note: insert smaller set into bigger set to reduce needed comparisons
         
         StringExpressionSet bigger = ses.m_list.Count > this.m_list.Count ? ses : this;
         StringExpressionSet smaller = ses.m_list.Count <= this.m_list.Count ? ses : this;
 
         StringExpressionSet unionSet = bigger.Copy();
         
         unionSet.Reduce();
         
         for (int index = 0; index < smaller.m_list.Count; ++index)
         {
             unionSet.AddSingleExpressionNoDuplicates( (String)smaller.m_list[index] );
         }
         
         unionSet.GenerateString();
         
         return unionSet;
     }
 [System.Security.SecurityCritical]  // auto-generated
 public bool IsSubsetOfPathDiscovery( StringExpressionSet ses )
 {
     if (this.IsEmpty())
         return true;
     
     if (ses == null || ses.IsEmpty())
         return false;
     
     CheckList();
     ses.CheckList();
     
     for (int index = 0; index < this.m_list.Count; ++index)
     {
         if (!StringSubsetStringExpressionPathDiscovery( (String)this.m_list[index], ses, m_ignoreCase ))
         {
             return false;
         }
     }
     return true;
 }
 public FileIOAccess Intersect(FileIOAccess operand)
 {
     if (operand == null)
     {
         return null;
     }
     if (this.m_allFiles)
     {
         if (operand.m_allFiles)
         {
             return new FileIOAccess(true, false, this.m_pathDiscovery);
         }
         return new FileIOAccess(operand.m_set.Copy(), false, operand.m_allLocalFiles, this.m_pathDiscovery);
     }
     if (operand.m_allFiles)
     {
         return new FileIOAccess(this.m_set.Copy(), false, this.m_allLocalFiles, this.m_pathDiscovery);
     }
     StringExpressionSet set = new StringExpressionSet(this.m_ignoreCase, true);
     if (this.m_allLocalFiles)
     {
         string[] strArray = operand.m_set.ToStringArray();
         if (strArray != null)
         {
             for (int i = 0; i < strArray.Length; i++)
             {
                 string root = GetRoot(strArray[i]);
                 if ((root != null) && IsLocalDrive(GetRoot(root)))
                 {
                     set.AddExpressions(new string[] { strArray[i] }, true, false);
                 }
             }
         }
     }
     if (operand.m_allLocalFiles)
     {
         string[] strArray2 = this.m_set.ToStringArray();
         if (strArray2 != null)
         {
             for (int j = 0; j < strArray2.Length; j++)
             {
                 string path = GetRoot(strArray2[j]);
                 if ((path != null) && IsLocalDrive(GetRoot(path)))
                 {
                     set.AddExpressions(new string[] { strArray2[j] }, true, false);
                 }
             }
         }
     }
     string[] strArray3 = this.m_set.Intersect(operand.m_set).ToStringArray();
     if (strArray3 != null)
     {
         set.AddExpressions(strArray3, !set.IsEmpty(), false);
     }
     return new FileIOAccess(set, false, this.m_allLocalFiles && operand.m_allLocalFiles, this.m_pathDiscovery);
 }
 public StringExpressionSet Union(StringExpressionSet ses)
 {
     if ((ses == null) || ses.IsEmpty())
     {
         return this.Copy();
     }
     if (this.IsEmpty())
     {
         return ses.Copy();
     }
     this.CheckList();
     ses.CheckList();
     StringExpressionSet set = (ses.m_list.Count > this.m_list.Count) ? ses : this;
     StringExpressionSet set2 = (ses.m_list.Count <= this.m_list.Count) ? ses : this;
     StringExpressionSet set3 = set.Copy();
     set3.Reduce();
     for (int i = 0; i < set2.m_list.Count; i++)
     {
         set3.AddSingleExpressionNoDuplicates((string) set2.m_list[i]);
     }
     set3.GenerateString();
     return set3;
 }
 public bool IsSubsetOfPathDiscovery(StringExpressionSet ses)
 {
     if (!this.IsEmpty())
     {
         if ((ses == null) || ses.IsEmpty())
         {
             return false;
         }
         this.CheckList();
         ses.CheckList();
         for (int i = 0; i < this.m_list.Count; i++)
         {
             if (!StringSubsetStringExpressionPathDiscovery((string) this.m_list[i], ses, this.m_ignoreCase))
             {
                 return false;
             }
         }
     }
     return true;
 }
 public StringExpressionSet Intersect(StringExpressionSet ses)
 {
     if ((this.IsEmpty() || (ses == null)) || ses.IsEmpty())
     {
         return this.CreateNewEmpty();
     }
     this.CheckList();
     ses.CheckList();
     StringExpressionSet set = this.CreateNewEmpty();
     for (int i = 0; i < this.m_list.Count; i++)
     {
         for (int j = 0; j < ses.m_list.Count; j++)
         {
             if (this.StringSubsetString((string) this.m_list[i], (string) ses.m_list[j], this.m_ignoreCase))
             {
                 if (set.m_list == null)
                 {
                     set.m_list = new ArrayList();
                 }
                 set.AddSingleExpressionNoDuplicates((string) this.m_list[i]);
             }
             else if (this.StringSubsetString((string) ses.m_list[j], (string) this.m_list[i], this.m_ignoreCase))
             {
                 if (set.m_list == null)
                 {
                     set.m_list = new ArrayList();
                 }
                 set.AddSingleExpressionNoDuplicates((string) ses.m_list[j]);
             }
         }
     }
     set.GenerateString();
     return set;
 }