我希望程序有两个选项可以运行,开始地址和结束地址,以便程序选项如下:
--start_address 0xc0000000 --end_address 0xffffffff
是否可以options_description
采用这种十六进制输入?我是否必须将输入视为字符串并将它们转换为十六进制值。我现在有这个:
po::options_description desc("Allowed options");
desc.add_options()
("help,h", "display this help message")
("path,p", po::value<std::string>(), "Executable file path")
("start_address,s", po::value<std::string>(), "Start address")
("end_address,e", po::value<std::string>(), "End address")
;
可以boost::lexical_cast
做这样的转换吗?