Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
ms_http_helper_return.hpp
1/*
2##############################################################################
3# file: ms_http_helper_return.hpp #
4# 'msparser' toolkit #
5# Hold a response from an internet function #
6##############################################################################
7# COPYRIGHT NOTICE #
8# Copyright 1998-2013 Matrix Science Limited All Rights Reserved. #
9# #
10##############################################################################
11 * @(#)$Source: parser/inc/ms_http_helper_return.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_RETURN_HPP
18#define MS_HTTP_HELPER_RETURN_HPP
19
20
21#include <string>
22
23namespace matrix_science
24{
31
36 class MS_MASCOTRESFILE_API ms_http_helper_return
37 {
38 public:
40
44 {
49 ERR_UNSPECIFIED
50 };
51
53 static ms_http_helper_return systemError(int systemError);
55 static ms_http_helper_return httpError(int httpStatusCode, std::string errorText);
57 static ms_http_helper_return unspecifiedError();
59 static ms_http_helper_return abortedByUser();
60
61#ifndef SWIG
64#endif
65
67 bool isOk() const;
68#ifndef SWIG
70 operator bool () const;
71#endif
72
74 ErrorTypeCode getErrorType() const;
75 ErrorTypeCode errorType() const { return getErrorType(); } // Deprecated and undocumented - not a normal Parser function name
76
78 int getSystemError() const;
79 int systemError() const { return getSystemError(); } // Deprecated and undocumented - not a normal Parser function name
80
82 int getHttpStatusCode() const;
83 int httpStatusCode() const { return getHttpStatusCode(); } // Deprecated and undocumented - not a normal Parser function name
84
86 std::string getErrorText() const;
87 std::string errorText() const { return getErrorText(); } // Deprecated and undocumented - not a normal Parser function name
88
89 private:
90 ErrorTypeCode errorType_;
91 int systemError_;
92 int httpStatusCode_;
93 std::string errorText_;
94 };
95 // end of http_client_group
97} // namespace matrix_science
98
99#endif // MS_HTTP_HELPER_RETURN_HPP
100
101/*------------------------------- End of File -------------------------------*/
Indicates any problem that may have occurred during a request to an ms_http_helper object.
Definition: ms_http_helper_return.hpp:37
ErrorTypeCode
Definitions for types of problem that can be encountered.
Definition: ms_http_helper_return.hpp:44
@ ERR_SYSTEM
A problem was found with one of the operating system functions.
Definition: ms_http_helper_return.hpp:47
@ ERR_NONE
No problem was encountered; the operation completed successfully.
Definition: ms_http_helper_return.hpp:45
@ ERR_ABORTEDBYUSER
The operation was aborted prematurely at the request of the operator.
Definition: ms_http_helper_return.hpp:46
@ ERR_HTTP
A problem was reported via the HTTP channel.
Definition: ms_http_helper_return.hpp:48