Changeset 464 for cpp/frams/vm


Ignore:
Timestamp:
02/07/16 04:09:36 (9 years ago)
Author:
Maciej Komosinski
Message:

Serialization of basic object types in JSON format

Location:
cpp/frams/vm/classes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/vm/classes/collectionobj.cpp

    r453 r464  
    154154}
    155155
    156 SString VectorObject::serialize() const
     156SString VectorObject::serialize(SerializationFormat format) const
    157157{
    158158SString out="[";
     
    163163                if (i) out+=",";
    164164                if (v)
    165                         out+=v->serialize();
     165                        out+=v->serialize(format);
    166166                else
    167167                        out+="null";
     
    413413}
    414414
    415 SString DictionaryObject::serialize() const
     415SString DictionaryObject::serialize(SerializationFormat format) const
    416416{
    417417SString out="{";
     
    424424                out+="\":";
    425425                if (it->value!=NULL)
    426                         out+=((ExtValue*)it->value)->serialize();
     426                        out+=((ExtValue*)it->value)->serialize(format);
    427427                else
    428428                        out+="null";
  • cpp/frams/vm/classes/collectionobj.h

    r453 r464  
    4242static void p_new(void*,ExtValue*args,ExtValue*ret)
    4343        {ret->setObject(ExtObject(&par,new VectorObject));}
    44 SString serialize() const;
     44SString serialize(SerializationFormat format) const;
    4545ExtObject makeObject() {return ExtObject(&par,this);}
    4646
     
    7373PARAMPROCDEF(p_clone);
    7474#undef STATRICKCLASS
    75 SString serialize() const;
     75SString serialize(SerializationFormat format) const;
    7676static void p_new(void*,ExtValue*args,ExtValue*ret)
    7777        {ret->setObject(ExtObject(&par,new DictionaryObject));}
Note: See TracChangeset for help on using the changeset viewer.