nx_storage_sdk  1.0
Storage SDK
Public Member Functions | List of all members
TestStorage Class Reference
Inheritance diagram for TestStorage:
nx_spl::Storage PluginRefCounter< TestStorage > nxpl::PluginInterface

Public Member Functions

 TestStorage (const utils::VfsPair &vfsPair, const std::string &prefix, std::function< void()> onDestroyCb)
 
virtual int STORAGE_METHOD_CALL isAvailable () const override
 
virtual nx_spl::IODevice *STORAGE_METHOD_CALL open (const char *url, int flags, int *ecode) const override
 
virtual uint64_t STORAGE_METHOD_CALL getFreeSpace (int *ecode) const override
 
virtual uint64_t STORAGE_METHOD_CALL getTotalSpace (int *ecode) const override
 
virtual int STORAGE_METHOD_CALL getCapabilities () const override
 
virtual void STORAGE_METHOD_CALL removeFile (const char *url, int *ecode) override
 
virtual void STORAGE_METHOD_CALL removeDir (const char *url, int *ecode) override
 
virtual void STORAGE_METHOD_CALL renameFile (const char *oldUrl, const char *newUrl, int *ecode) override
 
virtual nx_spl::FileInfoIterator *STORAGE_METHOD_CALL getFileIterator (const char *dirUrl, int *ecode) const override
 
virtual int STORAGE_METHOD_CALL fileExists (const char *url, int *ecode) const override
 
virtual int STORAGE_METHOD_CALL dirExists (const char *url, int *ecode) const override
 
virtual uint64_t STORAGE_METHOD_CALL fileSize (const char *url, int *ecode) const override
 
virtual void * queryInterface (const nxpl::NX_GUID &interfaceID) override
 Cast to type, specified by interfaceID. More...
 
virtual int addRef () const override
 Increment reference counter. More...
 
virtual int releaseRef () const override
 Decrement reference counter. More...
 
- Public Member Functions inherited from PluginRefCounter< TestStorage >
int pAddRef () const
 
int pReleaseRef () const
 

Member Function Documentation

◆ addRef()

int TestStorage::addRef ( ) const
overridevirtual

Increment reference counter.

Returns
new reference count
Note
PluginInterface::releaseRef is not guaranteed to be called from thread that called PluginInterface::addRef

Implements nxpl::PluginInterface.

◆ dirExists()

int STORAGE_METHOD_CALL TestStorage::dirExists ( const char *  url,
int *  ecode 
) const
overridevirtual
Parameters
urlDirectory URL. This should be NULL terminated utf8 encoded C string
ecodePointer to error code. Pass NULL if you are not interested in error information.
Returns
(0, 1).

Implements nx_spl::Storage.

◆ fileExists()

int STORAGE_METHOD_CALL TestStorage::fileExists ( const char *  url,
int *  ecode 
) const
overridevirtual
Parameters
urlFile URL. This should be NULL terminated utf8 encoded C string
ecodePointer error code. Pass NULL if you are not interested in error information.
Returns
(0, 1).

Implements nx_spl::Storage.

◆ fileSize()

uint64_t STORAGE_METHOD_CALL TestStorage::fileSize ( const char *  url,
int *  ecode 
) const
overridevirtual
Parameters
urlFile URL. This should be NULL terminated utf8 encoded C string
ecodePointer to error code. Pass NULL if you are not interested in error information.
Returns
File size.

Implements nx_spl::Storage.

◆ getCapabilities()

int STORAGE_METHOD_CALL TestStorage::getCapabilities ( ) const
overridevirtual
Returns
cap flag(s).

Implements nx_spl::Storage.

◆ getFileIterator()

nx_spl::FileInfoIterator *STORAGE_METHOD_CALL TestStorage::getFileIterator ( const char *  dirUrl,
int *  ecode 
) const
overridevirtual
Parameters
dirUrlDirectory URL. This should be NULL terminated utf8 encoded C string.
ecodePointer error code. Pass NULL if you are not interested in error information.
Returns
Pointer to FileInfoVector or NULL if something bad happened.

Implements nx_spl::Storage.

◆ getFreeSpace()

uint64_t STORAGE_METHOD_CALL TestStorage::getFreeSpace ( int *  ecode) const
overridevirtual
Parameters
ecodePointer to error code. Pass NULL if you are not interested in error information.
Returns
Free space size ('unknown_size' if request can't be accomplished).

Implements nx_spl::Storage.

◆ getTotalSpace()

uint64_t STORAGE_METHOD_CALL TestStorage::getTotalSpace ( int *  ecode) const
overridevirtual
Parameters
ecodePointer to error code. Pass NULL if you are not interested in error information.
Returns
Total space size ('unknown_size' if request can't be accomplished).

Implements nx_spl::Storage.

◆ isAvailable()

int STORAGE_METHOD_CALL TestStorage::isAvailable ( ) const
overridevirtual
Returns
is storage available at the moment (0,1).

Implements nx_spl::Storage.

◆ open()

nx_spl::IODevice *STORAGE_METHOD_CALL TestStorage::open ( const char *  url,
int  flags,
int *  ecode 
) const
overridevirtual
Parameters
urlFile URL. If file doesn't exists, it is created. This should be NULL terminated utf8 encoded C string.
flagsio flag(s)
ecodePointer to error code. Pass NULL if you are not interested in error information.
Returns
Free space size ('unknown_size' if request can't be accomplished).

Implements nx_spl::Storage.

◆ queryInterface()

void * TestStorage::queryInterface ( const nxpl::NX_GUID interfaceID)
overridevirtual

Cast to type, specified by interfaceID.

If pointer cannot be cast, NULL MUST be returned

Returns
If not NULL, returned pointer can be safely cast to type, defined by interfaceID
Note
This method increments reference counter

Implements nxpl::PluginInterface.

◆ releaseRef()

int TestStorage::releaseRef ( ) const
overridevirtual

Decrement reference counter.

When zero, object MUST be removed

Returns
new reference count
Note
PluginInterface::releaseRef is not guaranteed to be called from thread that called PluginInterface::addRef

Implements nxpl::PluginInterface.

◆ removeDir()

void STORAGE_METHOD_CALL TestStorage::removeDir ( const char *  url,
int *  ecode 
)
overridevirtual
Parameters
urlDir targeted to delete URL. This should be NULL terminated utf8 encoded C string
ecodePointer to error code. Pass NULL if you are not interested in error information.

Implements nx_spl::Storage.

◆ removeFile()

void STORAGE_METHOD_CALL TestStorage::removeFile ( const char *  url,
int *  ecode 
)
overridevirtual
Parameters
urlFile targeted to delete URL. This should be NULL terminated utf8 encoded C string
ecodePointer to error code. Pass NULL if you are not interested in error information.

Implements nx_spl::Storage.

◆ renameFile()

void STORAGE_METHOD_CALL TestStorage::renameFile ( const char *  oldUrl,
const char *  newUrl,
int *  ecode 
)
overridevirtual
Parameters
oldUrlFile targeted to rename URL. This should be NULL terminated utf8 encoded C string.
newUrlFile targeted to rename new URL. This should be NULL terminated C string.
ecodePointer to error code. Pass NULL if you are not interested in error information.

Implements nx_spl::Storage.


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