Detailed Method Reference
Namespace: Canley.Utility.CSV.Standard
Class: CSVTable<T>
Definition
public bool SaveTable(CanleyCSVManager manager, string path)-
Description: Manually serialises the table’s records into a CSV string and saves them directly to an explicit file path or filename via the manager.
-
Workflow:
- Manager Validation: Verifies that the supplied
CanleyCSVManagerreference is valid before proceeding with export operations. - Grid Generation: Calls
GetRawGridto compile all current record states, unmapped properties, and shadow dictionary keys into a structured string matrix. - RFC 4180 Serialization: Passes the grid into
CanleyCSVWriter.Exportto produce a properly formatted CSV text block. - Disk Write: Invokes
manager.SaveToFileto write the string contents to disk, logging success or failure states accordingly.
- Manager Validation: Verifies that the supplied
-
Parameters:
manager: TheCanleyCSVManagerinstance handling file I/O operations.path: The exact target file path or filename to write the export data toward.
-
Returns:
bool- Returnstrueif the file write operation succeeds;falseotherwise. -
Example:
public void ExportBackupSave(CSVTable<PlayerSaveRecord> saveTable, CanleyCSVManager csvManager)
{
string customPath = System.IO.Path.Combine(Application.persistentDataPath, "Backups/player_backup.csv");
bool success = saveTable.SaveTable(csvManager, customPath);
if (success)
{
Debug.Log(message: "Backup save file written successfully.");
}
}TIP
Use this override overload when you need to export data to custom user directories, export slots, or backup locations outside of the standard automatic naming convention.