From 159d46f219ff126e97da2429675153b436fc8daa Mon Sep 17 00:00:00 2001 From: Daly Brown <47283601+dalybrown@users.noreply.github.com> Date: Tue, 23 Jan 2024 04:36:35 -0500 Subject: [PATCH] Move To_Portable to body and make it a regular function (#1541) --- src/alire/alire-vfs.adb | 19 +++++++++++++++++-- src/alire/alire-vfs.ads | 9 --------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/alire/alire-vfs.adb b/src/alire/alire-vfs.adb index 4dd2294a..2fb2e3b6 100644 --- a/src/alire/alire-vfs.adb +++ b/src/alire/alire-vfs.adb @@ -11,8 +11,8 @@ package body Alire.VFS is return String is Relative : constant Any_Path := - Directories.Find_Relative_Path (Parent => From, - Child => Path); + Directories.Find_Relative_Path (Parent => From, + Child => Path); begin if Check_Absolute_Path (Relative) then return Path; @@ -21,6 +21,21 @@ package body Alire.VFS is end if; end Attempt_Portable; + ----------------- + -- To_Portable -- + ----------------- + + function To_Portable (Path : Relative_Path) return Portable_Path + is + begin + case GNATCOLL.OS.Constants.OS is + when MacOS | Unix => + return Portable_Path (Path); + when Windows => + return Portable_Path (Replace (Path, "\", "/")); + end case; + end To_Portable; + -------------- -- Read_Dir -- -------------- diff --git a/src/alire/alire-vfs.ads b/src/alire/alire-vfs.ads index 2f406f9c..743ddd22 100644 --- a/src/alire/alire-vfs.ads +++ b/src/alire/alire-vfs.ads @@ -96,15 +96,6 @@ private and then not Check_Absolute_Path (Path)); - ----------------- - -- To_Portable -- - ----------------- - - function To_Portable (Path : Relative_Path) return Portable_Path - is (case GNATCOLL.OS.Constants.OS is - when MacOS | Unix => Portable_Path (Path), - when Windows => Portable_Path (Replace (Path, "\", "/"))); - --------------- -- To_Native -- --------------- -- 2.39.5