KCalendarCore::FileStorage Class
class KCalendarCore::FileStorageThis class provides a calendar storage as a local file. More...
| Header: | #include <KCalendarCore/FileStorage> |
| CMake: | find_package(KF6 REQUIRED COMPONENTS CalendarCore)target_link_libraries(mytarget PRIVATE KF6::CalendarCore) |
| Inherits: | KCalendarCore::CalStorage |
Public Types
Public Functions
| FileStorage(const KCalendarCore::Calendar::Ptr &calendar, const QString &fileName = QString(), KCalendarCore::CalFormat *format = nullptr) | |
| virtual | ~FileStorage() override |
| QString | fileName() const |
| KCalendarCore::CalFormat * | saveFormat() const |
| void | setFileName(const QString &fileName) |
| void | setSaveFormat(KCalendarCore::CalFormat *format) |
Reimplemented Public Functions
| virtual bool | close() override |
| virtual bool | load() override |
| virtual bool | open() override |
| virtual bool | save() override |
Detailed Description
Member Function Documentation
[explicit] FileStorage::FileStorage(const KCalendarCore::Calendar::Ptr &calendar, const QString &fileName = QString(), KCalendarCore::CalFormat *format = nullptr)
Constructs a new FileStorage object for Calendar calendar with format format, and storage to file fileName.
calendar is a pointer to a valid Calendar object.
fileName is the name of the disk file containing the calendar data.
format is a pointer to a valid CalFormat object that specifies the calendar format to be used. FileStorage takes ownership; i.e., the memory for format is deleted by this destructor. If no format is specified, then iCalendar format is assumed.
[override virtual noexcept] FileStorage::~FileStorage()
Destructor.
[override virtual] bool FileStorage::close()
Reimplements: CalStorage::close().
QString FileStorage::fileName() const
Returns the calendar file name.
Returns a QString with the name of the calendar file for this storge.
See also setFileName().
[override virtual] bool FileStorage::load()
Reimplements: CalStorage::load().
[override virtual] bool FileStorage::open()
Reimplements: CalStorage::open().
[override virtual] bool FileStorage::save()
Reimplements: CalStorage::save().
KCalendarCore::CalFormat *FileStorage::saveFormat() const
Returns the CalFormat object used by this storage. Returns A pointer to the CalFormat object used by this storage.
See also setSaveFormat().
void FileStorage::setFileName(const QString &fileName)
Sets the name of the file that contains the calendar data.
fileName is the name of the disk file containing the calendar data.
See also fileName().
void FileStorage::setSaveFormat(KCalendarCore::CalFormat *format)
Sets the CalFormat object to use for this storage.
format is a pointer to a valid CalFormat object that specifies the calendar format to be used. FileStorage takes ownership.
See also saveFormat().