Exemple #1
0
Character::Character(Node *parent, PersistentStore &store, bool) :
	Node(parent)
{
	QString t = store.loadStringValue();
	if (t.size() != 1) throw ModelException("Creating character node failed. Invalid persistent store data: " + t);

	value = t[0];
}
Exemple #2
0
void Character::load(PersistentStore &store)
{
	if (store.currentNodeType() != typeName())
		throw ModelException("Trying to load a Character node from an incompatible node type " + store.currentNodeType());

	QString t = store.loadStringValue();
	if (t.size() != 1) throw ModelException("Loading character node failed. Invalid persistent store data: " + t);

	set(t[0]);
}