Kodi Development  20.0
for Binary and Script based Add-Ons

Public Member Functions

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

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