nx_server_plugin_sdk 1.0 Server Plugin SDK

Public Member Functions | List of all members
TestStorage Class Reference
Inheritance diagram for TestStorage:

## 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

  url | Directory URL. This should be NULL terminated utf8 encoded C string
  ecode | Pointer 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

  url | File URL. This should be NULL terminated utf8 encoded C string
  ecode | Pointer 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

  url | File URL. This should be NULL terminated utf8 encoded C string
  ecode | Pointer 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

  dirUrl | Directory URL. This should be NULL terminated utf8 encoded C string.
  ecode | Pointer 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

  ecode | Pointer 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

  ecode | Pointer 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

  url | File URL. If file doesn't exists, it is created. This should be NULL terminated utf8 encoded C string.
  flags | io flag(s)
  ecode | Pointer 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

  url | Dir targeted to delete URL. This should be NULL terminated utf8 encoded C string
  ecode | Pointer 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

  url | File targeted to delete URL. This should be NULL terminated utf8 encoded C string
  ecode | Pointer 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

  oldUrl | File targeted to rename URL. This should be NULL terminated utf8 encoded C string.
  newUrl | File targeted to rename new URL. This should be NULL terminated C string.
  ecode | Pointer 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:

- samples/storage/test_storage_plugin/src/test_storage.h
- samples/storage/test_storage_plugin/src/test_storage.cpp