SmartFoxServer 2X C++ API
BlockBuddyRequest.h
1 // ===================================================================
2 //
3 // Description
4 // Contains the definition of BlockBuddyRequest
5 //
6 // Revision history
7 // Date Description
8 // 30-Nov-2012 First version
9 //
10 // ===================================================================
11 #ifndef __BlockBuddyRequest__
12 #define __BlockBuddyRequest__
13 
14 #include "../../Util/Common.h"
15 #include "../BaseRequest.h"
16 #include "../../Exceptions/SFSValidationError.h"
17 
18 #include <boost/shared_ptr.hpp> // Boost Asio shared pointer
19 
20 #if defined(_MSC_VER)
21 #pragma warning(disable:4786) // STL library: disable warning 4786; this warning is generated due to a Microsoft bug
22 #endif
23 #include <list> // STL library: list object
24 #include <string> // STL library: string object
25 using namespace std; // STL library: declare the STL namespace
26 
27 namespace Sfs2X {
28 namespace Requests {
29 namespace Buddylist {
30 
37  class DLLImportExport BlockBuddyRequest : public BaseRequest
38  {
39  public:
40 
41  // -------------------------------------------------------------------
42  // Public methods
43  // -------------------------------------------------------------------
44 
91  BlockBuddyRequest(string buddyName, bool blocked);
92 
93  virtual ~BlockBuddyRequest();
94 
95  void Validate(boost::shared_ptr<SmartFox> sfs);
96 
97  void Execute(boost::shared_ptr<SmartFox> sfs);
98 
99  // -------------------------------------------------------------------
100  // Public members
101  // -------------------------------------------------------------------
102 
103  static boost::shared_ptr<string> KEY_BUDDY_NAME;
104 
105  static boost::shared_ptr<string> KEY_BUDDY_BLOCK_STATE;
106 
107  static boost::shared_ptr<string> KEY_BUDDY;
108 
109  protected:
110 
111  // -------------------------------------------------------------------
112  // Protected methods
113  // -------------------------------------------------------------------
114 
115  // -------------------------------------------------------------------
116  // Protected members
117  // -------------------------------------------------------------------
118 
119  private:
120 
121  // -------------------------------------------------------------------
122  // Private methods
123  // -------------------------------------------------------------------
124 
125  // -------------------------------------------------------------------
126  // Private members
127  // -------------------------------------------------------------------
128  boost::shared_ptr<string> buddyName;
129  bool blocked;
130  };
131 
132 } // namespace Buddylist
133 } // namespace Requests
134 } // namespace Sfs2X
135 
136 #endif
STL namespace.
Definition: SmartFox.cpp:24
Block/Unblock a Buddy in the User&#39;s BuddyList
Definition: BlockBuddyRequest.h:37