1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +02:00

Show comptime emits as embedded sourceviews

This commit is contained in:
Brian Fiete 2022-04-16 06:27:54 -07:00
parent ee27f6fd02
commit 4d1e14a1c3
65 changed files with 3360 additions and 633 deletions

View file

@ -1,4 +1,5 @@
#include "BfUtil.h"
#include "BeefySysLib/util/Hash.h"
USING_NS_BF;
@ -52,6 +53,26 @@ void* Beefy::ZeroedAlloc(int size)
return data;
}
String Beefy::EncodeFileName(const StringImpl& fromStr)
{
String path;
if (fromStr.mLength > 80)
path.Insert(0, fromStr.mPtr, 80);
else
path += fromStr;
path.Replace("$", "\\");
for (auto& c : path)
{
if ((!::isalnum((uint8)c)) && (c != '_'))
c = '-';
}
path += "_";
path += HashEncode128(Hash128(fromStr.c_str(), (int)fromStr.length()));
return path;
}
uint64 stouln(const char* str, int len)
{
uint64 val = 0;