//
//  GSFont+SerialSave.h
//  GlyphsCore
//
//  Created by Georg Seifert on 31/01/16.
//  Copyright © 2016 schriftgestaltung.de. All rights reserved.
//

#import <GlyphsCore/GSFont.h>

@class GSSaveContext;

NS_ASSUME_NONNULL_BEGIN

BOOL writeElements(FILE *file, char *key, NSArray * _Nullable elements, GSFormatVersion format, GSSaveContext *context, NSError **error);

BOOL writeElementsLine(FILE *file, char *key, NSArray * _Nullable elements, GSFormatVersion format, GSSaveContext *context, NSError **error);

@interface GSFont (SerialSave)

- (BOOL)saveToURL:(NSURL *)url type:(GSPackageType)type error:(out NSError **)outError;

+ (NSArray *)filterLegacyDefaultProperties:(NSArray *)properties filterKeys:(NSArray *)filterKeys format:(GSFormatVersion)formatVersion;

- (GSSaveContext *)saveContextForURL:(NSURL *)url type:(GSPackageType)type;

- (BOOL)saveToURL:(NSURL *)url type:(GSPackageType)type format:(GSFormatVersion)formatVersion context:(GSSaveContext *)context error:(out NSError **)outError;

@end

NS_ASSUME_NONNULL_END
