S32 LLMultiGesture::getMaxSerialSize() const { S32 max_size = 0; // ascii format, being very conservative about possible // label lengths. max_size += 64; // version S32 max_size += 64; // key U8 max_size += 64; // mask U32 max_size += 256; // trigger string max_size += 256; // replace string max_size += 64; // step count S32 std::vector<LLGestureStep*>::const_iterator it; for (it = mSteps.begin(); it != mSteps.end(); ++it) { LLGestureStep* step = *it; max_size += 64; // type S32 max_size += step->getMaxSerialSize(); } /* binary format max_size += sizeof(S32); // version max_size += sizeof(mKey); max_size += sizeof(mMask); max_size += mTrigger.length() + 1; // for null max_size += sizeof(S32); // step count std::vector<LLGestureStep*>::const_iterator it; for (it = mSteps.begin(); it != mSteps.end(); ++it) { LLGestureStep* step = *it; max_size += sizeof(S32); // type max_size += step->getMaxSerialSize(); } */ return max_size; }