This class provides methods to handle CSV files.

Hierarchy

  • CSVManager

Constructors

Methods

Constructors

Methods

  • Loads the contents of a CSV file from a given path and returns them as an Array of JSONObjects.

    Throws

    IllegalArgumentError if the path or the delimiter is empty

    Parameters

    • path: string

      The path to the CSV file (including the file name and extension).

    • delimiter: string

      The symbol that separates the values in the CSV file.

    • decimal: string

      The symbol that separates the integer part from the decimal part of a number.

    • Optional thousands: string

      The symbol that separates the thousands of a number.

    Returns any[] | IllegalArgumentError

    JSONObject[] the CSV contents

  • Converts the given buildings to a CSV file and saves it to the given path.

    Throws

    IllegalArgumentError if the file could not be saved

    Parameters

    • path: string

      The location where the CSV file should be saved (should include the file name and extension)

    • buildings: Building[]

      The buildings that should be converted to a CSV file

    Returns true | IllegalArgumentError

    true if the CSV file was successfully saved

Generated using TypeDoc