/**
 * Copyright (c) 2021 Dominic Masters
 * 
 * This software is released under the MIT License.
 * https://opensource.org/licenses/MIT
 */

#pragma once
#include "../libs.h"
#include "../file/asset.h"
#include "../file/csv.h"

/** Column name for the KEY within the CSV */
#define LANGUAGE_HEADER_KEY "Key"
/** Column name for the VALUE within the CSV */
#define LANGUAGE_HEADER_VALUE "Value"

/** Definition for a Language */
typedef struct {
  /** The buffer to read the asset from. */
  assetbuffer_t *asset;
  /** CSV Row for the header */
  csvrow_t header;
  /** The index in the header row that the key column is in. */
  int32_t headerIndexKey;
  /** The index in the header row that the value column is in. */
  int32_t headerIndexValue;
} language_t;

typedef struct {
  language_t *language;
  csvrow_t *row;
  char *key;
} languagecsvget_t;