29 #ifndef __ARCSINTERNALTYPES_H__
30 #define __ARCSINTERNALTYPES_H__
52 virtual QString
toString(QVariant) {
return ""; }
64 if (s.toLower() ==
"true" || s ==
"1" || s.toLower() ==
"t" )
return true;
67 virtual QString
serialize(
bool obj) {
return (obj)?
"true":
"false"; }
78 virtual int parse(QString s) {
return s.toInt(); }
79 virtual QString
serialize(
int obj) {
return QString::number(obj);}
89 virtual short parse(QString s) {
return s.toShort(); }
90 virtual QString
serialize(
short obj) {
return QString::number(obj); }
99 virtual long parse(QString s) {
return s.toLong(); }
100 virtual QString
serialize(
long obj) {
return QString::number(obj); }
109 virtual float parse(QString s) {
return s.toFloat(); }
110 virtual QString
serialize(
float obj) {
return QString::number(obj); }
119 virtual double parse(QString s) {
return s.toDouble(); }
120 virtual QString
serialize(
double obj) {
return QString::number(obj); }
130 virtual QString
parse(QString s) {
return s; }
150 virtual ARCSConstant
parse(QString s) {
return ARCSConstant(s); }
151 virtual QString
serialize(ARCSConstant obj) {
return obj; }
170 virtual ARCSComponent
parse(QString s) {
return ARCSComponent(s); }
171 virtual QString
serialize(ARCSComponent obj) {
return obj; }
182 virtual QSize
parse(QString s) ;
197 QString baseType()
const {
return "bool"; }
209 QString baseType()
const {
return "int"; }
220 QString baseType()
const {
return "short"; }
231 QString baseType()
const {
return "long"; }
242 QString baseType()
const {
return "double"; }
253 QString baseType()
const {
return "string"; }
266 QString baseType()
const {
return "float"; }
271 #endif //__ARCSINTERNALTYPES_H__
virtual QString toString(QVariant)
Should return a string representation of data.
virtual bool isInternal() const
Tells wether the factory is internal or not (false by default).
virtual QString serialize(ARCSComponent obj)
This function serializes an X object to a string.
virtual QString serialize(double obj)
This function serializes an X object to a string.
virtual QString serialize(int obj)
This function serializes an X object to a string.
virtual bool isInternal() const
Tells wether the factory is internal or not (false by default).
virtual bool isInternal() const
Tells wether the factory is internal or not (false by default).
virtual ARCSComponent parse(QString s)
This function should return a X object according to its string representation.
virtual QString getTypeName() const
Should return the name of the type factory.
virtual QString getTypeName() const
Should return the name of the type factory.
virtual double parse(QString s)
This function should return a X object according to its string representation.
virtual short parse(QString s)
This function should return a X object according to its string representation.
virtual bool isInternal() const
Tells wether the factory is internal or not (false by default).
virtual int parse(QString s)
This function should return a X object according to its string representation.
Template class to implement type factories.
virtual bool isInternal() const
Tells wether the factory is internal or not (false by default).
virtual bool parse(QString s)
This function should return a X object according to its string representation.
virtual long parse(QString s)
This function should return a X object according to its string representation.
virtual bool isInternal() const
Tells wether the factory is internal or not (false by default).
virtual QString getTypeName() const
Should return the name of the type factory.
virtual bool isInternal() const
Tells wether the factory is internal or not (false by default).
virtual bool isInternal() const
Tells wether the factory is internal or not (false by default).
virtual bool isInternal() const
Tells wether the factory is internal or not (false by default).
Template class to implement array serialization.
virtual bool isInternal() const
Tells wether the factory is internal or not (false by default).
virtual bool isInternal() const
Tells wether the factory is internal or not (false by default).
virtual bool isInternal() const
Tells wether the factory is internal or not (false by default).
virtual QVariant parseString(QString)
Should create data from their string representation.
virtual QString getTypeName() const
Should return the name of the type factory.
virtual QString serialize(short obj)
This function serializes an X object to a string.
Template class to implement arrays.
virtual QString getTypeName() const
Should return the name of the type factory.
virtual QString serialize(ARCSConstant obj)
This function serializes an X object to a string.
virtual QString getTypeName() const
Should return the name of the type factory.
virtual float parse(QString s)
This function should return a X object according to its string representation.
virtual bool isInternal() const
Tells wether the factory is internal or not (false by default).
Generic class describing how type factories should be implemented.
virtual bool isInternal() const
Tells wether the factory is internal or not (false by default).
virtual QString serialize(QSize s)
This function serializes an X object to a string.
virtual QString getTypeName() const
Should return the name of the type factory.
virtual QString getTypeName() const
Should return the name of the type factory.
virtual QString serialize(long obj)
This function serializes an X object to a string.
virtual QSize parse(QString s)
This function should return a X object according to its string representation.
virtual bool isInternal() const
Tells wether the factory is internal or not (false by default).
virtual QString serialize(QString obj)
This function serializes an X object to a string.
virtual bool isInternal() const
Tells wether the factory is internal or not (false by default).
virtual ARCSConstant parse(QString s)
This function should return a X object according to its string representation.
virtual QString getTypeName() const
Should return the name of the type factory.
virtual QString getTypeName() const
Should return the name of the type factory.
virtual bool isInternal() const
Tells wether the factory is internal or not (false by default).
virtual QString serialize(bool obj)
This function serializes an X object to a string.
virtual QString parse(QString s)
This function should return a X object according to its string representation.
This file defines basic templates in order to make arrays of new types available to the ARCS engine...
virtual QString getTypeName() const
Should return the name of the type factory.
virtual QString serialize(float obj)
This function serializes an X object to a string.
virtual bool isInternal() const
Tells wether the factory is internal or not (false by default).