-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpinireader.cs
More file actions
62 lines (55 loc) · 1.71 KB
/
pinireader.cs
File metadata and controls
62 lines (55 loc) · 1.71 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
using System;
using System.Collections.Generic;
using System.ComponentModel.Design.Serialization;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
namespace PerfexiOS.Desktop.PerfexiAPI.Languages.PINI
{
class PiniReader
{
private pini ini;
public PiniReader(pini ini)
{
this.ini = ini;
}
public pini.key GetKey(string path)
{
return null;
}
public pini.section GetSection(string path)
{
pini.section currentsection = ini.root;
List<string> paths = path.Split("/").ToList();
if (paths[1] == string.Empty) { return currentsection; }
for (int i = 1; i < path.Count() - 1; i++)
{
currentsection.LoadItems();
var line = paths[i];
if (i < paths.Count() - 1)
{
foreach (var section in currentsection.sections)
{
if (section.name == line)
{
currentsection = section;
}
}
}
if (i == paths.Count() - 1)
{
currentsection.LoadItems();
foreach (var item in currentsection.sections)
{
if (item.name == line)
{
currentsection = item;
}
}
return currentsection;
}
}
return null;
}
}
}