8 int main(
int argc,
char** argv)
12 if(argc < 2 || std::string(argv[1]) ==
"--help")
14 fmt::print(stderr,
"Usage: dump_param <name>\n");
25 fmt::print(stderr,
"Could not retrieve parameter '{}', does it exist?", argv[1]);
29 switch(value.getType())
31 case Value::TypeString:
32 fmt::print(
"Type: String\n");
33 fmt::print(
"Value: '{}'\n", static_cast<std::string>(value));
36 case Value::TypeBoolean:
37 fmt::print(
"Type: Bool\n");
38 fmt::print(
"Value: {}\n", static_cast<bool>(value));
41 case Value::TypeDouble:
43 fmt::print(
"Type: Double\n");
46 fmt::print(
"Value: {}\n", v);
49 std::memcpy(&vhex, &v,
sizeof(vhex));
51 fmt::print(
"Hex: 0x{:08X}\n", vhex);
56 fmt::print(
"Type: Int\n");
57 fmt::print(
"Value: {}\n", static_cast<int>(value));
60 case Value::TypeArray:
61 fmt::print(
"Type: Array\n");
64 case Value::TypeBase64:
65 fmt::print(
"Type: Base64\n");
68 case Value::TypeDateTime:
69 fmt::print(
"Type: DateTime\n");
72 case Value::TypeInvalid:
73 fmt::print(
"Type: Invalid\n");
76 case Value::TypeStruct:
77 fmt::print(
"Type: Struct\n");
81 fmt::print(
"Type: Unknown\n");
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
int main(int argc, char **argv)
bool getParam(const std::string &key, std::string &s) const