22 std::cerr <<
"ArrayOfStructsTest\n";
24 int n = arg1.
size(), sum = 0;
25 for (
int i=0; i<n; ++i)
26 sum +=
int(arg1[i][
"curly"]);
30 } arrayOfStructsTest(&s);
46 std::cerr <<
"CountTheEntities\n";
47 std::string& arg = params[0];
48 int ctLeftAngleBrackets = 0;
49 int ctRightAngleBrackets = 0;
51 int ctApostrophes = 0;
54 int n = int(arg.length());
55 for (
int i=0; i<n; ++i)
58 case '<': ++ctLeftAngleBrackets;
break;
59 case '>': ++ctRightAngleBrackets;
break;
60 case '&': ++ctAmpersands;
break;
61 case '\'': ++ctApostrophes;
break;
62 case '\"': ++ctQuotes;
break;
65 result[
"ctLeftAngleBrackets"] = ctLeftAngleBrackets;
66 result[
"ctRightAngleBrackets"] = ctRightAngleBrackets;
67 result[
"ctAmpersands"] = ctAmpersands;
68 result[
"ctApostrophes"] = ctApostrophes;
69 result[
"ctQuotes"] = ctQuotes;
71 } countTheEntities(&s);
86 std::cerr <<
"EasyStructTest\n";
88 int sum = int(arg1[
"moe"]) + int(arg1[
"larry"]) + int(arg1[
"curly"]);
103 std::cerr <<
"EchoStructTest\n";
106 } echoStructTest(&s);
119 std::cerr <<
"ManyTypesTest\n";
138 std::cerr <<
"ModerateSizeArrayCheck\n";
139 std::string s = params[0][0];
140 s += std::string(params[0][params[0].size()-1]);
143 } moderateSizeArrayCheck(&s);
160 std::cerr <<
"NestedStructTest\n";
161 XmlRpcValue& dayStruct = params[0][
"2000"][
"04"][
"01"];
162 int sum = int(dayStruct[
"moe"]) + int(dayStruct[
"larry"]) + int(dayStruct[
"curly"]);
165 } nestedStructTest(&s);
179 std::cerr <<
"SimpleStructReturnTest\n";
181 result[
"times10"] = n * 10;
182 result[
"times100"] = n * 100;
183 result[
"times1000"] = n * 1000;
185 } simpleStructReturnTest(&s);
189 int main(
int argc,
char* argv[])
192 std::cerr <<
"Usage: Validator port\n";
195 int port = atoi(argv[1]);
void execute(XmlRpcValue ¶ms, XmlRpcValue &result)
Execute the method. Subclasses must provide a definition for this method.
void execute(XmlRpcValue ¶ms, XmlRpcValue &result)
Execute the method. Subclasses must provide a definition for this method.
RPC method arguments and results are represented by Values.
int size() const
Return the size for string, base64, array, and struct values.
void work(double msTime)
Process client requests for the specified time.
bool bindAndListen(int port, int backlog=5)
ArrayOfStructsTest(XmlRpcServer *s)
EchoStructTest(XmlRpcServer *s)
void execute(XmlRpcValue ¶ms, XmlRpcValue &result)
Execute the method. Subclasses must provide a definition for this method.
Abstract class representing a single RPC method.
CountTheEntities(XmlRpcServer *s)
void setVerbosity(int level)
Sets log message verbosity. This is short for XmlRpcLogHandler::setVerbosity(level) ...
NestedStructTest(XmlRpcServer *s)
void execute(XmlRpcValue ¶ms, XmlRpcValue &result)
Execute the method. Subclasses must provide a definition for this method.
void execute(XmlRpcValue ¶ms, XmlRpcValue &result)
Execute the method. Subclasses must provide a definition for this method.
A class to handle XML RPC requests.
void execute(XmlRpcValue ¶ms, XmlRpcValue &result)
Execute the method. Subclasses must provide a definition for this method.
void execute(XmlRpcValue ¶ms, XmlRpcValue &result)
Execute the method. Subclasses must provide a definition for this method.
EasyStructTest(XmlRpcServer *s)
int main(int argc, char *argv[])
ManyTypesTest(XmlRpcServer *s)
void execute(XmlRpcValue ¶ms, XmlRpcValue &result)
Execute the method. Subclasses must provide a definition for this method.
SimpleStructReturnTest(XmlRpcServer *s)
ModerateSizeArrayCheck(XmlRpcServer *s)