| 928 | |
| 929 | template <class Data, class MatchResult> |
| 930 | int |
| 931 | ControlMatcher<Data, MatchResult>::BuildTable() |
| 932 | { |
| 933 | std::error_code ec; |
| 934 | std::string content{swoc::file::load(swoc::file::path{config_file_path}, ec)}; |
| 935 | if (ec) { |
| 936 | switch (ec.value()) { |
| 937 | case ENOENT: |
| 938 | Warning("ControlMatcher - Cannot open config file: %s - %s", config_file_path, strerror(ec.value())); |
| 939 | break; |
| 940 | default: |
| 941 | Error("ControlMatcher - %s failed to load: %s", config_file_path, strerror(ec.value())); |
| 942 | return 1; |
| 943 | } |
| 944 | } |
| 945 | |
| 946 | return BuildTableFromString(content.data()); |
| 947 | } |
| 948 | |
| 949 | /**************************************************************** |
| 950 | * TEMPLATE INSTANTIATIONS GO HERE |
no test coverage detected