mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-04 15:26:00 +02:00
Support for comptime file IO and process creation
This commit is contained in:
parent
045e706600
commit
ce4b6e04de
19 changed files with 726 additions and 89 deletions
|
@ -2909,6 +2909,12 @@ BFP_EXPORT intptr BFP_CALLTYPE BfpFile_Read(BfpFile* file, void* buffer, intptr
|
|||
//TODO: this doesn't set file stream location. It only works for streams like pipes, sockets, etc
|
||||
if (::ReadFileEx(file->mHandle, buffer, (uint32)size, &overlapped, OverlappedReadComplete))
|
||||
{
|
||||
if (file->mAsyncData == NULL)
|
||||
{
|
||||
OUTRESULT(BfpFileResult_InvalidParameter);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!file->mAsyncData->WaitAndResetEvent(timeoutMS))
|
||||
{
|
||||
::CancelIoEx(file->mHandle, &overlapped);
|
||||
|
|
|
@ -622,7 +622,17 @@ public:
|
|||
str.mLength = (int_strsize)strlen(charPtr);
|
||||
str.mAllocSizeAndFlags = str.mLength | StrPtrFlag;
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
static StringImpl MakeRef(const char* charPtr, intptr length)
|
||||
{
|
||||
StringImpl str;
|
||||
// This is just a ref - called when we pass a literal to a method (for example)
|
||||
str.mPtr = (char*)charPtr;
|
||||
str.mLength = (int_strsize)length;
|
||||
str.mAllocSizeAndFlags = str.mLength | StrPtrFlag;
|
||||
return str;
|
||||
}
|
||||
|
||||
static StringImpl MakeRef(const StringView& strView)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue