libiqxmlrpc  0.12.4
 All Classes Namespaces Files Functions Typedefs Enumerations
response.h
1 // Libiqxmlrpc - an object-oriented XML-RPC solution.
2 // Copyright (C) 2011 Anton Dedov
3 
4 #ifndef _iqxmlrpc_response_h_
5 #define _iqxmlrpc_response_h_
6 
7 #include <boost/shared_ptr.hpp>
8 #include <string>
9 #include "api_export.h"
10 
11 namespace iqxmlrpc {
12 
13 class Response;
14 class Value;
15 
16 #ifdef _MSC_VER
17 #pragma warning(push)
18 #pragma warning(disable: 4251)
19 #endif
20 
22 LIBIQXMLRPC_API Response parse_response( const std::string& );
23 
25 LIBIQXMLRPC_API std::string dump_response( const Response& );
26 
28 class LIBIQXMLRPC_API Response {
29 public:
30  Response( Value* );
31  Response( int fault_code, const std::string& fault_string );
32 
34  const Value& value() const;
35 
37  bool is_fault() const { return !value_; }
39  int fault_code() const { return fault_code_; }
41  const std::string& fault_string() const { return fault_string_; }
42 
43 private:
44  boost::shared_ptr<Value> value_;
45  int fault_code_;
46  std::string fault_string_;
47 };
48 
49 #ifdef _MSC_VER
50 #pragma warning(pop)
51 #endif
52 
53 } // namespace iqxmlrpc
54 
55 #endif