Arma Reforger Script API
Loading...
Searching...
No Matches
Static Public Member Functions | Static Protected Member Functions | List of all members
SCR_ConfigHelper Interface Reference

Static Public Member Functions

static BaseContainer GetBaseContainerByPath (notnull Resource resource, string subChildPath="", bool removeEntryPart=false)
 Get BaseContainer from resource, ensuring the whole thing is valid.
 
static string SplitConfigPath (string input, out array< string > output, bool removeLastPart=false)
 split "config path" (separator: / ), trims and toLower parts and returns last part if any
 
static string GetGUID (ResourceName resourceName, bool removeBrackets=false)
 Extract GUID from full resource name.
 

Static Protected Member Functions

static BaseContainer GetChildBaseContainerByPath (BaseContainer container, string subChildPath, bool removeEntryPart=false)
 returns the found sub-container or null if not found
 
static BaseContainer GetChildBaseContainerByPath (notnull BaseContainer container, array< string > paths)
 returns the found sub-container or null if not found
 
static BaseContainer GetChildFromList (notnull BaseContainerList containerList, string childName)
 Get BaseContainer from BaseContainerList by its (case-insensitive) name.
 

Member Function Documentation

◆ GetBaseContainerByPath()

static BaseContainer SCR_ConfigHelper.GetBaseContainerByPath ( notnull Resource  resource,
string  subChildPath = "",
bool  removeEntryPart = false 
)
static

Get BaseContainer from resource, ensuring the whole thing is valid.

Parameters
[in]resourceif invalid, returns null
[in]subChildPathpath is case-insensitive, separated by /, spaces can be involved \ examples: "level1/level2/level3", "level1 / level2 / level3" \ if empty, returns the provided container
[in]removeEntryPartif true, removes the last path element \ examples: path/to/entryName → path/to (to target the parent container itself)
Returns
found child BaseContainer, or null if base container or path is invalid

◆ GetChildBaseContainerByPath() [1/2]

static BaseContainer SCR_ConfigHelper.GetChildBaseContainerByPath ( BaseContainer  container,
string  subChildPath,
bool  removeEntryPart = false 
)
staticprotected

returns the found sub-container or null if not found

Parameters
[in]containerif null, returns null
[in]subChildPathpath is case-insensitive, separated by /, spaces can be involved \ examples: "level1/level2/level3", "level1 / level2 / level3" \ if empty, returns the provided container
[in]removeEntryPartif true, removes the last path element \ examples: path/to/entryName → path/to (to target the parent container itself)
Returns
found child BaseContainer, or null if path is incorrect

◆ GetChildBaseContainerByPath() [2/2]

static BaseContainer SCR_ConfigHelper.GetChildBaseContainerByPath ( notnull BaseContainer  container,
array< string >  paths 
)
staticprotected

returns the found sub-container or null if not found

Parameters
[in]containerif null, returns null
[in]pathscase-insensitive, items will be trimmed \ if empty, returns the provided container
Returns
found child BaseContainer, or null if path is incorrect

◆ GetChildFromList()

static BaseContainer SCR_ConfigHelper.GetChildFromList ( notnull BaseContainerList  containerList,
string  childName 
)
staticprotected

Get BaseContainer from BaseContainerList by its (case-insensitive) name.

Parameters
[in]containerListlist of containers from which to look
[in]childNamecase-insensitive child name
Returns
BaseContainer found child or null

◆ GetGUID()

static string SCR_ConfigHelper.GetGUID ( ResourceName  resourceName,
bool  removeBrackets = false 
)
static

Extract GUID from full resource name.

Parameters
[in]resourceNamefull resource path
[in]removeBracketsif true, remove brackets
Returns
resourceName's GUID

◆ SplitConfigPath()

static string SCR_ConfigHelper.SplitConfigPath ( string  input,
out array< string >  output,
bool  removeLastPart = false 
)
static

split "config path" (separator: / ), trims and toLower parts and returns last part if any

Parameters
[in]inputthe input string
[out]outputthe target output array
[in]removeLastPartremoves last part if entry path is provided
Returns
last part (trimmed but not ToLower'ed), whether it has been removed or not

The documentation for this interface was generated from the following file: