From 13a2493f4c356849d8fd79f7a909ec641027a8e8 Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Wed, 6 Nov 2019 14:34:47 -0500 Subject: [PATCH] feat: Adding methods to get the data directory for a given room --- ICD.Common.Utils/PathUtils.cs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/ICD.Common.Utils/PathUtils.cs b/ICD.Common.Utils/PathUtils.cs index c877b4a..776bd46 100644 --- a/ICD.Common.Utils/PathUtils.cs +++ b/ICD.Common.Utils/PathUtils.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.IO; using System.Linq; using ICD.Common.Properties; using ICD.Common.Utils.Extensions; @@ -289,6 +288,27 @@ namespace ICD.Common.Utils return Join(ProgramDataPath, local); } + /// + ///Appends the local path to the room data path. + /// + /// + public static string GetRoomDataPath(int roomId, params string[] localPath) + { + string local = Join(localPath); + string roomDataDirectory = GetRoomDataDirectory(roomId); + return Join(ProgramDataPath, roomDataDirectory, local); + } + + /// + /// Gets the directory name of the room data directory for the room with the given id. + /// + /// + /// + public static string GetRoomDataDirectory(int roomId) + { + return string.Format("Room{0}Data", roomId); + } + /// /// Returns true if the given path exists. ///