Ejemplo n.º 1
0
            public ScraperResults ScrapeConstants(
                string repoRoot,
                string arch,
                string[] enumJsonFiles,
                string constantsHeaderText,
                HashSet <string> exclusionNames,
                Dictionary <string, string> requiredNamespaces,
                Dictionary <string, string> remaps,
                Dictionary <string, string> withTypes,
                Dictionary <string, string> withAttributes)
            {
                this.requiredNamespaces  = new WildcardDictionary(requiredNamespaces);
                this.withTypes           = withTypes;
                this.exclusionNames      = exclusionNames;
                this.constantsHeaderText = constantsHeaderText;
                this.withAttributes      = withAttributes;

                this.repoRoot = Path.GetFullPath(repoRoot);
                this.arch     = arch;

                this.scannedNamesToNamespaces = ScraperUtils.GetNameToNamespaceMap(this.EmitterGeneratedDir);

                this.writtenConstants = ScraperUtils.GetConstants(this.EmitterDir);

                this.LoadEnumObjectsFromJsonFiles(enumJsonFiles);

                this.ScrapeConstantsFromTraversedFiles();

                this.WriteEnumsAndRemaps(remaps);

                return(new ScraperResults(this.output));
            }
Ejemplo n.º 2
0
            public ScraperResults ScrapeConstants(
                string[] enumJsonFiles,
                string defaultNamespace,
                string scraperOutputDir,
                string constantsHeaderText,
                HashSet <string> exclusionNames,
                Dictionary <string, string> traversedHeaderToNamespaceMap,
                Dictionary <string, string> requiredNamespaces,
                Dictionary <string, string> remaps,
                Dictionary <string, string> withTypes,
                Dictionary <string, string> withAttributes)
            {
                this.requiredNamespaces  = new WildcardDictionary(requiredNamespaces);
                this.withTypes           = withTypes;
                this.exclusionNames      = exclusionNames;
                this.constantsHeaderText = constantsHeaderText;
                this.withAttributes      = withAttributes;
                this.scraperOutputDir    = scraperOutputDir;
                this.defaultNamespace    = defaultNamespace;

                this.scannedNamesToNamespaces = ScraperUtils.GetNameToNamespaceMap(scraperOutputDir);

                this.writtenConstants = ScraperUtils.GetConstants(scraperOutputDir);

                this.CleanExistingFiles();

                this.LoadEnumObjectsFromJsonFiles(enumJsonFiles);

                this.ScrapeConstantsFromTraversedFiles(traversedHeaderToNamespaceMap);

                this.WriteEnumsAndRemaps(remaps);

                return(new ScraperResults(this.output));
            }