Initial source release: v2.0.8-0-679
Change-Id: Idf6316a8faf4b4fdc54265aad12084e5aa60707a
This commit is contained in:
43
cdm/include/cdm_host_file.h
Normal file
43
cdm/include/cdm_host_file.h
Normal file
@@ -0,0 +1,43 @@
|
||||
// Copyright 2013 Google Inc. All Rights Reserved.
|
||||
|
||||
#ifndef WVCDM_CDM_CDM_HOST_FILE_H_
|
||||
#define WVCDM_CDM_CDM_HOST_FILE_H_
|
||||
|
||||
#include "file_store.h"
|
||||
#include "content_decryption_module.h"
|
||||
|
||||
namespace wvcdm {
|
||||
|
||||
class IFileFactory {
|
||||
protected:
|
||||
IFileFactory(){}
|
||||
virtual ~IFileFactory(){}
|
||||
public:
|
||||
virtual File::Impl* NewFileImpl () = 0;
|
||||
};
|
||||
|
||||
class File::Impl {
|
||||
public:
|
||||
explicit Impl(cdm::Host* const host) : host_(host) {}
|
||||
FILE* file_;
|
||||
static void RegisterFileFactory(IFileFactory* factory) {
|
||||
factory_ = factory;
|
||||
}
|
||||
static IFileFactory* factory_;
|
||||
|
||||
virtual bool Exists(const std::string& name);
|
||||
virtual bool Open(const std::string& name);
|
||||
virtual bool Close();
|
||||
virtual bool Remove(const std::string& name);
|
||||
virtual size_t Read(char* buffer, size_t bytes);
|
||||
virtual size_t Write(const char* buffer, size_t bytes);
|
||||
virtual size_t FileSize(const std::string& name);
|
||||
|
||||
private:
|
||||
cdm::Host* const host_;
|
||||
std::string fname_;
|
||||
};
|
||||
|
||||
} // namespace wvcdm
|
||||
|
||||
#endif // WVCDM_CDM_CDM_HOST_FILE_H_
|
||||
Reference in New Issue
Block a user