正在显示
2 个修改的文件
包含
20 行增加
和
10 行删除
| @@ -670,6 +670,15 @@ string SrsConfDirective::arg2() | @@ -670,6 +670,15 @@ string SrsConfDirective::arg2() | ||
| 670 | return ""; | 670 | return ""; |
| 671 | } | 671 | } |
| 672 | 672 | ||
| 673 | +string SrsConfDirective::arg3() | ||
| 674 | +{ | ||
| 675 | + if (args.size() > 3) { | ||
| 676 | + return args.at(3); | ||
| 677 | + } | ||
| 678 | + | ||
| 679 | + return ""; | ||
| 680 | +} | ||
| 681 | + | ||
| 673 | SrsConfDirective* SrsConfDirective::at(int index) | 682 | SrsConfDirective* SrsConfDirective::at(int index) |
| 674 | { | 683 | { |
| 675 | srs_assert(index < (int)directives.size()); | 684 | srs_assert(index < (int)directives.size()); |
| @@ -155,20 +155,20 @@ class SrsConfDirective | @@ -155,20 +155,20 @@ class SrsConfDirective | ||
| 155 | { | 155 | { |
| 156 | public: | 156 | public: |
| 157 | /** | 157 | /** |
| 158 | - * the line of config file in which the directive from | ||
| 159 | - */ | 158 | + * the line of config file in which the directive from |
| 159 | + */ | ||
| 160 | int conf_line; | 160 | int conf_line; |
| 161 | /** | 161 | /** |
| 162 | - * the name of directive, for example, the following config text: | ||
| 163 | - * enabled on; | ||
| 164 | - * will be parsed to a directive, its name is "enalbed" | ||
| 165 | - */ | 162 | + * the name of directive, for example, the following config text: |
| 163 | + * enabled on; | ||
| 164 | + * will be parsed to a directive, its name is "enalbed" | ||
| 165 | + */ | ||
| 166 | std::string name; | 166 | std::string name; |
| 167 | /** | 167 | /** |
| 168 | - * the args of directive, for example, the following config text: | ||
| 169 | - * listen 1935 1936; | ||
| 170 | - * will be parsed to a directive, its args is ["1935", "1936"]. | ||
| 171 | - */ | 168 | + * the args of directive, for example, the following config text: |
| 169 | + * listen 1935 1936; | ||
| 170 | + * will be parsed to a directive, its args is ["1935", "1936"]. | ||
| 171 | + */ | ||
| 172 | std::vector<std::string> args; | 172 | std::vector<std::string> args; |
| 173 | /** | 173 | /** |
| 174 | * the child directives, for example, the following config text: | 174 | * the child directives, for example, the following config text: |
| @@ -201,6 +201,7 @@ public: | @@ -201,6 +201,7 @@ public: | ||
| 201 | virtual std::string arg0(); | 201 | virtual std::string arg0(); |
| 202 | virtual std::string arg1(); | 202 | virtual std::string arg1(); |
| 203 | virtual std::string arg2(); | 203 | virtual std::string arg2(); |
| 204 | + virtual std::string arg3(); | ||
| 204 | // directives | 205 | // directives |
| 205 | public: | 206 | public: |
| 206 | /** | 207 | /** |
-
请 注册 或 登录 后发表评论