SmartFoxServer 2X C++ API
SFSErrorCodes.h
1 // ===================================================================
2 //
3 // Description
4 // Contains the definition of SFSErrorCodes
5 //
6 // Revision history
7 // Date Description
8 // 30-Nov-2012 First version
9 //
10 // ===================================================================
11 #ifndef __SFSErrorCodes__
12 #define __SFSErrorCodes__
13 
14 #include "./Common.h"
15 #include "../Logging/Logger.h"
16 
17 #include <boost/shared_ptr.hpp> // Boost Asio shared pointer
18 
19 #if defined(_MSC_VER)
20 #pragma warning(disable:4786) // STL library: disable warning 4786; this warning is generated due to a Microsoft bug
21 #endif
22 #include <string> // STL library: string object
23 #include <vector> // STL library: vector object
24 using namespace std; // STL library: declare the STL namespace
25 
26 using namespace Sfs2X::Logging;
27 
28 namespace Sfs2X {
29 namespace Util {
30 
41  /* static */ class DLLImportExport SFSErrorCodes
42  {
43  public:
44 
45  // -------------------------------------------------------------------
46  // Public methods
47  // -------------------------------------------------------------------
48 
49  static boost::shared_ptr<string> GetErrorMessage(long int code, boost::shared_ptr<Logger> log, boost::shared_ptr<vector<string> > args);
50  static void SetErrorMessage(long int code, string message);
51  static void Dispose();
52 
53  // -------------------------------------------------------------------
54  // Public members
55  // -------------------------------------------------------------------
56 
57  protected:
58 
59  // -------------------------------------------------------------------
60  // Protected methods
61  // -------------------------------------------------------------------
62 
63  // -------------------------------------------------------------------
64  // Protected members
65  // -------------------------------------------------------------------
66 
67 
68  private:
69 
70  // -------------------------------------------------------------------
71  // Private methods
72  // -------------------------------------------------------------------
73 
74  // -------------------------------------------------------------------
75  // Private members
76  // -------------------------------------------------------------------
77  static string* errorsByCode[];
78 
79  static const int NUM_ENTRIES_errorsByCode = 43;
80 
81  };
82 
83 } // namespace Util
84 } // namespace Sfs2X
85 
86 #endif
Definition: Logger.cpp:14
STL namespace.
Provides a mean of translation between Server error codes and their relative error messages...
Definition: SFSErrorCodes.h:41
Definition: SmartFox.cpp:24