Exemple #1
0
void Integer::load(PersistentStore &store)
{
	if (store.currentNodeType() != typeName())
		throw ModelException("Trying to load an Integer node from an incompatible node type " + store.currentNodeType());

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

	set(store.loadDoubleValue());
}
Exemple #3
0
void Boolean::load(PersistentStore &store)
{
	if (store.currentNodeType() != typeName())
		throw ModelException("Trying to load an Boolean node from an incompatible node type " + store.currentNodeType());

	bool val = store.loadIntValue();
	set(val);
}
Exemple #4
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]);
}
Exemple #5
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 #6
0
void Boolean::save(PersistentStore &store) const
{
	store.saveIntValue( value ? 1 : 0);
}
Exemple #7
0
Boolean::Boolean(Node *parent, PersistentStore &store, bool) :
	Node(parent)
{
	value = store.loadIntValue() != 0;
}
Exemple #8
0
void Float::save(PersistentStore &store) const
{
	store.saveDoubleValue(value);
}
Exemple #9
0
Float::Float(Node *parent, PersistentStore &store, bool) :
	Node(parent)
{
	value = store.loadDoubleValue();
}
Exemple #10
0
void Character::save(PersistentStore &store) const
{
	store.saveStringValue(QString(value));
}
Exemple #11
0
void Integer::save(PersistentStore &store) const
{
	store.saveIntValue(integer);
}
Exemple #12
0
Integer::Integer(Node *parent, PersistentStore &store, bool) : Super(parent)
{
	integer = store.loadIntValue();
}