limal-nfs-server
KNfsExports.hpp
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | |
3 | _ _ _ _ __ _ |
4 | | | | | | \_/ | / \ | | |
5 | | | | | | |_| | / /\ \ | | |
6 | | |__ | | | | | | / ____ \ | |__ |
7 | |____||_| |_| |_|/ / \ \|____| |
8 | |
9 | nfs-server library |
10 | |
11 | (C) SUSE Linux Products GmbH |
12 | (C) Novell, Inc. |
13 \----------------------------------------------------------------------/
14 
15  File: KNfsExports.hpp
16 
17  Author: Marius Tomaschewski, Chakravarthi P
18  Maintainer: Chakravarthi P
19 
20 /-*/
29 #ifndef LIMAL_NFS_SERVER_KNFS_EXPORTS_HPP
30 #define LIMAL_NFS_SERVER_KNFS_EXPORTS_HPP
31 
34 
35 #include <blocxx/String.hpp>
36 #include <blocxx/Array.hpp>
37 
38 
39 // -------------------------------------------------------------------
40 namespace LIMAL_NAMESPACE
41 {
42 namespace NFS_SERVER_NAMESPACE
43 {
44 
45 
46 class KNfsExportRules;
47 
48 
49 // -------------------------------------------------------------------
50 class KNfsExports: public Exports
51 {
52 public:
53  KNfsExports();
54  KNfsExports(const Exports &exports);
55  KNfsExports(const ExportEntries &entries);
56  ~KNfsExports();
57 
61  //void
62  //setEntries(const ExportEntries &entries);
63 
67  //void
68  //addEntry(const ExportEntry &entry);
69 
70  bool
71  validExportOptions (const ExportOptions &options) const;
72 
73  bool
74  validExportClient (const ExportClient &client) const;
75 
76  bool
77  validExportEntry (const ExportEntry &entry) const;
78 
79  blocxx::Array<blocxx::String>
80  verifyExportOptions(const ExportOptions &options) const;
81 
82  blocxx::Array<blocxx::String>
83  verifyExportClient (const ExportClient &client) const;
84 
85  blocxx::Array<blocxx::String>
86  verifyExportEntry (const ExportEntry &entry) const;
87 
88 
96  void
97  load(const blocxx::String &exportsFile);
98 
108  void
109  save(const blocxx::String &exportsFile,
110  const blocxx::String &backupSuffix);
111 
116  static Exports
117  parseExportsFile(const blocxx::String &exportsFile);
118 
123  static ExportEntry
124  parseExportEntry(const blocxx::String &exportsLine);
125 
138  static void
139  writeExportsFile(const Exports &exports,
140  const blocxx::String &exportsFile,
141  const blocxx::String &backupSuffix);
142 
146  static blocxx::String
147  decodeSubStr(blocxx::String &str, const blocxx::String &stopAt);
148 
155  static blocxx::String
156  encodeString(const blocxx::String &str, bool exceptSpaces=false);
157 
158 private:
159  KNfsExportRules *rules;
160  bool dirty;
161 };
162 
163 
164 // -------------------------------------------------------------------
165 } // End of NFS_SERVER_NAMESPACE
166 } // End of LIMAL_NAMESPACE
167 
168 #endif // LIMAL_NFS_SERVER_KNFS_EXPORTS_HPP
169 // vim: set ts=8 sts=8 sw=8 ai noet: