#ifndef LOTRO_DAT_SUBFILE_H
#define LOTRO_DAT_SUBFILE_H

#include "binarydata.h"
#include "subfiledata.h"

#include <string>

namespace LOTRO_DAT {

enum FILE_TYPE {
  TEXT,
  JPG,
  DDS,
  WAV,
  OGG,
  FONT,
  UNKNOWN
};

FILE_TYPE FileTypeFromString(std::string ext);

FILE_TYPE FileTypeFromFileContents(int file_id, const BinaryData& file_data);

std::string StringFromFileType(FILE_TYPE type);

BinaryData BuildForImport(const BinaryData& old_data, const SubfileData& outer_data);

SubfileData BuildForExport(int file_id, const BinaryData& inner_data);

namespace Subfiles {

template<FILE_TYPE type> 
class Subfile {
 public:
  static BinaryData BuildForImport(const BinaryData& old_data, const SubfileData& outer_data);

  static SubfileData BuildForExport(const BinaryData& inner_data);
};

}; // namespace Subfiles
}; // namespace LOTRO_DAT

#endif // LOTRO_DAT_SUBFILE_H