Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2012
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1.     Object deserialization:
  2.     if(objID == 0) {
  3.                 int32_t count;
  4.                
  5.                 Handle<ObjectTemplate> rootobj = ObjectTemplate::New();
  6.                
  7.                 memcpy(&count,input+(*offsetptr),sizeof(int32_t));
  8.                 (*offsetptr)+=sizeof(int32_t);
  9.             for(int i = 0;i<count;i++) {
  10.                 int32_t stlen;
  11.                 memcpy(&stlen,input+(*offsetptr),sizeof(int32_t));
  12.                 (*offsetptr)+=sizeof(int);
  13.                 char* str = new char[stlen];
  14.                 memcpy(str,input+(*offsetptr),stlen);
  15.                 (*offsetptr)+=stlen;
  16.                 Handle<Value> tval = DeserializeObject(input,offsetptr);
  17.                
  18.                 rootobj->Set(String::New(str,stlen),tval);
  19.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement