2025-04-28 15:24:06 +02:00

50 lines
1.3 KiB
C

#ifndef EDAPI_JOURNAL_FILE_H
#define EDAPI_JOURNAL_FILE_H
#include <edapi/error.h>
#include <glib.h>
#include <glib-object.h>
G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE(EDJournalFile, ed_journal_file, ED, JOURNALFILE, GObject);
#define ED_TYPE_JOURNALFILE ed_journal_file_get_type()
EDJournalFile *ed_journal_file_new(void);
EDErrorCode ed_journal_file_parse_filename(
char const *basename,
gchar **date,
gint *part
);
/**
* Opens the given journal file, and peeks into it. This
* function fails if the given file cannot be opened. Loading
* entries is a time consuming task (especially with multiple
* files in a journal), so this function only peeks the first
* few entries to figure out game version and CMDR name.
*/
EDErrorCode ed_journal_file_open(EDJournalFile *file,
char const *filename,
GError **error);
/**
* Load all entries from this given journal.
*/
EDErrorCode ed_journal_file_load(EDJournalFile *self, GError **error);
GDateTime *ed_journal_file_get_datetime(EDJournalFile *self);
gchar const *ed_journal_file_get_commander(EDJournalFile *self);
gchar const *ed_journal_file_get_gameversion(EDJournalFile *self);
gint ed_journal_file_compare(EDJournalFile *lhs, EDJournalFile *rhs);
G_END_DECLS
#endif