nx_server_plugin_sdk 1.0 Server Plugin SDK

Public Member Functions | Friends | List of all members
nx_spl::FtpStorage Class Reference
Inheritance diagram for nx_spl::FtpStorage:

## Public Member Functions
| FtpStorage (const std::string &url)
virtual int STORAGE_METHOD_CALL | isAvailable () const override
virtual IODevice *STORAGE_METHOD_CALL | open (const char *uri, 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 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...

## Friends
class | aux::PluginRefCounter< FtpStorage >

## Member Function Documentation

## ◆ addRef()

int nx_spl::FtpStorage::addRef | ( |  | ) | const
| override virtual

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 nx_spl::FtpStorage::dirExists | ( | const char * | url,
|  | int * | ecode
| ) |  | const
| override virtual

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 nx_spl::FtpStorage::fileExists | ( | const char * | url,
|  | int * | ecode
| ) |  | const
| override virtual

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 nx_spl::FtpStorage::fileSize | ( | const char * | url,
|  | int * | ecode
| ) |  | const
| override virtual

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 nx_spl::FtpStorage::getCapabilities | ( |  | ) | const
| override virtual

Returns
  cap flag(s).

Implements nx_spl::Storage.

## ◆ getFileIterator()

FileInfoIterator * nx_spl::FtpStorage::getFileIterator | ( | const char * | dirUrl,
|  | int * | ecode
| ) |  | const
| override virtual

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 nx_spl::FtpStorage::getFreeSpace | ( | int * | ecode | ) | const
| override virtual

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 nx_spl::FtpStorage::getTotalSpace | ( | int * | ecode | ) | const
| override virtual

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 nx_spl::FtpStorage::isAvailable | ( |  | ) | const
| override virtual

Returns
  is storage available at the moment (0,1).

Implements nx_spl::Storage.

## ◆ open()

IODevice * nx_spl::FtpStorage::open | ( | const char * | url,
|  | int | flags,
|  | int * | ecode
| ) |  | const
| override virtual

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 * nx_spl::FtpStorage::queryInterface | ( | const nxpl::NX_GUID & | interfaceID | ) |
| override virtual

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 nx_spl::FtpStorage::releaseRef | ( |  | ) | const
| override virtual

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 nx_spl::FtpStorage::removeDir | ( | const char * | url,
|  | int * | ecode
| ) |  |
| override virtual

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 nx_spl::FtpStorage::removeFile | ( | const char * | url,
|  | int * | ecode
| ) |  |
| override virtual

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 nx_spl::FtpStorage::renameFile | ( | const char * | oldUrl,
|  | const char * | newUrl,
|  | int * | ecode
| ) |  |
| override virtual

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/ftp_storage_plugin/src/ftp_library.h
- samples/storage/ftp_storage_plugin/src/ftp_library.cpp