/* */ #include "help_tags.h" #include #include "array_fun.h" namespace aria2 { namespace { constexpr const char* HELP_TAG_NAMES[] = { "#basic", "#advanced", "#http", "#https", "#ftp", "#metalink", "#bittorrent", "#cookie", "#hook", "#file", "#rpc", "#checksum", "#experimental", "#deprecated", "#help"}; } // namespace const char* strHelpTag(uint32_t tag) { if (tag >= MAX_HELP_TAG) { return "UNKNOWN"; } else { return HELP_TAG_NAMES[tag]; } } uint32_t idHelpTag(const char* tagName) { uint32_t id = 0; for (auto p : HELP_TAG_NAMES) { if (strcmp(p, tagName) == 0) { return id; } ++id; } return MAX_HELP_TAG; } } // namespace aria2