Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
No Matches
kodi::vfs::CFile Class Reference

#include <Filesystem.h>

Public Member Functions

 CFile ()=default
 Construct a new, unopened file.
virtual ~CFile ()
 Close() is called from the destructor, so explicitly closing the file isn't required.
bool OpenFile (const std::string &filename, unsigned int flags=0)
 Open the file with filename via Kodi's CFile. Needs to be closed by calling Close() when done.
bool OpenFileForWrite (const std::string &filename, bool overwrite=false)
 Open the file with filename via Kodi's CFile in write mode. Needs to be closed by calling Close() when done.
bool IsOpen () const
 Check file is opened.
void Close ()
 Close an open file.
bool CURLCreate (const std::string &url)
 Create a Curl representation.
bool CURLAddOption (CURLOptiontype type, const std::string &name, const std::string &value)
 Add options to the curl file created with CURLCreate.
bool CURLOpen (unsigned int flags=0)
 Open the curl file created with CURLCreate.
ssize_t Read (void *ptr, size_t size)
 Read from an open file.
bool ReadLine (std::string &line)
 Read a string from an open file.
ssize_t Write (const void *ptr, size_t size)
 Write to a file opened in write mode.
void Flush ()
 Flush buffered data.
int64_t Seek (int64_t position, int whence=SEEK_SET)
 Set the file's current position.
int Truncate (int64_t size)
 Truncate a file to the requested size.
int64_t GetPosition () const
 The current offset in an open file.
int64_t GetLength () const
 Get the file size of an open file.
bool AtEnd () const
 Checks the file access is on end position.
int GetChunkSize () const
 Get the chunk size for an open file.
bool IoControlGetSeekPossible () const
 To check seek possible on current stream by file.
bool IoControlGetCacheStatus (CacheStatus &status) const
 To check a running stream on file for state of his cache.
bool IoControlSetCacheRate (uint32_t rate)
 Unsigned int with speed limit for caching in bytes per second.
bool IoControlSetRetry (bool retry)
 Enable/disable retry within the protocol handler (if supported).
const std::string GetPropertyValue (FilePropertyTypes type, const std::string &name) const
 Retrieve a file property.
const std::vector< std::string > GetPropertyValues (FilePropertyTypes type, const std::string &name) const
 Retrieve file property values.
double GetFileDownloadSpeed () const
 Get the current download speed of file if loaded from web.

The documentation for this class was generated from the following file: