This repository has been archived on 2022-02-10. You can view files and clone it, but cannot push or open issues or pull requests.
titama-backend/lib/server/titamaio.dart
2016-06-25 10:44:10 +02:00

25 lines
477 B
Dart

library titama.io;
import 'dart:io';
import 'dart:convert';
import '../common/messages.dart';
/**
* Class for writing and loading the courses as JSON to a file.
*/
class TitamaIo {
final _filename = "./data.json";
/**
* Write courses as JSON in a file.k
* @param List<Courses> _course List of courses to save.
*/
writeJson(List<Course> _courses) async {
String _json = JSON.encode(_courses);
await new File(_filename).writeAsString(_json);
}
}