Detailed Method Reference

Namespace: Canley.Utility.CSV.Standard
Class: CSVTable<T>

Definition

public bool SaveTable(CanleyCSVManager manager)
  • Description: Automatically resolves the target file name using the Hierarchy of Truth (Memory, Inspector, Class Name) and delegates to the path-based save routine.

  • Workflow:

    1. Memory Check: Evaluates the active file name stored from the last successful load operation.
    2. Fallback Resolution: Falls back to the manager’s target file slot if memory is empty, or defaults to the C# class name (typeof(T).Name) as a final safety net.
    3. Extension Enforcement: Appends a .csv extension if one is missing from the target string.
    4. Delegation: Forwards the resolved path and manager instance to the core file persistence overload.
  • Parameters:

    • manager: The CanleyCSVManager instance handling file I/O operations.
  • Returns: bool - Returns true if the file write operation succeeds; false otherwise.

  • Example:

public void AutoSaveInventory(CSVTable<ItemRecord> inventoryTable, CanleyCSVManager csvManager)
{
    bool success = inventoryTable.SaveTable(csvManager);
    if (success)
    {
        Debug.Log(message: "Inventory automatically saved using resolved naming conventions.");
    }
}

TIP

Use this parameterless overload for standard game saves or auto-saves where you want the table to automatically figure out the correct file name based on its load history or class structure.