Kodi Development 22.0
for Binary and Script based Add-Ons
 
Loading...
Searching...
No Matches

Public Member Functions

bool AtEnd () const
 Checks the file access is on end position.
 
 CFile ()=default
 Construct a new, unopened file.
 
void Close ()
 Close an open file.
 
bool CURLAddOption (CURLOptiontype type, const std::string &name, const std::string &value)
 Add options to the curl file created with CURLCreate.
 
bool CURLCreate (const std::string &url)
 Create a Curl representation.
 
bool CURLOpen (unsigned int flags=0)
 Open the curl file created with CURLCreate.
 
void Flush ()
 Flush buffered data.
 
int GetChunkSize () const
 Get the chunk size for an open file.
 
double GetFileDownloadSpeed () const
 Get the current download speed of file if loaded from web.
 
int64_t GetLength () const
 Get the file size of an open file.
 
int64_t GetPosition () const
 The current offset in an open file.
 
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.
 
bool IoControlGetCacheStatus (CacheStatus &status) const
 To check a running stream on file for state of his cache.
 
bool IoControlGetSeekPossible () const
 To check seek possible on current stream by file.
 
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).
 
bool IsOpen () const
 Check file is opened.
 
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.
 
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.
 
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.
 
ssize_t Write (const void *ptr, size_t size)
 Write to a file opened in write mode.
 
virtual ~CFile ()
 Close() is called from the destructor, so explicitly closing the file isn't required.
 

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