コード例 #1
0
        public Boolean ListIdentical(IncludeDirectoryList other)
        {
            using (IEnumerator <IncludeDirectory> enumeratorThis = this.GetEnumerator()) {
                using (IEnumerator <IncludeDirectory> enumeratorOther = other.GetEnumerator()) {
                    while (true)
                    {
                        Boolean thisSuccess  = enumeratorThis.MoveNext();
                        Boolean otherSuccess = enumeratorOther.MoveNext();
                        if (thisSuccess == false && otherSuccess == false)
                        {
                            return(true);
                        }

                        if (thisSuccess == false || otherSuccess == false)
                        {
                            return(false);
                        }

                        Debug.Assert(enumeratorThis.Current != null, "enumeratorThis.Current != null");
                        //if (!ReferenceEquals(enumeratorThis.Current, enumeratorOther.Current)) {
                        if (!enumeratorThis.Current.Equals(enumeratorOther.Current))
                        {
                            return(false);
                        }
                    }
                }
            }
        }
コード例 #2
0
        public Boolean ListIdenticalRelaxOrder(IncludeDirectoryList other)
        {
            // this is N^2, watch out
            List <IncludeDirectory> theirsList = new List <IncludeDirectory>(other);

            foreach (IncludeDirectory includeDirectory in this)
            {
                Boolean found = false;
                for (int i = 0; i < theirsList.Count; ++i)
                {
                    if (includeDirectory.Equals(theirsList[i]))
                    {
                        found = true;
                        theirsList.RemoveAt(i);
                        break;
                    }
                }

                if (!found)
                {
                    return(false);
                }
            }

            if (theirsList.Count != 0)
            {
                return(false);
            }

            return(true);
        }
コード例 #3
0
 public ProjectFile(Solution sln, AbsoluteCrosspath filePath, CompilerInstance compilerInstance)
 {
     CompilerOfFile     = compilerInstance;
     IncludeDirectories = new IncludeDirectoryList();
     DoNotUseStandardIncludeDirectories = false;
     Defines       = new Dictionary <String, Define>();
     SetOfDefines  = new HashSet <Define>(DefineExactComparer.Instance);
     ForceIncludes = new HashSet <AbsoluteCrosspath>();
     FilePath      = filePath;
     OwnerSolution = sln;
     if (sln.config.BaseDir != null)
     {
         ProjectFolder = RelativeCrosspath.CreateRelativePath(filePath, sln.config.BaseDir, true).ToContainingDirectory() as RelativeCrosspath;
     }
 }
コード例 #4
0
 public Project(Guid guid, Int64 projectHash, Solution ownerSolution, CompilerInstance compilerInstance, IncludeDirectoryList includeDirectories
                , HashSet <Define> defines, HashSet <AbsoluteCrosspath> forcedIncludes)
 {
     ProjectSerial    = nextProjectId++;
     Guid             = guid;
     ProjectHash      = projectHash;
     OwnerSolution    = ownerSolution;
     Name             = $"Project_{ProjectSerial:D4}";
     CompilerInstance = compilerInstance;
     // copy references
     IncludeDirectories = includeDirectories;
     Defines            = defines;
     ForcedIncludes     = forcedIncludes;
     // initialize an empty set
     ProjectFiles   = new HashSet <ProjectFile>();
     ProjectFilters = new HashSet <String>();
 }