public static PlatformFileName New(PlatformFileName aCopy) { PlatformFileName ret = new PlatformFileName(); ret.FileNameInDevice = aCopy.FileNameInDevice; ret.FileNameInHost = aCopy.FileNameInHost; return(ret); }
public static PlatformFileName NewByDeviceName(string aFileName) { PlatformFileName ret = new PlatformFileName(); ret.FileNameInDevice = aFileName; // Seed the device file name based upon the host info string justFileName = Path.GetFileName(ret.FileNameInDevice); ret.FileNameInHost = Path.Combine(PlatformFileNameConstants.Host.KPathEpoc32ReleaseArmv5Urel, justFileName); return(ret); }
public static PlatformFileName NewByHostName(string aFileName) { PlatformFileName ret = new PlatformFileName(); ret.FileNameInHost = aFileName; // Seed the device file name based upon the host info string justFileName = Path.GetFileName(aFileName); ret.FileNameInDevice = Path.Combine(PlatformFileNameConstants.Device.KPathWildcardSysBin, justFileName); return(ret); }
public override bool Equals(object aObject) { bool ret = false; // if (aObject is PlatformFileName) { PlatformFileName other = (PlatformFileName)aObject; // These are the strings we'll compare - we'll assume exact comparison // required by default... string pathHostThis = this.FileNameInHost; string pathHostOther = other.FileNameInHost; string pathDeviceThis = this.FileNameInDevice; string pathDeviceOther = other.FileNameInDevice; // We must find out if this object (or aObject) contains a wildcard. if (this.ContainsWildcard || other.ContainsWildcard) { // Compare just the in-device paths, not the drives, since one or // other of the drive letters is unknown. pathDeviceThis = this.FileNameInDeviceWithoutRoot; pathDeviceOther = other.FileNameInDeviceWithoutRoot; } // Now we can compare the two... bool sameDevice = string.Compare(pathDeviceThis, pathDeviceOther, StringComparison.CurrentCultureIgnoreCase) == 0; bool sameHost = string.Compare(pathHostThis, pathHostOther, StringComparison.CurrentCultureIgnoreCase) == 0; // ret = (sameDevice || sameHost); } else { ret = base.Equals(aObject); } // return(ret); }