summaryrefslogtreecommitdiff
path: root/net/xmlrpc-c-devel/files/patch-tools::xml-rpc-api2cpp::xml-rpc-api2cpp
blob: 95b9194227a6918ca0e4316f13c2ef7452dda639 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
--- tools/xml-rpc-api2cpp/xml-rpc-api2cpp.cc.orig	Thu Apr 12 08:21:38 2001
+++ tools/xml-rpc-api2cpp/xml-rpc-api2cpp.cc	Tue Mar  2 23:39:39 2004
@@ -1,4 +1,4 @@
-#include <iostream.h>
+#include <iostream>
 #include <stdexcept>
 
 #include <XmlRpcCpp.h>
@@ -17,9 +17,9 @@
 //  Connect to a remote server and extract the information we'll need to
 //  build a proxy class.
 
-XmlRpcClass get_class_info (string server_url,
-			    string class_prefix,
-			    string class_name)
+XmlRpcClass get_class_info (std::string server_url,
+			    std::string class_prefix,
+			    std::string class_name)
 {
     // Create a place to store our data.
     XmlRpcClass info(class_name);
@@ -33,22 +33,22 @@
     for (size_t i = 0; i < end; i++) {
 
 	// Break the method name into two pieces.
-	string method_prefix;
-	string function_name;
-	string method_name = methods.arrayGetItem(i).getString();
+	std::string method_prefix;
+	std::string function_name;
+	std::string method_name = methods.arrayGetItem(i).getString();
 	size_t last_dot = method_name.rfind('.');
-	if (last_dot == string::npos) {
+	if (last_dot == std::string::npos) {
 	    function_name = method_name;
 	} else {
-	    method_prefix = string(method_name, 0, last_dot);
-	    function_name = string(method_name, last_dot + 1);
+	    method_prefix = std::string(method_name, 0, last_dot);
+	    function_name = std::string(method_name, last_dot + 1);
 	}
 
 	// Decide whether we care about this function.
 	if (method_prefix == class_prefix) {
 
 	    // Fetch some information about the function.
-	    string help = system.methodHelp(method_name);
+	    std::string help = system.methodHelp(method_name);
 	    XmlRpcValue signature = system.methodSignature(method_name);
 
 	    // Add this function to our class information.
@@ -66,23 +66,23 @@
 //=========================================================================
 //  Print a complete header for the specified class.
 
-void print_header (ostream& out, XmlRpcClass& class_info) {
-    string class_name = class_info.className();
-    out << "// " << class_name << ".h - xmlrpc-c C++ proxy class" << endl;
-    out << "// Auto-generated by xml-rpc-api2cpp." << endl;
-    out << endl;
-
-    string header_symbol = "_" + class_name + "_H_";
-    out << "#ifndef " << header_symbol << endl;
-    out << "#define " << header_symbol << " 1" << endl;
-    out << endl;
-    out << "#include <XmlRpcCpp.h>" << endl;
-    out << endl;
+void print_header (std::ostream& out, XmlRpcClass& class_info) {
+    std::string class_name = class_info.className();
+    out << "// " << class_name << ".h - xmlrpc-c C++ proxy class" << std::endl;
+    out << "// Auto-generated by xml-rpc-api2cpp." << std::endl;
+    out << std::endl;
+
+    std::string header_symbol = "_" + class_name + "_H_";
+    out << "#ifndef " << header_symbol << std::endl;
+    out << "#define " << header_symbol << " 1" << std::endl;
+    out << std::endl;
+    out << "#include <XmlRpcCpp.h>" << std::endl;
+    out << std::endl;
 
-    class_info.printDeclaration(cout);
+    class_info.printDeclaration(std::cout);
 
-    out << endl;
-    out << "#endif /* " << header_symbol << " */" << endl;
+    out << std::endl;
+    out << "#endif /* " << header_symbol << " */" << std::endl;
 }
 
 
@@ -91,16 +91,16 @@
 //=========================================================================
 //  Print a complete header for the specified class.
 
-void print_cc_file (ostream& out, XmlRpcClass& class_info) {
-    string class_name = class_info.className();
-    out << "// " << class_name << ".cc - xmlrpc-c C++ proxy class" << endl;
-    out << "// Auto-generated by xml-rpc-api2cpp." << endl;
-    out << endl;
+void print_cc_file (std::ostream& out, XmlRpcClass& class_info) {
+    std::string class_name = class_info.className();
+    out << "// " << class_name << ".cc - xmlrpc-c C++ proxy class" << std::endl;
+    out << "// Auto-generated by xml-rpc-api2cpp." << std::endl;
+    out << std::endl;
 
-    out << "#include <XmlRpcCpp.h>" << endl;
-    out << "#include \"" << class_name << ".h\"" << endl;
+    out << "#include <XmlRpcCpp.h>" << std::endl;
+    out << "#include \"" << class_name << ".h\"" << std::endl;
 
-    class_info.printDefinition(cout);
+    class_info.printDefinition(std::cout);
 }
 
 
@@ -113,18 +113,18 @@
 
     /* Parse our command-line arguments. */
     if (argc != 4) {
-	cerr << argv[0] << ": Usage:" << endl
+	std::cerr << argv[0] << ": Usage:" << std::endl
 	     << "  xml-rpc-api2cpp <server_url> <method_prefix> <local_class>"
-	     << endl << endl
-	     << "Sample arguments:" << endl
-	     << "  server_url = http://localhost/RPC2" << endl
-	     << "  method_prefix = system" << endl
-	     << "  local_class = SystemProxy" << endl;
+	     << std::endl << std::endl
+	     << "Sample arguments:" << std::endl
+	     << "  server_url = http://localhost/RPC2" << std::endl
+	     << "  method_prefix = system" << std::endl
+	     << "  local_class = SystemProxy" << std::endl;
 	exit(1);
     }
-    string server_url = argv[1];
-    string method_prefix = argv[2];
-    string local_class = argv[3];
+    std::string server_url = argv[1];
+    std::string method_prefix = argv[2];
+    std::string local_class = argv[3];
 
     int status = 0;
     XmlRpcClient::Initialize(NAME, VERSION);
@@ -133,18 +133,18 @@
 	XmlRpcClass system = get_class_info(server_url,
 					    method_prefix,
 					    local_class);
-	print_header(cout, system);
-	cout << endl;
-	print_cc_file(cout, system);
+	print_header(std::cout, system);
+	std::cout << std::endl;
+	print_cc_file(std::cout, system);
     } catch (XmlRpcFault& fault) {
-	cerr << argv[0] << ": XML-RPC fault #" << fault.getFaultCode()
-	     << ": " << fault.getFaultString() << endl;
+	std::cerr << argv[0] << ": XML-RPC fault #" << fault.getFaultCode()
+	     << ": " << fault.getFaultString() << std::endl;
 	status = 1;
-    } catch (logic_error& err) {
-	cerr << argv[0] << ": " << err.what() << endl;
+    } catch (std::logic_error& err) {
+	std::cerr << argv[0] << ": " << err.what() << std::endl;
 	status = 1;
     } catch (...) {
-	cerr << argv[0] << ": Unknown exception" << endl;
+	std::cerr << argv[0] << ": Unknown exception" << std::endl;
 	status = 1;
     }