DASH Media Packaging SDK
|
Implement LocalFile which deals with local storage. More...
#include <local_file.h>
Public Member Functions | |
LocalFile (const char *file_name, const char *mode) | |
File implementation overrides. | |
bool | Close () override |
int64_t | Read (void *buffer, uint64_t length) override |
int64_t | Write (const void *buffer, uint64_t length) override |
int64_t | Size () override |
bool | Flush () override |
bool | Seek (uint64_t position) override |
bool | Tell (uint64_t *position) override |
Public Member Functions inherited from shaka::media::File | |
const std::string & | file_name () const |
Static Public Member Functions | |
static bool | Delete (const char *file_name) |
Static Public Member Functions inherited from shaka::media::File | |
static File * | Open (const char *file_name, const char *mode) |
static File * | OpenWithNoBuffering (const char *file_name, const char *mode) |
static bool | Delete (const char *file_name) |
static int64_t | GetFileSize (const char *file_name) |
static bool | ReadFileToString (const char *file_name, std::string *contents) |
static bool | Copy (const char *from_file_name, const char *to_file_name) |
static int64_t | CopyFile (File *source, File *destination) |
static int64_t | CopyFile (File *source, File *destination, int64_t max_copy) |
Protected Member Functions | |
bool | Open () override |
Internal open. Should not be used directly. | |
Protected Member Functions inherited from shaka::media::File | |
File (const std::string &file_name) | |
virtual | ~File () |
Implement LocalFile which deals with local storage.
Definition at line 21 of file local_file.h.
shaka::media::LocalFile::LocalFile | ( | const char * | file_name, |
const char * | mode | ||
) |
file_name | C string containing the name of the file to be accessed. |
mode | C string containing a file access mode, refer to fopen for the available modes. |
Definition at line 22 of file local_file.cc.
|
overridevirtual |
Flush() and de-allocate resources associated with this file, and delete this File object. THIS IS THE ONE TRUE WAY TO DEALLOCATE THIS OBJECT.
Implements shaka::media::File.
Definition at line 30 of file local_file.cc.
|
static |
Delete a local file.
file_name | is the path of the file to be deleted. |
Definition at line 104 of file local_file.cc.
|
overridevirtual |
Flush the file so that recently written data will survive an application crash (but not necessarily an OS crash). For instance, in LocalFile the data is flushed into the OS but not necessarily to disk.
Implements shaka::media::File.
Definition at line 70 of file local_file.cc.
|
overridevirtual |
Read data and return it in buffer.
[out] | buffer | points to a block of memory with a size of at least length bytes. |
length | indicates number of bytes to be read. |
Implements shaka::media::File.
Definition at line 40 of file local_file.cc.
|
overridevirtual |
Seek to the specifield position in the file.
position | is the position to seek to. |
Implements shaka::media::File.
Definition at line 75 of file local_file.cc.
|
overridevirtual |
Implements shaka::media::File.
Definition at line 52 of file local_file.cc.
|
overridevirtual |
Get the current file position.
position | is a pointer to contain the current file position upon successful return. |
Implements shaka::media::File.
Definition at line 84 of file local_file.cc.
|
overridevirtual |
Write block of data.
buffer | points to a block of memory with at least length bytes. |
length | indicates number of bytes to write. |
Implements shaka::media::File.
Definition at line 46 of file local_file.cc.