Exemple #1
0
Common::String *Datum::toString() {
	Common::String *s = new Common::String;
	switch (type) {
	case INT:
		s->format("%d", u.i);
		break;
	case FLOAT:
		s->format(g_lingo->_floatPrecisionFormat.c_str(), u.f);
		break;
	case STRING:
		delete s;
		s = u.s;
		break;
	default:
		warning("Incorrect operation toString() for type: %s", type2str());
	}

	u.s = s;
	type = STRING;

	return u.s;
}
void BasePersistenceManager::putDouble(double val) {
	Common::String str = Common::String::format("D%f", val);
	str.format("D%f", val);
	_saveStream->writeUint32LE(str.size());
	_saveStream->writeString(str);
}