forked from BeyondDimension/SteamTools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArchiSteamFarmPathHelper.cs
More file actions
91 lines (81 loc) · 2.59 KB
/
ArchiSteamFarmPathHelper.cs
File metadata and controls
91 lines (81 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
namespace ArchiSteamFarm
{
public static class ASFPathHelper
{
static readonly Lazy<string> _AppDataDirectory = new(() =>
{
var path = Path.Combine(IOPath.AppDataDirectory, "ASF");
IOPath.DirCreateByNotExists(path);
return path;
});
/// <summary>
/// <list type="bullet">
/// <item>
/// AppData\ASF\config
/// </item>
/// <item>
/// AppData\ASF\plugins
/// </item>
/// </list>
/// </summary>
public static string AppDataDirectory => _AppDataDirectory.Value;
/// <summary>
/// <list type="bullet">
/// <item>
/// Windows:Logs\ASF
/// </item>
/// <item>
/// Windows Desktop Bridge:{CacheDirectory}\Logs\ASF
/// </item>
/// </list>
/// </summary>
/// <param name="logDirPath"></param>
/// <returns></returns>
public static string GetLogDirectory([NotNull] string logDirPath)
{
var path = (logDirPath.EndsWith(Path.DirectorySeparatorChar) ? logDirPath : logDirPath + Path.DirectorySeparatorChar) + "ASF";
IOPath.DirCreateByNotExists(path);
return path;
}
public static string GetNLogArchiveFileName([NotNull] string logDirectory)
{
var path = logDirectory + Path.DirectorySeparatorChar + SharedInfo.ArchivalLogFile;
return path;
}
public static string GetNLogFileName([NotNull] string logDirectory)
{
var path = logDirectory + Path.DirectorySeparatorChar + SharedInfo.LogFile;
return path;
}
static readonly Lazy<string> _WebsiteDirectory = new(() =>
{
var path = Path.Combine(IOPath.AppDataDirectory, "ASF", "www");
IOPath.DirCreateByNotExists(path);
return path;
});
/// <summary>
/// <list type="bullet">
/// <item>
/// AppData\ASF\www
/// </item>
/// </list>
/// </summary>
public static string WebsiteDirectory => _WebsiteDirectory.Value;
#if DEBUG
[Obsolete("use AppDataDirectory")]
public static string HomeDirectory => AppDataDirectory;
#endif
public const string NLogGeneralLayout = NLog.Logging.GeneralLayout;
}
public enum ASFPathFolder
{
ASF,
Config,
Plugin,
WWW,
Logs,
}
}