inkcpp
Toggle main menu visibility
Loading...
Searching...
No Matches
snapshot.h
1
/* Copyright (c) 2024 Julian Benda
2
*
3
* This file is part of inkCPP which is released under MIT license.
4
* See file LICENSE.txt or go to
5
* https://github.com/JBenda/inkcpp for full license details.
6
*/
7
#pragma once
8
9
#include "types.h"
10
11
namespace
ink::runtime
12
{
58
class
snapshot
59
{
60
public
:
61
virtual
~snapshot
(){};
62
71
static
snapshot
*
from_binary
(
const
unsigned
char
* data,
size_t
length,
bool
freeOnDestroy =
true
);
72
74
virtual
const
unsigned
char
*
get_data
()
const
= 0;
76
virtual
size_t
get_data_len
()
const
= 0;
78
virtual
size_t
num_runners
()
const
= 0;
81
virtual
bool
can_be_migrated
()
const
= 0;
82
83
#ifdef INK_ENABLE_STL
88
static
snapshot
*
from_file
(
const
char
* filename);
93
void
write_to_file
(
const
char
* filename)
const
;
94
#endif
95
};
96
}
// namespace ink::runtime
ink::runtime::snapshot
Container for an InkCPP runtime snapshot, which can be migrated.
Definition
snapshot.h:59
ink::runtime::snapshot::from_file
static snapshot * from_file(const char *filename)
deserialize snapshot from file.
ink::runtime::snapshot::get_data_len
virtual size_t get_data_len() const =0
size of blob inside snapshot
ink::runtime::snapshot::write_to_file
void write_to_file(const char *filename) const
serialize snapshot to file
ink::runtime::snapshot::num_runners
virtual size_t num_runners() const =0
number of runners which are stored inside this snapshot
ink::runtime::snapshot::can_be_migrated
virtual bool can_be_migrated() const =0
if this snapshot can be migrated, if the story file changes (slightly), for details see Migration.
ink::runtime::snapshot::from_binary
static snapshot * from_binary(const unsigned char *data, size_t length, bool freeOnDestroy=true)
Construct snapshot from blob.
ink::runtime::snapshot::get_data
virtual const unsigned char * get_data() const =0
access blob inside snapshot
ink::runtime
Contaning all modules and classes used for the inkles ink runtime.
Definition
choice.h:13
inkcpp
include
snapshot.h
Generated by
1.17.0