comparison Google/GoogleStoragePlugin.cpp @ 77:80792bb9600e

new HybridMode
author Alain Mazy <am@osimis.io>
date Fri, 14 Oct 2022 10:36:02 +0200
parents 16e419fe80c5
children d7295e8678d7
comparison
equal deleted inserted replaced
75:ac596874d997 77:80792bb9600e
42 bool storageContainsUnknownFiles 42 bool storageContainsUnknownFiles
43 ); 43 );
44 44
45 virtual IWriter* GetWriterForObject(const char* uuid, OrthancPluginContentType type, bool encryptionEnabled); 45 virtual IWriter* GetWriterForObject(const char* uuid, OrthancPluginContentType type, bool encryptionEnabled);
46 virtual IReader* GetReaderForObject(const char* uuid, OrthancPluginContentType type, bool encryptionEnabled); 46 virtual IReader* GetReaderForObject(const char* uuid, OrthancPluginContentType type, bool encryptionEnabled);
47 virtual void DeleteObject(const char* uuid, OrthancPluginContentType type, bool encryptionEnabled); 47 virtual bool DeleteObject(const char* uuid, OrthancPluginContentType type, bool encryptionEnabled);
48 virtual const char* GetConfigurationSectionName() {return PLUGIN_SECTION;} 48 virtual const char* GetConfigurationSectionName() {return PLUGIN_SECTION;}
49 }; 49 };
50 50
51 51
52 class Writer : public IStoragePlugin::IWriter 52 class Writer : public IStoragePlugin::IWriter
312 } 312 }
313 313
314 return new Reader(bucketName_, paths, mainClient_); 314 return new Reader(bucketName_, paths, mainClient_);
315 } 315 }
316 316
317 void GoogleStoragePlugin::DeleteObject(const char* uuid, OrthancPluginContentType type, bool encryptionEnabled) 317 bool GoogleStoragePlugin::DeleteObject(const char* uuid, OrthancPluginContentType type, bool encryptionEnabled)
318 { 318 {
319 gcs::Client client(mainClient_); 319 gcs::Client client(mainClient_);
320 320
321 std::string path = GetPath(uuid, type, encryptionEnabled); 321 std::string path = GetPath(uuid, type, encryptionEnabled);
322 322
325 if (!deletionStatus.ok()) 325 if (!deletionStatus.ok())
326 { 326 {
327 throw StoragePluginException("GoogleCloudStorage: error while deleting file " + std::string(path) + ": " + deletionStatus.message()); 327 throw StoragePluginException("GoogleCloudStorage: error while deleting file " + std::string(path) + ": " + deletionStatus.message());
328 } 328 }
329 329
330 } 330 return false; // not 100% sure that the file has been deleted
331 }