本文整理汇总了C++中process::HELP方法的典型用法代码示例。如果您正苦于以下问题:C++ process::HELP方法的具体用法?C++ process::HELP怎么用?C++ process::HELP使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类process
的用法示例。
在下文中一共展示了process::HELP方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: registryHelp
string RegistrarProcess::registryHelp()
{
return HELP(
TLDR(
"Returns the current contents of the Registry in JSON."),
USAGE(
"/registrar(1)/registry"),
DESCRIPTION(
"Example:"
"",
"```",
"{",
" \"master\":",
" {",
" \"info\":",
" {",
" \"hostname\": \"localhost\",",
" \"id\": \"20140325-235542-1740121354-5050-33357\",",
" \"ip\": 2130706433,",
" \"pid\": \"[email protected]:5050\",",
" \"port\": 5050",
" }",
" },",
"",
" \"slaves\":",
" {",
" \"slaves\":",
" [",
" {",
" \"info\":",
" {",
" \"checkpoint\": true,",
" \"hostname\": \"localhost\",",
" \"id\":",
" { ",
" \"value\": \"20140325-234618-1740121354-5050-29065-0\"",
" },",
" \"port\": 5051,",
" \"resources\":",
" [",
" {",
" \"name\": \"cpus\",",
" \"role\": \"*\",",
" \"scalar\": { \"value\": 24 },",
" \"type\": \"SCALAR\"",
" }",
" ],",
" \"webui_hostname\": \"localhost\"",
" }",
" }",
" ]",
" }",
"}",
"```"));
}
示例2: Nothing
return Nothing();
}
void FilesProcess::detach(const string& name)
{
paths.erase(name);
}
const string FilesProcess::BROWSE_HELP = HELP(
TLDR(
"Returns a file listing for a directory."),
DESCRIPTION(
"Lists files and directories contained in the path as",
"a JSON object.",
"",
"Query parameters:",
"",
"> path=VALUE The path of directory to browse."));
Future<Response> FilesProcess::browse(const Request& request)
{
Option<string> path = request.url.query.get("path");
if (!path.isSome() || path.get().empty()) {
return BadRequest("Expecting 'path=value' in query.\n");
}
Result<string> resolvedPath = resolve(path.get());