protected override void Scan() { base.DriveLetter = Path.GetPathRoot(iFile.FullName); if (iFile.Exists) { using (StreamReader reader = new StreamReader(iFile.FullName)) { string line = reader.ReadLine(); // while (line != null) { Match m = KMapParserRegex.Match(line); if (m.Success) { string nameHost = base.CombineWithDriveLetter(m.Groups["Host]"].Value); string nameDevice = Path.Combine(KRomDriveFileLetter, m.Groups["Device"].Value); // CodeSegResolverEntry entry = new CodeSegResolverEntry(nameHost, nameDevice); // base.Add(entry); } // line = reader.ReadLine(); } } } }
public void Add(CodeSegResolverEntry aEntry) { lock ( iResolvedEntries ) { iResolvedEntries.Add(aEntry); } }
public void Remove(CodeSegResolverEntry aEntry) { lock ( iResolvedEntries ) { iResolvedEntries.Remove(aEntry); } }
protected void Add(CodeSegResolverEntry aEntry) { NotifyFile(aEntry.ImageFileNameAndPath); base.Trace("[{0}] device: {1}, host: {2}", this.GetType().Name, aEntry.ImageFileNameAndPath, aEntry.EnvironmentFileNameAndPath); // iResolver.Add(aEntry); }
public string ResolveByImageCodeSegmentFileName(string aFileName) { // See if the collection contains a suitable entry lock ( iResolvedEntries ) { string ret = string.Empty; CodeSegResolverEntry entry = iResolvedEntries.FindByCodeSegmentFileNameAndPath(aFileName.ToLower()); if (entry != null) { ret = entry.EnvironmentFileNameAndPath; } // return(ret); } }
public override bool Equals(object aObject) { bool isEqual = false; // if (aObject != null) { if (aObject is CodeSegResolverEntry) { CodeSegResolverEntry otherEntry = aObject as CodeSegResolverEntry; // isEqual = (otherEntry.ImageFileNameAndPathWithoutDrive.ToLower() == ImageFileNameAndPathWithoutDrive.ToLower()); } } // return(isEqual); }
protected override void Scan() { base.DriveLetter = Path.GetPathRoot(iFile.FullName); foreach (string binary in iBinaries) { string envFileName = binary; if (envFileName[0] == Path.DirectorySeparatorChar) { envFileName = envFileName.Substring(1); } envFileName = CombineWithDriveLetter(envFileName); string imageFileName = CodeSegResolver.KROMBinaryPath + Path.GetFileName(envFileName); // CodeSegResolverEntry entry = new CodeSegResolverEntry(envFileName, imageFileName); // base.Add(entry); } }
protected override void Scan() { base.DriveLetter = Path.GetPathRoot(iDirectory.FullName); if (iDirectory.Exists) { // Locate all the map files in the directory FileInfo[] fileInfoList = iDirectory.GetFiles("*" + CodeSegResolver.KMapFileExtension); foreach (FileInfo file in fileInfoList) { string pcFileName = file.FullName; // Remove .map extension in order to get back to the pure binary dll/exe/etc name. pcFileName = RemoveMapExtension(pcFileName); // Prepare phone binary name by merging the PC-side filename with Z:\Sys\Bin string phoneFileName = GeneratePhoneBinaryNameAndPath(pcFileName); // Make entry CodeSegResolverEntry entry = new CodeSegResolverEntry(pcFileName, phoneFileName); base.Add(entry); } } }