DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
FileIO API

Определения типов

typedef int[] ParseHandle
 
typedef int[] FileHandle
 
typedef int[] FindFileHandle
 

Перечисления

enum  FileMode { READ , WRITE , APPEND }
 
enum  FileAttr { DIRECTORY , HIDDEN , READONLY , INVALID }
 
enum  FindFileFlags
 

Функции

proto native ParseHandle BeginParse (string filename)
 
proto int ParseLine (ParseHandle tp, int num, string tokens[])
 
proto native void EndParse (ParseHandle file)
 
proto bool FileExist (string name)
 Check existence of file.
 
proto FileHandle OpenFile (string name, FileMode mode)
 Opens File.
 
proto int ReadFile (FileHandle file, void param_array, int length)
 
proto void CloseFile (FileHandle file)
 Close the File.
 
proto void FPrint (FileHandle file, void var)
 Write to file.
 
proto void FPrintln (FileHandle file, void var)
 Write to file and add new line.
 
proto int FGets (FileHandle file, string var)
 Get line from file, every next call of this function returns next line.
 
enum FindFileFlags FindFile (string pattern, out string fileName, out FileAttr fileAttributes, FindFileFlags flags)
 
proto bool FindNextFile (FindFileHandle handle, out string fileName, out FileAttr fileAttributes)
 
proto native void CloseFindFile (FindFileHandle handle)
 
proto native bool MakeDirectory (string name)
 Makes a directory.
 
proto native bool DeleteFile (string name)
 delete file. Works only on "$profile:" and "$saves:" locations
 
proto native bool CopyFile (string sourceName, string destName)
 copy file. destName must be "$profile:" or "$saves:" location
 

Подробное описание

Типы

◆ FileHandle

◆ FindFileHandle

◆ ParseHandle

Перечисления

◆ FileAttr

Элементы перечислений
DIRECTORY 

File is directory.

HIDDEN 

File is hidden.

READONLY 

File is read-only.

INVALID 

Invalid file.

506{
507 DIRECTORY,
508 HIDDEN,
509 READONLY,
510 INVALID
511};
@ HIDDEN
File is hidden.
Definition EnSystem.c:508
@ READONLY
File is read-only.
Definition EnSystem.c:509
@ DIRECTORY
File is directory.
Definition EnSystem.c:507
@ INVALID
Invalid file.
Definition EnSystem.c:510

◆ FileMode

Элементы перечислений
READ 
WRITE 
APPEND 
383{
384 READ,
385 WRITE,
386 APPEND
387};
@ WRITE
Definition EnSystem.c:385
@ READ
Definition EnSystem.c:384
@ APPEND
Definition EnSystem.c:386

◆ FindFileFlags

514{
516 ARCHIVES,
517 ALL
518}
ALL
<Looks in archives and fs directories.
Definition EnSystem.c:3
ARCHIVES
Looks for files in archive only. (.pak)
Definition EnSystem.c:1
DIRECTORIES
Looks for files in fs directories only.
Definition EnSystem.c:0

Функции

◆ BeginParse()

proto native ParseHandle BeginParse ( string filename)

◆ CloseFile()

proto void CloseFile ( FileHandle file)

Close the File.

Аргументы
fileFile handle ID of a opened file
Возвращает
void
usage :
FileHandle file = OpenFile("$profile:testiik.txt", FileMode.WRITE);
if (file != 0)
{
FPrintln(file, "line1");
FPrintln(file, "line2");
FPrintln(file, "line3");
}
Definition EntityAI.c:95
FileMode
Definition EnSystem.c:383
proto void CloseFile(FileHandle file)
Close the File.
proto FileHandle OpenFile(string name, FileMode mode)
Opens File.
proto void FPrintln(FileHandle file, void var)
Write to file and add new line.

Используется в Debug::ClearLogs(), PluginRecipesManagerBase::GenerateHumanReadableRecipeList(), GetControlMappingInfo(), UIScriptedMenu::GetControlMappingInfo(), JsonFileLoader< Class T >::JsonLoadFile(), JsonFileLoader< Class T >::JsonSaveFile(), PluginBase::LoadFile(), JsonFileLoader< Class T >::LoadFile(), ScriptConsoleOutputTab::ReloadOutput(), PluginBase::SaveFile(), JsonFileLoader< Class T >::SaveFile(), Debug::SaveLog(), WorldData::WeatherOnBeforeChange(), EnochData::WeatherOnBeforeChange() и SakhalData::WeatherOnBeforeChange().

◆ CloseFindFile()

proto native void CloseFindFile ( FindFileHandle handle)

Используется в ScriptedWidgetEventHandler::InitVideoLoading().

◆ CopyFile()

proto native bool CopyFile ( string sourceName,
string destName )

copy file. destName must be "$profile:" or "$saves:" location

Используется в PluginBase::FileDuplicate().

◆ DeleteFile()

proto native bool DeleteFile ( string name)

delete file. Works only on "$profile:" and "$saves:" locations

Используется в PluginBase::FileDelete().

◆ EndParse()

proto native void EndParse ( ParseHandle file)

◆ FGets()

proto int FGets ( FileHandle file,
string var )

Get line from file, every next call of this function returns next line.

Аргументы
fileFile handle ID of a opened file
varValue to write
Возвращает
int Count of chars or -1 if is not any for read (end of file is EMPTY line)
usage :
FileHandle file_handle = OpenFile("$profile:testiik.txt", FileMode.READ);
string line_content;
while ( FGets( file_handle, line_content ) > 0 )
{
}
proto void Print(void var)
Prints content of variable to console/log.
proto int FGets(FileHandle file, string var)
Get line from file, every next call of this function returns next line.

Используется в GetControlMappingInfo(), UIScriptedMenu::GetControlMappingInfo(), JsonFileLoader< Class T >::JsonLoadFile(), PluginBase::LoadFile(), JsonFileLoader< Class T >::LoadFile() и ScriptConsoleOutputTab::ReloadOutput().

◆ FileExist()

◆ FindFile()

◆ FindNextFile()

◆ FPrint()

proto void FPrint ( FileHandle file,
void var )

Write to file.

Аргументы
fileFile handle ID of a opened file
varValue to write
Возвращает
void
usage :
FileHandle file = OpenFile("$profile:testiik.txt", FileMode.WRITE);
if (file != 0)
{
FPrint(file, "A");
FPrint(file, "B");
FPrint(file, "C");
}
proto void FPrint(FileHandle file, void var)
Write to file.

Используется в JsonFileLoader< Class T >::JsonSaveFile() и JsonFileLoader< Class T >::SaveFile().

◆ FPrintln()

proto void FPrintln ( FileHandle file,
void var )

Write to file and add new line.

Аргументы
fileFile handle ID of a opened file
varValue to write
Возвращает
void
usage :
FileHandle file = OpenFile("$profile:testiik.txt", FileMode.WRITE);
if (file != 0)
{
FPrintln(file, "line1");
FPrintln(file, "line2");
FPrintln(file, "line3");
}

Используется в Debug::ClearLogs(), PluginRecipesManagerBase::GenerateHumanReadableRecipeList(), PluginBase::SaveFile(), Debug::SaveLog(), Canvas::SaveToFile(), WorldData::WeatherOnBeforeChange(), EnochData::WeatherOnBeforeChange() и SakhalData::WeatherOnBeforeChange().

◆ MakeDirectory()

◆ OpenFile()

proto FileHandle OpenFile ( string name,
FileMode mode )

Opens File.

Аргументы
nameof a file to open, (you can use filesystem prefixes ('$profile','$saves','$mission'). For accessing profile dir use '$profile', e.g. '$profile:myfilename.txt')
modeconstants FileMode.WRITE, FileMode.READ or FileMode.APPEND flag can be used
Возвращает
file handle ID or 0 if fails
usage :
FileHandle file = OpenFile("$profile:testiik.txt", FileMode.WRITE);
//FileHandle file = OpenFile("$profile:testiik.txt", FileMode.APPEND);
if (file != 0)
{
FPrintln(file, "line1");
FPrintln(file, "line2");
FPrintln(file, "line3");
}

Используется в Debug::ClearLogs(), PluginRecipesManagerBase::GenerateHumanReadableRecipeList(), GetControlMappingInfo(), UIScriptedMenu::GetControlMappingInfo(), JsonFileLoader< Class T >::JsonLoadFile(), JsonFileLoader< Class T >::JsonSaveFile(), PluginBase::LoadFile(), JsonFileLoader< Class T >::LoadFile(), ScriptConsoleOutputTab::ReloadOutput(), PluginBase::SaveFile(), JsonFileLoader< Class T >::SaveFile(), Debug::SaveLog(), Canvas::SaveToFile(), WorldData::WeatherOnBeforeChange(), EnochData::WeatherOnBeforeChange() и SakhalData::WeatherOnBeforeChange().

◆ ParseLine()

proto int ParseLine ( ParseHandle tp,
int num,
string tokens[] )

◆ ReadFile()

proto int ReadFile ( FileHandle file,
void param_array,
int length )

Reads raw data from file.

Аргументы
param_arrayReceiving array for the data. Valid types are int[] or string
lengthLength of data
Возвращает
number of read bytes