DayZ Enforce
Script API
Typedefs | Functions | Variables
attributes

Typedefs

typedef int[]  FindFileHandle
 

Functions

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

Variables

const int  FILEATTR_DIRECTORY = 0x000001
  File is directory. More...
 
const int  FILEATTR_HIDDEN = 0x000002
  File is hidden. More...
 
const int  FILEATTR_READONLY = 0x000004
  File is read-only. More...
 
const int  FILEATTR_COMPRESSED = 0x000008
  File is from compressed archive. More...
 
const int  FILEATTR_ARCHIVE = 0x000010
  File is archived. More...
 
const int  FILEATTR_SYSTEM = 0x000020
 
const int  FILEATTR_NOINDEXED = 0x000040
 
const int  FILEATTR_ENCRYPTED = 0x000080
 
const int  FILEATTR_ISCREATOR = 0x000100
  For consoles, it indicates, that the file is created by current user. More...
 

Detailed Description

Constants for sending commands on server

constants for mouse buttons

Typedef Documentation

typedef int [] FindFileHandle

Function Documentation

BeginParse ( string  filename )
proto int ParseLine ( tparse  tp,
int  num,
string  tokens[] 
)
proto void EndParse ( tparse  file )
proto bool FileExist ( string  name )
proto FileHandle OpenFile ( string  name,
int  mode 
)

Opens File.

Parameters
name of a file to open, (you can use filesystem prefixes. For accessing profile dir use '$profile', e.g. '$profile:myFileName.txt')
mode constants FILEMODE_WRITE or FILEMODE_READ
Returns
file handle ID or 0 if fails
usage :
1 FileHandle file = OpenFile("$profile:testiik.txt", FILEMODE_WRITE);
2 if (file != 0)
3 {
4  FPrintln(file, "line1");
5  FPrintln(file, "line2");
6  FPrintln(file, "line3");
7  CloseFile(file);
8 }

Referenced by ModuleFileHandler::LoadFile(), Debug::LoadFile(), ModuleFileHandler::SaveFile(), and Debug::SaveLog().

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

???

proto void CloseFile ( FileHandle  file )

Close the File.

Parameters
file File handle ID of a opened file
Returns
void
usage :
1 FileHandle file = OpenFile("$profile:testiik.txt", FILEMODE_WRITE);
2 if (file != 0)
3 {
4  FPrintln(file, "line1");
5  FPrintln(file, "line2");
6  FPrintln(file, "line3");
7  CloseFile(file);
8 }

Referenced by ModuleFileHandler::LoadFile(), Debug::LoadFile(), ModuleFileHandler::SaveFile(), and Debug::SaveLog().

proto void FPrint ( FileHandle  file,
void  var 
)

Write to file.

Parameters
file File handle ID of a opened file
var Value to write
Returns
void
usage :
1 FileHandle file = OpenFile("$profile:testiik.txt", FILEMODE_WRITE);
2 if (file != 0)
3 {
4  FPrint(file, "A");
5  FPrint(file, "B");
6  FPrint(file, "C");
7  CloseFile(file);
8 }
proto void FPrintln ( FileHandle  file,
void  var 
)

Write to file and add new line.

Parameters
file File handle ID of a opened file
var Value to write
Returns
void
usage :
1 FileHandle file = OpenFile("$profile:testiik.txt", FILEMODE_WRITE);
2 if (file != 0)
3 {
4  FPrintln(file, "line1");
5  FPrintln(file, "line2");
6  FPrintln(file, "line3");
7  CloseFile(file);
8 }

Referenced by ModuleFileHandler::SaveFile(), and Debug::SaveLog().

proto int FGets ( FileHandle  file,
string  var 
)

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

Parameters
file File handle ID of a opened file
var Value to write
Returns
int Count of chars or -1 if is not any for read (end of file is EMPTY line)
usage :
1 FileHandle file_handle = OpenFile("$profile:testiik.txt", FILEMODE_READ);
2 string line_content;
3 
4 while ( FGets( file_handle, line_content ) > 0 )
5 {
6  Print(line_content);
7 }
8 
9 CloseFile(file_handle);

Referenced by ModuleFileHandler::LoadFile(), and Debug::LoadFile().

proto FindFileHandle FindFile ( string  pattern,
out string  fileName,
out int  fileAttributes,
int  flags 
)

FILEATTR_DIRECTORY = BITF(0), ///<File is directory FILEATTR_HIDDEN = BITF(1), ///<File is hidden FILEATTR_READONLY = BITF(2), ///<File is read-only FILEATTR_COMPRESSED = BITF(3), ///<File is from compressed archive FILEATTR_ARCHIVE = BITF(4), ///<File is archived FILEATTR_SYSTEM = BITF(5), FILEATTR_NOINDEXED = BITF(6), FILEATTR_ENCRYPTED = BITF(7), FILEATTR_ISCREATOR = BITF(8), ///<For consoles, it indicates, that the file is created by current user FILEATTR_INVALID = 0xffffffff

Referenced by MissionEditor::GetMissionList().

proto bool FindNextFile ( FindFileHandle  handle,
out string  fileName,
out int  fileAttributes 
)
proto void CloseFindFile ( FindFileHandle  handle )
proto bool MakeDirectory ( string  name )
proto bool DeleteFile ( string  name )

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

proto bool CopyFile ( string  sourceName,
string  destName 
)

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

Variable Documentation

const int FILEATTR_DIRECTORY = 0x000001

File is directory.

Referenced by MissionEditor::GetMissionList().

const int FILEATTR_HIDDEN = 0x000002

File is hidden.

const int FILEATTR_READONLY = 0x000004

File is read-only.

const int FILEATTR_COMPRESSED = 0x000008

File is from compressed archive.

const int FILEATTR_ARCHIVE = 0x000010

File is archived.

const int FILEATTR_SYSTEM = 0x000020
const int FILEATTR_NOINDEXED = 0x000040
const int FILEATTR_ENCRYPTED = 0x000080
const int FILEATTR_ISCREATOR = 0x000100

For consoles, it indicates, that the file is created by current user.

Converted from CHM to HTML with chm2web Pro 2.85 (unicode)