Detailed Method Reference
Namespace: Canley.Utility.CSV
Class: CanleyCSVManager
LoadFromFilePath
public bool LoadFromFilePath(string path)-
Description: Loads a CSV from the local disk, supporting both simple filenames and absolute paths.
-
Workflow:
- Path Detection: Checks if the string is a full path; if not, it automatically targets
Application.persistentDataPath. - Validation: Verifies
File.Exists()before attempting to read to prevent runtime exceptions. - Execution: Reads the raw text and initiates the parsing sequence via
ParseRawData().
- Path Detection: Checks if the string is a full path; if not, it automatically targets
-
Parameters:
path: A full absolute path or a simple filename (e.g., “save_data.csv”).
-
Returns:
bool—trueif the file was found and loaded. -
Example:
// Targets Application.persistentDataPath/SaveGame.csv
csvManager.LoadFromFilePath("SaveGame.csv");TIP
This is the preferred method for loading user-generated content or saved games on mobile devices.