mpd/src/BulkEdit.hxx

29 lines
573 B
C++
Raw Normal View History

// SPDX-License-Identifier: GPL-2.0-or-later
// Copyright The Music Player Daemon Project
#ifndef MPD_BULK_EDIT_HXX
#define MPD_BULK_EDIT_HXX
#include "Partition.hxx"
/**
* Begin a "bulk edit" and commit it automatically.
*/
class ScopeBulkEdit {
Partition &partition;
public:
ScopeBulkEdit(Partition &_partition):partition(_partition) {
partition.playlist.BeginBulk();
}
~ScopeBulkEdit() {
partition.playlist.CommitBulk(partition.pc);
}
2023-11-26 08:47:04 +01:00
ScopeBulkEdit(const ScopeBulkEdit &) = delete;
ScopeBulkEdit &operator=(const ScopeBulkEdit &) = delete;
};
#endif