PInviteUserREQ.cpp
Upload User: popouu88
Upload Date: 2013-02-11
Package Size: 2894k
Code Size: 1k
Category:

VOIP program

Development Platform:

Visual C++

  1. // PInviteUserREQ.cpp: implementation of the PInviteUserREQ class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #include "PInviteUserREQ.h"
  5. //////////////////////////////////////////////////////////////////////
  6. // Construction/Destruction
  7. //////////////////////////////////////////////////////////////////////
  8. PInviteUserREQ::PInviteUserREQ()
  9. {
  10. this->Tag = PInviteUserREQTAG;
  11. this->charement_id = 0;
  12. this->user_id = 0;
  13. this->prompt = false;
  14. }
  15. PInviteUserREQ::~PInviteUserREQ()
  16. {
  17. }
  18. bool PInviteUserREQ::assembleData( int charement_id , int user_id , bool prompt )
  19. {
  20. this->buffer.Resize( 5 * INT_SIZE );
  21. char * now = this->buffer.GetBuffer( );
  22. *( int * )now = this->buffer.GetSize( ); now += INT_SIZE;
  23. *( int * )now = this->Tag; now += INT_SIZE;
  24. *( int * )now = charement_id ; now += INT_SIZE;
  25. *( int * )now = user_id; now += INT_SIZE;
  26. *( int * )now = ( int )prompt;
  27. return true;
  28. }
  29. bool PInviteUserREQ::parseData( CBuffer & buffer )
  30. {
  31. if( ! buffer.GetSize( ) ) return false;
  32. char * now = buffer.GetBuffer( ) + 2 * INT_SIZE;
  33. this->charement_id = *( int * )now; now += INT_SIZE;
  34. this->user_id = *( int * )now; now += INT_SIZE;
  35. this->prompt = ( bool ) * ( int * )now;
  36. return true;
  37. }