| 2835 | // --------------------------------------------------------------------------- |
| 2836 | |
| 2837 | static ListOfHGrids getListOfGridSets(PJ_CONTEXT *ctx, const char *grids) { |
| 2838 | ListOfHGrids list; |
| 2839 | auto listOfGrids = internal::split(std::string(grids), ','); |
| 2840 | for (const auto &grid : listOfGrids) { |
| 2841 | const char *gridname = grid.c_str(); |
| 2842 | bool canFail = false; |
| 2843 | if (gridname[0] == '@') { |
| 2844 | canFail = true; |
| 2845 | gridname++; |
| 2846 | } |
| 2847 | auto gridSet = HorizontalShiftGridSet::open(ctx, gridname); |
| 2848 | if (!gridSet) { |
| 2849 | if (!canFail) { |
| 2850 | if (proj_context_errno(ctx) != PROJ_ERR_OTHER_NETWORK_ERROR) { |
| 2851 | proj_context_errno_set( |
| 2852 | ctx, PROJ_ERR_INVALID_OP_FILE_NOT_FOUND_OR_INVALID); |
| 2853 | } |
| 2854 | return {}; |
| 2855 | } |
| 2856 | proj_context_errno_set(ctx, 0); // don't treat as a persistent error |
| 2857 | } else { |
| 2858 | list.emplace_back(std::move(gridSet)); |
| 2859 | } |
| 2860 | } |
| 2861 | return list; |
| 2862 | } |
| 2863 | |
| 2864 | /**********************************************/ |
| 2865 | ListOfHGrids pj_hgrid_init(PJ *P, const char *gridkey) { |
no test coverage detected