少年修仙传客户端基础资源
hch
2024-04-01 d01413b00ef631ac20347716b23818b0b811f65f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#pragma once
#include "il2cpp-config.h"
 
 
#include <stdint.h>
#include <string>
#include "os/ErrorCodes.h"
#include "os/c-api/OSGlobalEnums.h"
 
#undef CopyFile
#undef DeleteFile
#undef MoveFile
#undef ReplaceFile
#undef GetFileAttributes
#undef SetFileAttributes
#undef CreatePipe
 
namespace il2cpp
{
namespace os
{
    // File enums and structs
    struct FileHandle;
 
    struct FileStat
    {
        std::string name;
        int32_t attributes;
        int64_t length;
        int64_t creation_time;
        int64_t last_access_time;
        int64_t last_write_time;
    };
 
    class LIBIL2CPP_CODEGEN_API File
    {
    public:
 
 
        static bool Isatty(FileHandle* fileHandle);
        static FileHandle* GetStdInput();
        static FileHandle* GetStdOutput();
        static FileHandle* GetStdError();
        static bool CreatePipe(FileHandle** read_handle, FileHandle** write_handle);
        static bool CreatePipe(FileHandle** read_handle, FileHandle** write_handle, int* error);
        static FileType GetFileType(FileHandle* handle);
        static UnityPalFileAttributes GetFileAttributes(const std::string& path, int* error);
        static bool SetFileAttributes(const std::string& path, UnityPalFileAttributes attributes, int* error);
        static bool GetFileStat(const std::string& path, FileStat * stat, int* error);
        static bool CopyFile(const std::string& src, const std::string& dest, bool overwrite, int* error);
        static bool MoveFile(const std::string& src, const std::string& dest, int* error);
        static bool DeleteFile(const std::string& path, int *error);
        static bool ReplaceFile(const std::string& sourceFileName, const std::string& destinationFileName, const std::string& destinationBackupFileName, bool ignoreMetadataErrors, int* error);
        static FileHandle* Open(const std::string& path, int openMode, int accessMode, int shareMode, int options, int *error);
        static bool Close(FileHandle* handle, int *error);
        static bool SetFileTime(FileHandle* handle, int64_t creation_time, int64_t last_access_time, int64_t last_write_time, int* error);
        static int64_t GetLength(FileHandle* handle, int *error);
        static bool SetLength(FileHandle* handle, int64_t length, int *error);
        static int64_t Seek(FileHandle* handle, int64_t offset, int origin, int *error);
        static int Read(FileHandle* handle, char *dest, int count, int *error);
        static int32_t Write(FileHandle* handle, const char* buffer, int count, int *error);
        static bool Flush(FileHandle* handle, int* error);
        static void Lock(FileHandle* handle,  int64_t position, int64_t length, int* error);
        static void Unlock(FileHandle* handle,  int64_t position, int64_t length, int* error);
        static bool IsExecutable(const std::string& path);
        static bool Truncate(FileHandle* handle, int *error);
 
        static bool DuplicateHandle(FileHandle* source_process_handle, FileHandle* source_handle, FileHandle* target_process_handle,
            FileHandle** target_handle, int access, int inherit, int options, int* error);
    };
}
}