| 146 | } |
| 147 | |
| 148 | std::optional<std::string> DataStorageService::GetLabel(const DataStorage* storage) const |
| 149 | { |
| 150 | if (storage == nullptr) |
| 151 | { |
| 152 | return std::nullopt; |
| 153 | } |
| 154 | |
| 155 | std::lock_guard<std::mutex> lock(m_Mutex); |
| 156 | |
| 157 | if (m_DefaultStorage.GetStorage().GetPointer() == storage) |
| 158 | { |
| 159 | return m_DefaultStorage.GetLabel(); |
| 160 | } |
| 161 | |
| 162 | for (const auto& info : m_Storages) |
| 163 | { |
| 164 | if (info.GetStorage().GetPointer() == storage) |
| 165 | { |
| 166 | return info.GetLabel(); |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | return std::nullopt; |
| 171 | } |
| 172 | |
| 173 | std::vector<std::string> DataStorageService::GetAllLabels() const |
| 174 | { |