MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / WriteAllBytes

Method WriteAllBytes

Source/Engine/Platform/Base/FileBase.cpp:235–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235bool FileBase::WriteAllBytes(const StringView& path, const void* data, int32 length)
236{
237 PROFILE_CPU_NAMED("File::WriteAllBytes");
238 ZoneText(*path, path.Length());
239 bool result = true;
240 auto file = File::Open(path, FileMode::CreateAlways, FileAccess::Write, FileShare::All);
241 if (file)
242 {
243 if (length > 0)
244 result = file->Write(data, length) != 0;
245 else
246 result = false;
247
248 Delete(file);
249 }
250 return result;
251}
252
253bool FileBase::WriteAllBytes(const StringView& path, const Array<byte>& data)
254{

Callers 1

SearchRefsMethod · 0.80

Calls 5

DeleteFunction · 0.85
LengthMethod · 0.45
WriteMethod · 0.45
GetMethod · 0.45
CountMethod · 0.45

Tested by

no test coverage detected