blob: 8c5ff942c9814ddc010509d0c70b6994527198bc (
plain)
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
|
#include "FooHelper.h"
namespace android {
std::string to_string(const IFoo::StringMatrix5x3 &M) {
return to_string(M.s);
}
std::string to_string(const IFoo::StringMatrix3x5 &M) {
return to_string(M.s);
}
std::string to_string(const hidl_string &s) {
return std::string("'") + s.c_str() + "'";
}
std::string QuuxToString(const IFoo::Quux &val) {
std::string s;
s = "Quux(first='";
s += val.first.c_str();
s += "', last='";
s += val.last.c_str();
s += "')";
return s;
}
std::string MultiDimensionalToString(const IFoo::MultiDimensional &val) {
std::string s;
s += "MultiDimensional(";
s += "quuxMatrix=[";
size_t k = 0;
for (size_t i = 0; i < 5; ++i) {
if (i > 0) {
s += ", ";
}
s += "[";
for (size_t j = 0; j < 3; ++j, ++k) {
if (j > 0) {
s += ", ";
}
s += QuuxToString(val.quuxMatrix[i][j]);
}
}
s += "]";
s += ")";
return s;
}
} // namespace android
|