MCPcopy Create free account
hub / github.com/Tencent/UnLua / Seek

Method Seek

Plugins/UnLua/Source/UnLua/Private/BaseLib/LuaLib_File.cpp:60–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58 FILE.Reset();
59 }
60 void Seek(const FString& Mode, int32 Offset)
61 {
62 if (FILE.IsValid())
63 {
64 static const FString modenames[] = { TEXT("set"), TEXT("cur"), TEXT("end")};
65 if (Mode.Equals(modenames[0]))
66 {
67 FILE->Seek(Offset);
68 }
69 else if (Mode.Equals(modenames[1]))
70 {
71 FILE->Seek(FILE->Tell() + Offset);
72 }
73 else if (Mode.Equals(modenames[2]))
74 {
75 int64 Length = FILE->TotalSize();
76 int64 RealOffset = Length - Offset;
77 FILE->Seek(RealOffset);
78 }
79 }
80
81 }
82
83 int32 TotalSize()
84 {

Callers

nothing calls this directly

Calls 3

TotalSizeMethod · 0.80
IsValidMethod · 0.45
TellMethod · 0.45

Tested by

no test coverage detected