All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
IHttpCache.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "Cache.h"
7 #include <string>
8 #include <vector>
9 
10 namespace Eegeo
11 {
12  namespace Helpers
13  {
14  typedef unsigned long long CacheSize_t;
15 
16  class IHttpCache
17  {
18  public:
19  virtual ~IHttpCache() { }
20 
21  virtual bool TryGetCachedHeaderInfo(
22  const std::string& url,
23  std::string& out_cachedETag,
24  std::string& out_cachedLastModified) = 0;
25 
26  virtual void GetFileNameByUrl(std::string& name, const std::string& url) = 0;
27  virtual void SetMaxCacheSize(CacheSize_t size) = 0;
28  virtual bool IsInCache(const std::string& url) = 0;
29 
30  virtual void ReloadCacheRepresentationFromStorage() = 0;
31  virtual bool LoadLocallyCachedData(const std::string& url, std::vector<Byte>& out_buffer) = 0;
32 
33  virtual bool GetEnabled() = 0;
34  virtual void SetEnabled(bool enabled) = 0;
35 
36  virtual void AddToCache(const Eegeo::Web::Cache::CacheRecord& cacheRecordToAdd) = 0;
37  virtual void RemoveFromCache(const std::string& url) = 0;
38  virtual void ClearCache() = 0;
39  virtual void FlushInMemoryCacheRepresentation(bool prune) = 0;
40  };
41  }
42 }