Menu

Commit [r499]  Maximize  Restore  History

Changed IsValidAbsoluteFileName private function in UFileProtocol.pas to use IsValidDriveLetter function from UUtils.pas.

delphidabbler 2009-11-07

changed /branches/delphi2010-port/Src/UFileProtocol.pas
/branches/delphi2010-port/Src/UFileProtocol.pas Diff Switch to side-by-side view
--- a/branches/delphi2010-port/Src/UFileProtocol.pas
+++ b/branches/delphi2010-port/Src/UFileProtocol.pas
@@ -197,11 +197,9 @@
       @return True if file name is valid absolute file path, false if not.
     }
   begin
-    Result := (Length(FileName) > 3) and
-      { TODO -cRefactor : Replace set test with a new UUtils.IsValidDriveLetter
-        function }
-      IsCharInSet(FileName[1], ['A'..'Z', 'a'..'z']) and
-      (FileName[2] = ':') and (FileName[3] = '\');
+    Result := (Length(FileName) > 3)
+      and IsValidDriveLetter(FileName[1])
+      and (FileName[2] = ':') and (FileName[3] = '\');
   end;
 
   function IsValidUNCFileName(const FileName: string): Boolean;
@@ -210,9 +208,9 @@
       @return True if file name is valid UNC name, false if not.
     }
   begin
-    Result := (Length(FileName) > 5) and
-      AnsiStartsStr('\\', FileName) and
-      (PosEx('\', FileName, 4) >= 4);
+    Result := (Length(FileName) > 5)
+      and AnsiStartsStr('\\', FileName)
+      and (PosEx('\', FileName, 4) >= 4);
   end;
   // ---------------------------------------------------------------------------
 
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.