2019-10-01 12:46:38 -07:00
|
|
|
using System;
|
2020-04-29 06:40:03 -07:00
|
|
|
using System.Collections;
|
2019-10-01 12:46:38 -07:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2021-12-03 05:58:45 -08:00
|
|
|
if (!mDefinesSet.ContainsAlt(str))
|
2019-10-01 12:46:38 -07:00
|
|
|
{
|
|
|
|
var strCopy = new String(str);
|
|
|
|
mDefines.Add(strCopy);
|
|
|
|
mDefinesSet.Add(strCopy);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|