1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-20 08:58:00 +02:00
Beef/IDE/src/util/DefinesSet.bf
2022-01-06 21:05:53 +01:00

30 lines
600 B
Beef

using System;
using System.Collections;
namespace IDE.util
{
class DefinesSet
{
public List<String> mDefines = new List<String>() ~ DeleteContainerAndItems!(_);
public HashSet<String> mDefinesSet = new HashSet<String>() ~ delete _;
public void Add(StringView str)
{
if (str.StartsWith("!"))
{
String removeKey = scope .(str, 1);
if (mDefinesSet.Remove(removeKey))
mDefines.Remove(removeKey);
return;
}
if (!mDefinesSet.Contains(scope .(str)))
{
var strCopy = new String(str);
mDefines.Add(strCopy);
mDefinesSet.Add(strCopy);
}
}
}
}