DayZ Enforce
Script API
Static Private Member Functions | List of all members
EnConvert Class Reference

#include <EnConvert.h>

Static Private Member Functions

static proto string  AsciiCodeToString (int code)
  Converts ASCII code to string. More...
 
static proto string  IntToString (int number)
  Converts integer to string. More...
 
static proto int  StringToInt (string str)
  Converts string to integer. More...
 
static proto string  FloatToString (float number)
  Converts float to string. More...
 
static proto float  StringToFloat (string str)
  Converts string to float. More...
 
static string  VectorToString (vector v)
  Vector to string. More...
 
static string  VectorToStringParse (vector v)
  Vector to parseable string. More...
 
static vector  StringToVector (string s)
  Returns a vector from a string. More...
 
static string  IntToStringLen (int num, int len)
  Integer to string with fixed length, padded with zeroes. More...
 

Member Function Documentation

static proto string EnConvert::AsciiCodeToString ( int  code )
staticprivate

Converts ASCII code to string.

Parameters
ascii ASCII code for convert to string.
Returns
string - Converted int.
int ascii_code = 77;
string str = EnConvert.AsciiCodeToString(ascii_code);
Print(str);
>> str = 'M'
static proto string EnConvert::IntToString ( int  number )
staticprivate

Converts integer to string.

Parameters
number Integer for convert to string.
Returns
string - Converted int.
string str = EnConvert.IntToString(56);
Print(str);
>> str = '56'
static proto int EnConvert::StringToInt ( string  str )
staticprivate

Converts string to integer.

Parameters
str String for convert to int.
Returns
int - Converted string.
int i = EnConvert.StringToInt("56.6");
Print(i);
>> i = 56
static proto string EnConvert::FloatToString ( float  number )
staticprivate

Converts float to string.

Parameters
number Float value for convert to string.
Returns
string - Converted number.
string str = EnConvert.FloatToString(56.6);
Print(str);
>> str = '56.6'
static proto float EnConvert::StringToFloat ( string  str )
staticprivate

Converts string to float.

Parameters
str String for convert to float.
Returns
float - Converted string in float.
float f = EnConvert.StringToFloat("56.6");
Print(f);
>> f = 56.6

Referenced by HudDebugCharValue::GetCharValue().

static string EnConvert::VectorToString ( vector  v )
staticprivate

Vector to string.

Parameters
v vector Vector
Returns
string Converted vector as string
vector v = "1 0 1";
>> '<1,0,1>'

References ftoa().

static string EnConvert::VectorToStringParse ( vector  v )
staticprivate

Vector to parseable string.

Parameters
v vector Vector
Returns
string Converted vector as parsed string
vector v = "1 0 1";
>> '1 0 1'

References ftoa().

static vector EnConvert::StringToVector ( string  s )
staticprivate

Returns a vector from a string.

Parameters
s string Vector in string format
Returns
vector Converted s as vector
vector v = EnConvert.StringToVector("1 0 1");
Print(v);
>> v = <1,0,1>

References atof(), and ParseString().

Referenced by ModuleLocalProfileUIFixed::GetPositionByName().

static string EnConvert::IntToStringLen ( int  num,
int  len 
)
staticprivate

Integer to string with fixed length, padded with zeroes.

Parameters
num int integer to convert
len int fixed length
Returns
vector Converted s as vector
string s = EnConvert.IntToStringLen(123, 5);
Print(s);
>> s = '00123'

References itoa(), and strlen().

Referenced by GardenBase::DigSoil(), GardenBase::GetSlotPosition(), GardenBase::RemoveSlot(), and EN5C_PlantBase::Update().


The documentation for this class was generated from the following file:
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)