limal-nfs-server
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
limal::nfs_server::KNfsExports Class Reference

#include <KNfsExports.hpp>

Inheritance diagram for limal::nfs_server::KNfsExports:
limal::nfs_server::Exports

Public Member Functions

 KNfsExports ()
 
 KNfsExports (const Exports &exports)
 
 KNfsExports (const ExportEntries &entries)
 
 ~KNfsExports ()
 
bool validExportOptions (const ExportOptions &options) const
 
bool validExportClient (const ExportClient &client) const
 
bool validExportEntry (const ExportEntry &entry) const
 
BLOCXX_NAMESPACE::Array
< BLOCXX_NAMESPACE::String > 
verifyExportOptions (const ExportOptions &options) const
 
BLOCXX_NAMESPACE::Array
< BLOCXX_NAMESPACE::String > 
verifyExportClient (const ExportClient &client) const
 
BLOCXX_NAMESPACE::Array
< BLOCXX_NAMESPACE::String > 
verifyExportEntry (const ExportEntry &entry) const
 
void load (const BLOCXX_NAMESPACE::String &exportsFile)
 
void save (const BLOCXX_NAMESPACE::String &exportsFile, const BLOCXX_NAMESPACE::String &backupSuffix)
 
- Public Member Functions inherited from limal::nfs_server::Exports
 Exports ()
 
 Exports (const Exports &exports)
 
 Exports (const ExportEntries &entries)
 
 ~Exports ()
 
ExportPaths getPaths () const
 
ExportClients getClients (const BLOCXX_NAMESPACE::String &path) const
 
ExportEntries getEntries (const BLOCXX_NAMESPACE::String &path) const
 
ExportEntries getEntries () const
 
ExportComment getComment (CommentType type) const
 
void setEntries (const ExportEntries &entries)
 
void setComment (const ExportComment &comment, CommentType type)
 
void addEntry (const ExportEntry &entry)
 

Static Public Member Functions

static Exports parseExportsFile (const BLOCXX_NAMESPACE::String &exportsFile)
 
static ExportEntry parseExportEntry (const BLOCXX_NAMESPACE::String &exportsLine)
 
static void writeExportsFile (const Exports &exports, const BLOCXX_NAMESPACE::String &exportsFile, const BLOCXX_NAMESPACE::String &backupSuffix)
 
static BLOCXX_NAMESPACE::String decodeSubStr (BLOCXX_NAMESPACE::String &str, const BLOCXX_NAMESPACE::String &stopAt)
 
static BLOCXX_NAMESPACE::String encodeString (const BLOCXX_NAMESPACE::String &str, bool exceptSpaces=false)
 

Private Attributes

KNfsExportRules * rules
 
bool dirty
 

Additional Inherited Members

- Public Types inherited from limal::nfs_server::Exports
enum  CommentType { E_LEADING, E_TRAILING }
 

Constructor & Destructor Documentation

limal::nfs_server::KNfsExports::KNfsExports ( )
limal::nfs_server::KNfsExports::KNfsExports ( const Exports exports)
limal::nfs_server::KNfsExports::KNfsExports ( const ExportEntries entries)
limal::nfs_server::KNfsExports::~KNfsExports ( )

Member Function Documentation

static BLOCXX_NAMESPACE::String limal::nfs_server::KNfsExports::decodeSubStr ( BLOCXX_NAMESPACE::String &  str,
const BLOCXX_NAMESPACE::String &  stopAt 
)
static

Decode first chunk of the string.

static BLOCXX_NAMESPACE::String limal::nfs_server::KNfsExports::encodeString ( const BLOCXX_NAMESPACE::String &  str,
bool  exceptSpaces = false 
)
static

Encode string to a form that can be written into a exports file. If exceptSpaces is true, the resulting string may be surrounded with quote marks ("") if it contains spaces. If exceptSpaces is false, all spaces are escaped to octal nmbers.

void limal::nfs_server::KNfsExports::load ( const BLOCXX_NAMESPACE::String &  exportsFile)

Loads export entries from the specified exports file TODO: and checks if all clients and options are known to knfs / using correct syntax.

Parameters
exportsFileThe exports file name.
static ExportEntry limal::nfs_server::KNfsExports::parseExportEntry ( const BLOCXX_NAMESPACE::String &  exportsLine)
static

Parse the specified (exports file encoded) line and construct an export entry object.

static Exports limal::nfs_server::KNfsExports::parseExportsFile ( const BLOCXX_NAMESPACE::String &  exportsFile)
static

Parse specified exports file and return export entries found in the file.

void limal::nfs_server::KNfsExports::save ( const BLOCXX_NAMESPACE::String &  exportsFile,
const BLOCXX_NAMESPACE::String &  backupSuffix 
)

Saves current exports to specified exports file name creating a backup first if backupSuffix is not empty and the exports file alteady existed.

Parameters
exportsFileThe exports file name.
backupSuffixThe suffix appended to exportsFile while writing a backup file.
bool limal::nfs_server::KNfsExports::validExportClient ( const ExportClient client) const
bool limal::nfs_server::KNfsExports::validExportEntry ( const ExportEntry entry) const
bool limal::nfs_server::KNfsExports::validExportOptions ( const ExportOptions options) const

Set export entries. Add export entry.

BLOCXX_NAMESPACE::Array<BLOCXX_NAMESPACE::String> limal::nfs_server::KNfsExports::verifyExportClient ( const ExportClient client) const
BLOCXX_NAMESPACE::Array<BLOCXX_NAMESPACE::String> limal::nfs_server::KNfsExports::verifyExportEntry ( const ExportEntry entry) const
BLOCXX_NAMESPACE::Array<BLOCXX_NAMESPACE::String> limal::nfs_server::KNfsExports::verifyExportOptions ( const ExportOptions options) const
static void limal::nfs_server::KNfsExports::writeExportsFile ( const Exports exports,
const BLOCXX_NAMESPACE::String &  exportsFile,
const BLOCXX_NAMESPACE::String &  backupSuffix 
)
static

Saves specified export entries to the exports file name creating a backup first, if backupSuffix is not empty and the exports file already existed. No knfs related checks for export clients and options are done.

Parameters
entriesThe export entries.
exportsFileThe exports file name.
backupSuffixThe suffix appended to exportsFile while writing a backup file.

Member Data Documentation

bool limal::nfs_server::KNfsExports::dirty
private
KNfsExportRules* limal::nfs_server::KNfsExports::rules
private

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