Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Object deserialization:
- if(objID == 0) {
- int32_t count;
- Handle<ObjectTemplate> rootobj = ObjectTemplate::New();
- memcpy(&count,input+(*offsetptr),sizeof(int32_t));
- (*offsetptr)+=sizeof(int32_t);
- for(int i = 0;i<count;i++) {
- int32_t stlen;
- memcpy(&stlen,input+(*offsetptr),sizeof(int32_t));
- (*offsetptr)+=sizeof(int);
- char* str = new char[stlen];
- memcpy(str,input+(*offsetptr),stlen);
- (*offsetptr)+=stlen;
- Handle<Value> tval = DeserializeObject(input,offsetptr);
- rootobj->Set(String::New(str,stlen),tval);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement