Example #1
0
        private void SourceFileReadCallback(Parser.Model.SourceFile arg)
        {
            SourceFile sourceFile = GetSourceFile(arg.InternalId);

            if (sourceFile == null)
            {
                AddSourceFile(new SourceFile {
                    InternalId = arg.InternalId, Name = arg.Path
                });
            }
            else
            {
                sourceFile.Name = arg.Path;
            }
        }
        internal ulong GetSourceFileId(string name)
        {
            foreach (var item in SourceFiles)
            {
                if (item.Value.Name == name)
                {
                    return(item.Value.InternalId);
                }
            }

            var result     = (ulong)SourceFiles.Count;
            var sourceFile = new SourceFile {
                InternalId = result, Name = name
            };

            SourceFiles.Add(result, sourceFile);
            WriteSourceFileAdded(sourceFile);
            return(result);
        }
 private void WriteSourceFileAdded(SourceFile sourceFile)
 {
     Output.WriteLine("fil src 0x{0:X8} \"{1}\"", sourceFile.InternalId, sourceFile.Name);
 }
Example #4
0
 private void AddSourceFile(SourceFile sourceFile)
 {
     AddToDictionary(SourceFiles, sourceFile);
 }