Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
ms_http_helper_response.hpp
1/*
2##############################################################################
3# file: ms_http_helper_response.hpp #
4# 'msparser' toolkit #
5# Hold a response from a Mascot server function invocation #
6##############################################################################
7# COPYRIGHT NOTICE #
8# Copyright 1998-2013 Matrix Science Limited All Rights Reserved. #
9# #
10##############################################################################
11 * @(#)$Source: parser/inc/ms_http_helper_response.hpp $
12 * @(#)$Revision: 1b450440f9c97e1e41d0fc6016a27d68951d4532 | MSPARSER_REL_3_0_0-2024-09-24-0-g93ebaeb4f4 $
13 * @(#)$Date: 2018-07-30 16:23:53 +0100 $
14##############################################################################
15 */
16
17#ifndef MS_HTTP_HELPER_RESPONSE_HPP
18#define MS_HTTP_HELPER_RESPONSE_HPP
19
20
21#include <map>
22#include <string>
23
24namespace matrix_science
25{
31 class MS_MASCOTRESFILE_API ms_http_helper_response
32 {
33 public:
35 enum StatusCode {
36 S_SUCCESS = 0,
37 S_LOGINERROR = 1,
38 S_PARSERERROR = 2,
39 S_SERVERERROR = 3,
40 S_MISSING = 4
41 };
42
44
47 enum LoginErrorCode {
48 L_SUCCESS = 0,
49 L_PARAMETER = -1,
50 L_NOT_AUTHORISED = -2,
51 L_SECURITYENABLED = -3,
52 L_WEBAUTHENTICATIONDISABLED = -4,
53 L_GUESTLOGINDISABLED = -5
54 };
55
56#ifndef SWIG
57 // C++ STL collection support.
58 ms_http_helper_response();
59#endif
61 ms_http_helper_response(const std::string & text);
62
64 virtual ~ms_http_helper_response();
65
67 StatusCode getStatus() const;
68 StatusCode status() const { return getStatus(); } // Deprecated and undocumented - not a normal Parser function name
69
71 LoginErrorCode getLoginError() const;
72 LoginErrorCode loginError() const { return getLoginError(); } // Deprecated and undocumented - not a normal Parser function name
73
75 long getParserError() const;
76 long parserError() const { return getParserError(); } // Deprecated and undocumented - not a normal Parser function name
77
79 bool hasErrorText() const;
80
82 std::string getErrorText() const;
83 std::string errorText() const { return getErrorText(); } // Deprecated and undocumented - not a normal Parser function name
84
86 bool hasSessionId() const;
87
89 std::string getSessionID() const;
90 std::string sessionId() const { return getSessionID(); } // Deprecated and undocumented - not a normal Parser function name
91
93 bool hasTaskId() const;
94
96 std::string getTaskID() const;
97 std::string taskId() const { return getTaskID(); } // Deprecated and undocumented - not a normal Parser function name
98
100 std::string getText() const;
101 std::string text() const { return getText(); } // Deprecated and undocumented - not a normal Parser function name
102#ifndef SWIG
104 bool findValue(const std::string & label, std::string & valueFromLabel) const;
105#else // SWIG Multiple return values
106 bool findValue(const std::string & label, std::string & OUTPUT) const;
107#endif
108 private:
109 std::string text_;
110
111 StatusCode status_;
112 LoginErrorCode loginError_;
113 long parserError_;
114
115 bool hasErrorText_;
116 std::string errorText_;
117 bool hasSessionId_;
118 std::string sessionId_;
119 bool hasTaskId_;
120 std::string searchTaskId_;
121
122 std::map<std::string, std::string> values_;
123 };
124 // end of http_client_group
126} // namespace matrix_science
127
128#endif // MS_HTTP_HELPER_RESPONSE_HPP
129
130/*------------------------------- End of File -------------------------------*/