Return a decompressor. * * @param pszId Decompressor id. Should NOT be NULL. * @return compressor structure, or NULL. * @since GDAL 3.4 */
| 1947 | * @since GDAL 3.4 |
| 1948 | */ |
| 1949 | const CPLCompressor *CPLGetDecompressor(const char *pszId) |
| 1950 | { |
| 1951 | std::lock_guard<std::mutex> lock(gMutex); |
| 1952 | if (gpDecompressors == nullptr) |
| 1953 | { |
| 1954 | gpDecompressors = new std::vector<CPLCompressor *>(); |
| 1955 | CPLAddBuiltinDecompressors(); |
| 1956 | } |
| 1957 | for (size_t i = 0; i < gpDecompressors->size(); ++i) |
| 1958 | { |
| 1959 | if (EQUAL(pszId, (*gpDecompressors)[i]->pszId)) |
| 1960 | { |
| 1961 | return (*gpDecompressors)[i]; |
| 1962 | } |
| 1963 | } |
| 1964 | return nullptr; |
| 1965 | } |
| 1966 | |
| 1967 | static void |
| 1968 | CPLDestroyCompressorRegistryInternal(std::vector<CPLCompressor *> *&v) |