FxFileID ​
This module contains functions for creating and working with FileID lists.
Load ​
FxFileID = require "FxFileID";Functions ​
| Function | Description |
|---|---|
| Count (FileType, FileID) | Returns the number of items in a list. |
| Create (FileType, FileID) | Creates a file list. |
| FilterCategory (FileType, FileID, Category) | Filters files of given category from a file list. |
| FilterID (FileType, FileID, Value) | Filters files from a file list. |
| Get (FileType, FileID, Index) | Returns the file from a file list at given index. |
| Merge (FileType, FileID1, FileID2) | Merges two file lists. |
| Remove (FileType, FileID, RemoveFileID) | Removes a file from a list. |
| Reverse (FileType, FileID) | Reverses a file list. |
| SortCategory (FileType, FileID) | Sorts a file list by category. |
| SortDate (FileType, FileID) | Sorts a file list by date. |
| SortID (FileType, FileID) | Sorts a file list by ID. |
Count (FileType, FileID) ​
This function returns the number of files identified by the specified FileID and FileType.
Parameters ​
- FileType: The FileType to identify the files of the list
- FileID: The FileID to identify the files of the list
Returns ​
The number of identified files
Errors ​
Possible errors include FX_TYPE_INVALID, FX_FILE_NOT_FOUND
Since ​
Version 1.0
Example ​
val = FxFileID.Count(111, "<model1,model2,model3>");
-- returns 3
-- get number of selected assets
val = FxFileID.Count(111, "/s");
-- get number of cubemaps
val = FxFileID.Count(222, "*");Create (FileType, FileID) ​
This function returns a valid FileID list identified by the given FileID and FileType.
Parameters ​
- FileType: The FileType to identify the files of the list
- FileID: The FileID to identify the files of the list
Returns ​
A valid FileID list without duplicates
Errors ​
Possible errors include FX_TYPE_INVALID, FX_FILE_NOT_FOUND
Since ​
Version 1.0
Example ​
-- make a list of all cubemaps
list = FxFileID.Create(222, "*");FilterCategory (FileType, FileID, Category) ​
This function returns the items of FileID that match the given category.
Parameters ​
- FileType: The FileType to identify the files of the list
- FileID: The FileID to identify the files of the list
- Category: The Category to filter
Returns ​
A valid FileID list without duplicates
Errors ​
Possible errors include FX_TYPE_INVALID, FX_FILE_NOT_FOUND, FX_VALUE_INVALID
Since ​
Version 1.0
Example ​
-- get list of assets that are categorized as bird
list = FxFileID.FilterCategory(111, "*", 33);FilterID (FileType, FileID, Value) ​
This function returns the items of FileID that have Value in their FileID.
Parameters ​
- FileType: The FileType to identify the files of the list
- FileID: The FileID to identify the files of the list
- Value: The filter string
Returns ​
A valid FileID list without duplicates
Errors ​
Possible errors include FX_TYPE_INVALID, FX_FILE_NOT_FOUND
Since ​
Version 1.0
Example ​
list = FxFileID.FilterID(111, "<model1,bitmap2,movie1>", "mo");
-- returns "<model1,movie1>"Get (FileType, FileID, Index) ​
This function returns the items of FileID at given index. The index of the first item is 0.
Parameters ​
- FileType: The FileType to identify the files of the list
- FileID: The FileID to identify the files of the list
- Index: The list index
Returns ​
A single FileID
Errors ​
Possible errors include FX_TYPE_INVALID, FX_FILE_NOT_FOUND, FX_VALUE_INVALID
Since ​
Version 1.0
Example ​
list = FxFileID.Get(111, "<dear,bear,fox", 2);
-- returns "fox"Merge (FileType, FileID1, FileID2) ​
This function merges FileID and AddFileID and returns the new list.
Parameters ​
- FileType: The FileType to identify the files of the list
- FileID1: The FileID to identify the files of the list1
- FileID2: The FileID to identify the files of the list2
Returns ​
A valid FileID list without duplicates
Errors ​
Possible errors include FX_TYPE_INVALID, FX_FILE_NOT_FOUND
Since ​
Version 1.0
Example ​
list = FxFileID.Merge(111, "<model1,model2>", "model3");
-- returns "<model1,model2,model3>"
list = FxFileID.Merge(111, list, "<bitmap1,bitmap2>");
-- returns "<model1,model2,model3,bitmap1,bitmap2>"Remove (FileType, FileID, RemoveID) ​
This function takes the files identified by the given FileID and FileType, removes all files identified by the given RemoveID, and returns the new list.
Parameters ​
- FileType: The FileType to identify the files of the list
- FileID: The FileID to identify the files of the list
- RemoveFileID: The FileID to identify the files to remove from the list
Returns ​
A valid FileID list without duplicates
Errors ​
Possible errors include FX_TYPE_INVALID, FX_FILE_NOT_FOUND
Since ​
Version 1.0
Example ​
list = "<bus,train,car>";
list = FxFileID.Remove(111, list, "car");
-- returns "<bus,train>"Reverse (FileType, FileID) ​
This function reverses the order of files identified by the given FileID and FileType and returns the new list.
Parameters ​
- FileType: The FileType to identify the files of the list
- FileID: The FileID to identify the files of the list
Returns ​
A valid FileID list without duplicates
Errors ​
Possible errors include FX_TYPE_INVALID, FX_FILE_NOT_FOUND
Since ​
Version 1.0
Example ​
list = "<one,two,three>";
list = FxFileID.Reverse(111, list);
-- returns "<three,two,one>"SortCategory (FileType, FileID) ​
This function takes the items of FileID and sorts them by their category.
Parameters ​
- FileType: The FileType to identify the files of the list
- FileID: The FileID to identify the files of the list
Returns ​
A valid FileID list without duplicates
Errors ​
Possible errors include FX_TYPE_INVALID, FX_FILE_NOT_FOUND, FX_VALUE_INVALID
Since ​
Version 1.0
Example ​
-- get list of assets sorted by category
list = FxFileID.SortCategory(111, "*");SortDate (FileType, FileID) ​
This function takes the items of FileID and sorts them by their date of last change starting with new newest file.
Parameters ​
- FileType: The FileType to identify the files of the list
- FileID: The FileID to identify the files of the list
Returns ​
A valid FileID list without duplicates
Errors ​
Possible errors include FX_TYPE_INVALID, FX_FILE_NOT_FOUND
Since ​
Version 1.0
Example ​
-- get list of assets sorted by date of last change
list = FxFileID.SortDate(111, "*");SortID (FileType, FileID) ​
This function takes the items of FileID and sorts them alphabetically.
Parameters ​
- FileType: The FileType to identify the files of the list
- FileID: The FileID to identify the files of the list
Returns ​
A valid FileID list without duplicates
Errors ​
Possible errors include FX_TYPE_INVALID, FX_FILE_NOT_FOUND
Since ​
Version 1.0
Example ​
list = "<fish,whale,shark>";
list = FxFileID.SortID(111, list);
-- returns "<fish,shark,whale>"