本文整理汇总了C++中VirtualDrive::FindFileEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ VirtualDrive::FindFileEntry方法的具体用法?C++ VirtualDrive::FindFileEntry怎么用?C++ VirtualDrive::FindFileEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VirtualDrive
的用法示例。
在下文中一共展示了VirtualDrive::FindFileEntry方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LS_VirtualDrive_FileExtract
int LS_VirtualDrive_FileExtract(LuaState* state, LuaStackObject* args)
{
VirtualDrive* drive = VirtualDriveFromLua(state, args[1]);
const char* srcFileName = luaL_checkstring(*state, 2);
const char* destFileName = luaL_checkstring(*state, 3);
VirtualDrive::FileEntry* entry = drive->FindFileEntry(srcFileName);
if (!entry)
{
state->PushBoolean(false);
return 1;
}
VirtualFile file;
if (!file.Open(*drive, srcFileName))
{
state->PushBoolean(false);
return 1;
}
bool ret = Copy(file, destFileName);
/* FILETIME createTime;
FILETIME accessTime;
FILETIME writeTime;
HANDLE handle = CreateFile(destFileName, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
GetFileTime(handle, &createTime, &accessTime, &writeTime);
writeTime.dwLowDateTime = args[ 2 ].GetInteger();
writeTime.dwHighDateTime = args[ 3 ].GetInteger();
SetFileTime(handle, &createTime, &accessTime, &writeTime);
CloseHandle(handle);
*/
state->PushBoolean(ret);
return 1;
}
示例2: LS_VirtualDrive_FindFileEntry
int LS_VirtualDrive_FindFileEntry(LuaState* state, LuaStackObject* args)
{
VirtualDrive* drive = VirtualDriveFromLua(state, args[1]);
const char* fileName = luaL_checkstring(*state, 2);
VirtualDrive::FileEntry* entry = drive->FindFileEntry(fileName);
if (!entry)
return 0;
BuildFileEntry(state, entry);
return 1;
}