| 117 | |
| 118 | template <typename T> |
| 119 | Result<std::shared_ptr<const T>> GetConstSharedPtrOption(const std::string& key, |
| 120 | const std::any& value) { |
| 121 | if (const auto* v = std::any_cast<std::shared_ptr<const T>>(&value)) return *v; |
| 122 | if (const auto* v = std::any_cast<std::shared_ptr<T>>(&value)) return *v; |
| 123 | return Status::Invalid("Filesystem option '", key, "' has the wrong type"); |
| 124 | } |
| 125 | |
| 126 | } // namespace arrow::fs::internal |