cppfs  1.2.0.5b71c2c98fb9
Cross-platform C++ file system library supporting multiple backends (Local-FS, SSH)
Public Member Functions | Protected Attributes | List of all members
cppfs::LoginCredentials Class Reference

Login credentials for accessing file systems (e.g., username, password, key files, etc.) More...

#include <cppfs/include/cppfs/LoginCredentials.h>

Public Member Functions

 LoginCredentials ()
 Constructor. More...
 
 LoginCredentials (const LoginCredentials &loginCredentials)
 Copy constructor. More...
 
 LoginCredentials (const LoginCredentials &&loginCredentials)
 Move constructor. More...
 
virtual ~LoginCredentials ()
 Destructor. More...
 
LoginCredentialsoperator= (const LoginCredentials &loginCredentials)
 Copy assignment operator. More...
 
LoginCredentialsoperator= (LoginCredentials &&loginCredentials)
 Move assignment operator. More...
 
bool load (const std::string &path)
 Load login credentials from file. More...
 
bool save (const std::string &path) const
 Save login credentials to file. More...
 
bool isSet (const std::string &key) const
 Check if a value is set for a given key. More...
 
const std::string & value (const std::string &key) const
 Get value for key. More...
 
void setValue (const std::string &key, const std::string &value)
 Set value for key. More...
 
void setValue (const std::string &key, std::string &&value)
 Set value for key. More...
 

Protected Attributes

std::map< std::string, std::string > m_values
 Key/value pairs. More...
 

Detailed Description

Login credentials for accessing file systems (e.g., username, password, key files, etc.)

This class is used to pass additional login credentials needed to acces file systems, for example include username, password, port numbers, or paths to key files. It can contain arbitrary key/value pairs that are defined and interpreted by the respective file system implementations. See the documentation for a specific file system implementation to learn what options it supports.

Constructor & Destructor Documentation

cppfs::LoginCredentials::LoginCredentials ( )

Constructor.

cppfs::LoginCredentials::LoginCredentials ( const LoginCredentials loginCredentials)

Copy constructor.

Parameters
[in]loginCredentialsRight-hand value to copy
cppfs::LoginCredentials::LoginCredentials ( const LoginCredentials &&  loginCredentials)

Move constructor.

Parameters
[in]loginCredentialsRight-hand value to copy
virtual cppfs::LoginCredentials::~LoginCredentials ( )
virtual

Destructor.

Member Function Documentation

LoginCredentials& cppfs::LoginCredentials::operator= ( const LoginCredentials loginCredentials)

Copy assignment operator.

Parameters
[in]loginCredentialsRight-hand value to copy
Returns
Reference to this value
LoginCredentials& cppfs::LoginCredentials::operator= ( LoginCredentials &&  loginCredentials)

Move assignment operator.

Parameters
[in]loginCredentialsRight-hand value to move
Returns
Reference to this value
bool cppfs::LoginCredentials::load ( const std::string &  path)

Load login credentials from file.

Parameters
[in]pathPath to file
Returns
'true' on success, else 'false'
bool cppfs::LoginCredentials::save ( const std::string &  path) const

Save login credentials to file.

Parameters
[in]pathPath to file
Returns
'true' on success, else 'false'
bool cppfs::LoginCredentials::isSet ( const std::string &  key) const

Check if a value is set for a given key.

Parameters
[in]keyKey
Returns
'true' if a value for that key is set, else 'false'
const std::string& cppfs::LoginCredentials::value ( const std::string &  key) const

Get value for key.

Parameters
[in]keyKey
Returns
Value for key, "" if key does not exist
void cppfs::LoginCredentials::setValue ( const std::string &  key,
const std::string &  value 
)

Set value for key.

Parameters
[in]keyKey
[in]valueValue for key
void cppfs::LoginCredentials::setValue ( const std::string &  key,
std::string &&  value 
)

Set value for key.

Parameters
[in]keyKey
[in]valueValue for key

Member Data Documentation

std::map<std::string, std::string> cppfs::LoginCredentials::m_values
protected

Key/value pairs.


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