mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-20 17:08:00 +02:00
31 lines
603 B
Beef
31 lines
603 B
Beef
![]() |
using System;
|
||
|
using System.Collections.Generic;
|
||
|
|
||
|
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.ContainsWith(str))
|
||
|
{
|
||
|
var strCopy = new String(str);
|
||
|
mDefines.Add(strCopy);
|
||
|
mDefinesSet.Add(strCopy);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|
||
|
}
|