#include "stdio-serialization.h" namespace artery_font { namespace internal { inline int fileRead(void *buffer, int length, void *file) { return fread(buffer, 1, length, reinterpret_cast(file)); } inline int fileWrite(const void *buffer, int length, void *file) { return fwrite(buffer, 1, length, reinterpret_cast(file)); } } template class LIST, class BYTE_ARRAY, class STRING> bool read(ArteryFont &font, FILE *file) { return decode(font, file); } template class LIST, class BYTE_ARRAY, class STRING> bool write(const ArteryFont &font, FILE *file) { return encode(font, file); } template class LIST, class BYTE_ARRAY, class STRING> bool readFile(ArteryFont &font, const char *filename) { FILE *file = fopen(filename, "rb"); if (!file) return false; bool result = read(font, file); fclose(file); return result; } template class LIST, class BYTE_ARRAY, class STRING> bool writeFile(const ArteryFont &font, const char *filename) { FILE *file = fopen(filename, "wb"); if (!file) return false; bool result = write(font, file); fclose(file); return result; } }