Return a compressor. * * @param pszId Compressor id. Should NOT be NULL. * @return compressor structure, or NULL. * @since GDAL 3.4 */
| 1923 | * @since GDAL 3.4 |
| 1924 | */ |
| 1925 | const CPLCompressor *CPLGetCompressor(const char *pszId) |
| 1926 | { |
| 1927 | std::lock_guard<std::mutex> lock(gMutex); |
| 1928 | if (gpCompressors == nullptr) |
| 1929 | { |
| 1930 | gpCompressors = new std::vector<CPLCompressor *>(); |
| 1931 | CPLAddBuiltinCompressors(); |
| 1932 | } |
| 1933 | for (size_t i = 0; i < gpCompressors->size(); ++i) |
| 1934 | { |
| 1935 | if (EQUAL(pszId, (*gpCompressors)[i]->pszId)) |
| 1936 | { |
| 1937 | return (*gpCompressors)[i]; |
| 1938 | } |
| 1939 | } |
| 1940 | return nullptr; |
| 1941 | } |
| 1942 | |
| 1943 | /** Return a decompressor. |
| 1944 | * |