* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:record_drivers Wiki */ namespace VuFind\Marc\Serialization; /** * MARC serialization file interface. * * @category VuFind * @package MARC * @author Ere Maijala * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:record_drivers Wiki */ interface SerializationFileInterface { /** * Check if the serialization class can parse the given MARC collection file * * @param string $file File name * * @return bool */ public static function canParseCollectionFile(string $file): bool; /** * Set message callback * * @param callable $callback Message callback * * @return void */ public function setMessageCallback(?callable $callback): void; /** * Open a collection file * * @param string $file File name * * @return void * * @throws \Exception */ public function openCollectionFile(string $file): void; /** * Rewind the collection file * * @return void * * @throws \Exception */ public function rewind(): void; /** * Get next record from the file or an empty string on EOF * * @return string * * @throws \Exception */ public function getNextRecord(): string; }