00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00025 #ifndef LIMAL_NFS_SERVER_NFS_EXPORTS_HPP
00026 #define LIMAL_NFS_SERVER_NFS_EXPORTS_HPP
00027
00028 #include <limal/nfs-server/config.h>
00029 #include <blocxx/String.hpp>
00030 #include <blocxx/Array.hpp>
00031 #include <blocxx/List.hpp>
00032 #include <blocxx/Map.hpp>
00033
00034
00035
00036 namespace LIMAL_NAMESPACE
00037 {
00038 namespace NFS_SERVER_NAMESPACE
00039 {
00040
00041
00042
00050 class ExportOption
00051 {
00052 public:
00056 ExportOption();
00057
00072 ExportOption(const blocxx::String &name,
00073 const blocxx::String &value);
00074
00089 ExportOption(const blocxx::String &option);
00090
00096 ExportOption(const ExportOption &option);
00097
00101 ~ExportOption();
00102
00108 bool empty() const;
00109
00116 blocxx::String toString() const;
00117
00123 blocxx::String getName() const;
00124
00130 blocxx::String getValue() const;
00131
00136 void setName(const blocxx::String &name);
00137
00141 void setValue(const blocxx::String &value);
00142
00157 void setOption(const blocxx::String &option);
00158
00159 #ifndef SWIG
00160 friend bool
00161 operator == (const ExportOption & o1, const ExportOption & o2);
00162
00163 friend bool
00164 operator < (const ExportOption & o1, const ExportOption & o2);
00165 #endif
00166
00167 private:
00168 blocxx::String m_name;
00169 blocxx::String m_value;
00170 };
00171
00172
00173
00178 typedef blocxx::List<ExportOption> ExportOptions;
00179
00180
00181
00190 class ExportClient
00191 {
00192 public:
00196 ExportClient();
00197
00203 ExportClient(const ExportClient &client);
00204
00220 ExportClient(const blocxx::String &client,
00221 const ExportOptions &options);
00222
00234 ExportClient(const blocxx::String &client,
00235 const blocxx::String &options);
00236
00249 ExportClient(const blocxx::String &clientAndOpts);
00250
00254 ~ExportClient();
00255
00262 bool empty() const;
00263
00270 blocxx::String toString() const;
00271
00277 blocxx::String getClient() const;
00278
00284 ExportOptions getOptions() const;
00285
00291 blocxx::String getOptionsString() const;
00292
00298 void setClient (const blocxx::String &client);
00299
00305 void setOptions(const ExportOptions &options);
00306
00312 void setOptions(const blocxx::String &options);
00313
00318 static
00319 ExportOptions parseOptions(const blocxx::String &options);
00320
00321 #ifndef SWIG
00322 friend bool
00323 operator == (const ExportClient &c1, const ExportClient &c2);
00324
00325 friend bool
00326 operator < (const ExportClient &c1, const ExportClient &c2);
00327 #endif
00328
00329 private:
00330 blocxx::String m_client;
00331 ExportOptions m_options;
00332 };
00333
00334
00335
00340 typedef blocxx::List<ExportClient> ExportClients;
00341
00342
00343
00348 typedef blocxx::Array<blocxx::String> ExportComment;
00349
00350
00351
00356 class ExportEntry
00357 {
00358 public:
00362 ExportEntry();
00363
00369 ExportEntry(const ExportEntry &entry);
00370
00371
00379 ExportEntry(const blocxx::String &path,
00380 const ExportClients &clients);
00381
00390 ExportEntry(const blocxx::String &path,
00391 const ExportClients &clients,
00392 const ExportComment &comment);
00393
00397 ~ExportEntry();
00398
00404 bool empty() const;
00405
00409 blocxx::String toString() const;
00410
00415 blocxx::StringArray toStringArray() const;
00416
00420 blocxx::String getPath() const;
00421
00425 ExportClients getClients() const;
00426
00430 ExportComment getComment() const;
00431
00437 void setPath(const blocxx::String &path);
00438
00444 void setClients(const ExportClients &clients);
00445
00451 void setComment(const ExportComment &comment);
00452
00460 bool addClient(const ExportClient &client);
00461
00469 bool removeClient(const blocxx::String &cname);
00470
00477 bool removeClient(const ExportClient &client);
00478
00483 void removeClients();
00484
00485 #ifndef SWIG
00486 friend bool
00487 operator == (const ExportEntry &e1, const ExportEntry &e2);
00488
00489 friend bool
00490 operator < (const ExportEntry &e1, const ExportEntry &e2);
00491 #endif
00492
00493 private:
00494 blocxx::String m_path;
00495 ExportClients m_clients;
00496 ExportComment m_comment;
00497 };
00498
00499
00500
00505 typedef blocxx::List<ExportEntry> ExportEntries;
00506 typedef blocxx::List<blocxx::String> ExportPaths;
00507
00508
00509
00514 class Exports
00515 {
00516 public:
00517 enum CommentType
00518 {
00519 E_LEADING,
00520 E_TRAILING
00521 };
00522
00526 Exports();
00527
00533 Exports(const Exports &exports);
00534
00541 Exports(const ExportEntries &entries);
00542
00546 ~Exports();
00547
00551 ExportPaths getPaths() const;
00552
00556 ExportClients getClients(const blocxx::String &path) const;
00557
00561 ExportEntries getEntries(const blocxx::String &path) const;
00562
00566 ExportEntries getEntries() const;
00567
00571 ExportComment getComment(CommentType type) const;
00572
00578 void setEntries(const ExportEntries &entries);
00579
00586 void setComment(const ExportComment &comment,
00587 CommentType type);
00588
00598 void addEntry(const ExportEntry &entry);
00599
00600
00601 private:
00602 ExportEntries m_entries;
00603 ExportComment l_comment;
00604 ExportComment t_comment;
00605
00606 };
00607
00608
00609
00610 }
00611 }
00612
00613 #endif // LIMAL_NFS_SERVER_NFS_EXPORTS_HPP
00614