limal-nfs-server
|
00001 /*---------------------------------------------------------------------\ 00002 | | 00003 | _ _ _ _ __ _ | 00004 | | | | | | \_/ | / \ | | | 00005 | | | | | | |_| | / /\ \ | | | 00006 | | |__ | | | | | | / ____ \ | |__ | 00007 | |____||_| |_| |_|/ / \ \|____| | 00008 | | 00009 | nfs-server library | 00010 | | 00011 | (C) SUSE Linux Products GmbH | 00012 | (C) Novell, Inc. | 00013 \----------------------------------------------------------------------/ 00014 00015 File: KNfsExports.hpp 00016 00017 Author: Marius Tomaschewski, Chakravarthi P 00018 Maintainer: Chakravarthi P 00019 00020 /-*/ 00029 #ifndef LIMAL_NFS_SERVER_KNFS_EXPORTS_HPP 00030 #define LIMAL_NFS_SERVER_KNFS_EXPORTS_HPP 00031 00032 #include <limal/nfs-server/config.h> 00033 #include <limal/nfs-server/NfsExports.hpp> 00034 00035 #include <blocxx/String.hpp> 00036 #include <blocxx/Array.hpp> 00037 00038 00039 // ------------------------------------------------------------------- 00040 namespace LIMAL_NAMESPACE 00041 { 00042 namespace NFS_SERVER_NAMESPACE 00043 { 00044 00045 00046 class KNfsExportRules; 00047 00048 00049 // ------------------------------------------------------------------- 00050 class KNfsExports: public Exports 00051 { 00052 public: 00053 KNfsExports(); 00054 KNfsExports(const Exports &exports); 00055 KNfsExports(const ExportEntries &entries); 00056 ~KNfsExports(); 00057 00061 //void 00062 //setEntries(const ExportEntries &entries); 00063 00067 //void 00068 //addEntry(const ExportEntry &entry); 00069 00070 bool 00071 validExportOptions (const ExportOptions &options) const; 00072 00073 bool 00074 validExportClient (const ExportClient &client) const; 00075 00076 bool 00077 validExportEntry (const ExportEntry &entry) const; 00078 00079 blocxx::Array<blocxx::String> 00080 verifyExportOptions(const ExportOptions &options) const; 00081 00082 blocxx::Array<blocxx::String> 00083 verifyExportClient (const ExportClient &client) const; 00084 00085 blocxx::Array<blocxx::String> 00086 verifyExportEntry (const ExportEntry &entry) const; 00087 00088 00096 void 00097 load(const blocxx::String &exportsFile); 00098 00108 void 00109 save(const blocxx::String &exportsFile, 00110 const blocxx::String &backupSuffix); 00111 00116 static Exports 00117 parseExportsFile(const blocxx::String &exportsFile); 00118 00123 static ExportEntry 00124 parseExportEntry(const blocxx::String &exportsLine); 00125 00138 static void 00139 writeExportsFile(const Exports &exports, 00140 const blocxx::String &exportsFile, 00141 const blocxx::String &backupSuffix); 00142 00146 static blocxx::String 00147 decodeSubStr(blocxx::String &str, const blocxx::String &stopAt); 00148 00155 static blocxx::String 00156 encodeString(const blocxx::String &str, bool exceptSpaces=false); 00157 00158 private: 00159 KNfsExportRules *rules; 00160 bool dirty; 00161 }; 00162 00163 00164 // ------------------------------------------------------------------- 00165 } // End of NFS_SERVER_NAMESPACE 00166 } // End of LIMAL_NAMESPACE 00167 00168 #endif // LIMAL_NFS_SERVER_KNFS_EXPORTS_HPP 00169 // vim: set ts=8 sts=8 sw=8 ai noet: