void Level::load_from_file(const Filename& filename) { clear(); status = GOOD; level_filename = filename.get_rootless(); FileFormat fmt = get_file_format(filename); if (fmt == FORMAT_BINARY) { // load an original .LVL file from L1/ONML/... load_from_binary(filename); } else if (fmt == FORMAT_LEMMINI) { // load an .INI file from Lemmini load_from_lemmini(filename); } else { // load the regular Lix format std::vector <IO::Line> lines; if (IO::fill_vector_from_file(lines, filename.get_rootful())) { load_from_vector(lines); } else status = BAD_FILE_NOT_FOUND; } load_finalize(); }
Data<rating_type, load>::Data(IndexBinaryBuilderLoader* ibb, uint id) : num_ratings(0), ratings(NULL) { load_from_binary(ibb, id); }