limal-nfs-server
Public Member Functions | Private Attributes | Friends

limal::nfs_server::ExportOption Class Reference

The ExportOption class manages a nfs export option. More...

#include <NfsExports.hpp>

List of all members.

Public Member Functions

 ExportOption ()
 ExportOption (const BLOCXX_NAMESPACE::String &name, const BLOCXX_NAMESPACE::String &value)
 ExportOption (const BLOCXX_NAMESPACE::String &option)
 ExportOption (const ExportOption &option)
 ~ExportOption ()
bool empty () const
BLOCXX_NAMESPACE::String toString () const
BLOCXX_NAMESPACE::String getName () const
BLOCXX_NAMESPACE::String getValue () const
void setName (const BLOCXX_NAMESPACE::String &name)
void setValue (const BLOCXX_NAMESPACE::String &value)
void setOption (const BLOCXX_NAMESPACE::String &option)

Private Attributes

BLOCXX_NAMESPACE::String m_name
BLOCXX_NAMESPACE::String m_value

Friends

bool operator== (const ExportOption &o1, const ExportOption &o2)
bool operator< (const ExportOption &o1, const ExportOption &o2)

Detailed Description

The ExportOption class manages a nfs export option.

A ExportOption consists of either just a "name" (flag option) or a "name=value" pair.


Constructor & Destructor Documentation

limal::nfs_server::ExportOption::ExportOption ( )

Create a new, empty export option

limal::nfs_server::ExportOption::ExportOption ( const BLOCXX_NAMESPACE::String &  name,
const BLOCXX_NAMESPACE::String &  value 
)

Create a new export option object using the specified name and (may be empty) value.

        ExportOption("ro", "");
        ExportOption("mountpoint", "/some/path");
Parameters:
nameThe export option name.
valueThe export option value.
Exceptions:
limal::ValueExceptionif the string is not a valid export option.
limal::nfs_server::ExportOption::ExportOption ( const BLOCXX_NAMESPACE::String &  option)

Create a new export option object using the specified string containing either only the option "name" or a "name=value" pair.

        ExportOption("ro");
        ExportOption("mountpoint=/some/path");
Parameters:
optionThe export option as string.
Exceptions:
limal::ValueExceptionif the string is not a valid export option.
limal::nfs_server::ExportOption::ExportOption ( const ExportOption option)

Create export option as copy of the specified one.

Parameters:
optionA export option reference.
limal::nfs_server::ExportOption::~ExportOption ( )

Destroy current export option object.


Member Function Documentation

bool limal::nfs_server::ExportOption::empty ( ) const

Returns true if the option is empty.

Returns:
true if the option is empty
BLOCXX_NAMESPACE::String limal::nfs_server::ExportOption::getName ( ) const

Get the name of the export option

Returns:
export option name
BLOCXX_NAMESPACE::String limal::nfs_server::ExportOption::getValue ( ) const

Get the value of the export option

Returns:
export option value
void limal::nfs_server::ExportOption::setName ( const BLOCXX_NAMESPACE::String &  name)

Set the name of the option and reset the value to a empty string.

void limal::nfs_server::ExportOption::setOption ( const BLOCXX_NAMESPACE::String &  option)

Assign the export option object to the specified string containing either just the option "name" or "name=value".

        ExportOption e;
      e.setOption("ro");
      e.setOption("mountpoint=/some/path");
Parameters:
optionThe export option as string.
Exceptions:
limal::ValueExceptionif the string is not a valid export option.
void limal::nfs_server::ExportOption::setValue ( const BLOCXX_NAMESPACE::String &  value)

Set the value of the option.

BLOCXX_NAMESPACE::String limal::nfs_server::ExportOption::toString ( ) const

Return the export option as string. This is either only the "name" or "name=value" if value not empty.

Returns:
The export option as string.

Friends And Related Function Documentation

bool operator< ( const ExportOption o1,
const ExportOption o2 
) [friend]
bool operator== ( const ExportOption o1,
const ExportOption o2 
) [friend]

Member Data Documentation

BLOCXX_NAMESPACE::String limal::nfs_server::ExportOption::m_name [private]
BLOCXX_NAMESPACE::String limal::nfs_server::ExportOption::m_value [private]

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