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:

    1. Manager Validation: Verifies that the supplied CanleyCSVManager reference is valid before proceeding with export operations.
    2. Grid Generation: Calls GetRawGrid to compile all current record states, unmapped properties, and shadow dictionary keys into a structured string matrix.
    3. RFC 4180 Serialization: Passes the grid into CanleyCSVWriter.Export to produce a properly formatted CSV text block.
    4. Disk Write: Invokes manager.SaveToFile to write the string contents to disk, logging success or failure states accordingly.
  • Parameters:

    • manager: The CanleyCSVManager instance handling file I/O operations.
    • path: The exact target file path or filename to write the export data toward.
  • Returns: bool - Returns true if the file write operation succeeds; false otherwise.

  • 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.