BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
TestBase64Client.cpp File Reference
#include "XmlRpc.h"
#include <iostream>
#include <fstream>
#include <stdlib.h>

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 15 of file TestBase64Client.cpp.

16{
17 if (argc != 4) {
18 std::cerr << "Usage: TestBase64Client serverHost serverPort outputFile\n";
19 return -1;
20 }
21 int port = atoi(argv[2]);
22
23 //XmlRpc::setVerbosity(5);
24 XmlRpcClient c(argv[1], port);
25
26 XmlRpcValue noArgs, result;
27 if (c.execute("TestBase64", noArgs, result))
28 {
29 const XmlRpcValue::BinaryData& data = result;
30 std::ofstream outfile(argv[3], std::ios::binary | std::ios::trunc);
31 if (outfile.fail())
32 std::cerr << "Error opening " << argv[3] << " for output.\n";
33 else
34 {
35 int n = int(data.size());
36 for (int i=0; i<n; ++i)
37 outfile << data[i];
38 }
39 }
40 else
41 std::cout << "Error calling 'TestBase64'\n\n";
42
43 return 0;
44}
const Int_t n
TTree * data
A class to send XML RPC requests to a server and return the results.
Definition: XmlRpcClient.h:25
RPC method arguments and results are represented by Values.
Definition: XmlRpcValue.h:22
std::vector< char > BinaryData
Definition: XmlRpcValue.h:39