Repository navigation
Expand file tree
/
Copy pathHttpCacheInternal.h
More file actions
57 lines (42 loc) · 1.57 KB
/
Copy pathHttpCacheInternal.h
File metadata and controls
57 lines (42 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* Copyright 2017 Sony Corporation
*/
#ifndef EASYHTTPCPP_HTTPCACHEINTERNAL_H_INCLUDED
#define EASYHTTPCPP_HTTPCACHEINTERNAL_H_INCLUDED
#include <istream>
#include "Poco/Mutex.h"
#include "Poco/Path.h"
#include "easyhttpcpp/common/Cache.h"
#include "easyhttpcpp/common/CacheManager.h"
#include "easyhttpcpp/HttpCache.h"
#include "easyhttpcpp/HttpExports.h"
#include "easyhttpcpp/Request.h"
#include "easyhttpcpp/Response.h"
#include "HttpCacheStrategy.h"
namespace easyhttpcpp {
class HttpCacheMetadata;
class EASYHTTPCPP_HTTP_INTERNAL_API HttpCacheInternal : public HttpCache {
public:
HttpCacheInternal(const Poco::Path& path, size_t maxSize);
virtual ~HttpCacheInternal();
virtual const Poco::Path& getPath() const;
virtual void evictAll();
virtual size_t getMaxSize() const;
virtual size_t getSize();
HttpCacheStrategy::Ptr createCacheStrategy(Request::Ptr pRequest);
void remove(Request::Ptr pRequest);
std::istream* createInputStreamFromCache(Request::Ptr pRequest);
const std::string& getTempDirectory();
easyhttpcpp::common::CacheManager::Ptr getCacheManager() const;
private:
Response::Ptr createResponseFromCacheMetadata(Request::Ptr pRequest, HttpCacheMetadata& httpCacheMetadata);
size_t m_maxSize;
easyhttpcpp::common::Cache::Ptr m_pFileCache;
easyhttpcpp::common::CacheManager::Ptr m_pCacheManager;
Poco::Path m_cachePath;
Poco::Path m_cacheRootDir;
std::string m_cacheTempDir;
Poco::FastMutex m_directoryMutex;
};
} /* namespace easyhttpcpp */
#endif /* EASYHTTPCPP_HTTPCACHEINTERNAL_H_INCLUDED */