00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef MS_CROSSLINKING_CONFIGFILE_HPP
00018 #define MS_CROSSLINKING_CONFIGFILE_HPP
00019
00020
00021 #include <string>
00022 #include <vector>
00023
00024
00025 namespace matrix_science {
00026 class ms_crosslinking_method;
00027
00033
00034
00048 class MS_MASCOTRESFILE_API ms_crosslinking_configfile: public ms_errors
00049 {
00050 public:
00052 ms_crosslinking_configfile();
00053
00055 ms_crosslinking_configfile(const char* fileName, const char* schemaFileName,
00056 const ms_connection_settings * cs = 0, bool useSchema = true);
00057
00059 ms_crosslinking_configfile(const ms_crosslinking_configfile& right);
00060
00062 virtual ~ms_crosslinking_configfile();
00063
00064 #ifndef SWIG
00065
00066 ms_crosslinking_configfile& operator=(const ms_crosslinking_configfile& right);
00067 #endif
00068
00069 void copyFrom(const ms_crosslinking_configfile* right);
00070
00072 virtual void defaultValues();
00073
00075 std::string getFileName() const;
00076
00078 void setFileName(const char* filename);
00079
00081 void setSchemaFileName(const char* name);
00082
00084 std::string getSchemaFileName() const;
00085
00087 static std::string getDefaultSchemaFileName();
00088
00090 void setConnectionSettings(const ms_connection_settings & cs);
00091
00093 ms_connection_settings getConnectionSettings() const;
00094
00096 void read_file();
00097
00099 void save_file();
00100
00102 void read_buffer(const char* buffer);
00103
00105 std::string save_buffer(bool validateAgainstSchema = true);
00106
00108 std::string validateDocument() const;
00109
00111 std::string getMajorVersion() const;
00112
00114 std::string getMinorVersion() const;
00115
00116
00118 int getNumberOfMethods() const;
00119
00121 void clearMethods();
00122
00124 void appendMethod(const ms_crosslinking_method *elem);
00125
00127 const ms_crosslinking_method * getMethodByNumber(const int idx) const;
00128
00130 const ms_crosslinking_method * getMethodByName(const char *name) const;
00131
00133 bool updateMethodByNumber(const int idx, const ms_crosslinking_method* method);
00134
00136 bool updateMethodByName(const char *name, const ms_crosslinking_method* method);
00137
00139 bool deleteMethodByNumber(const int idx);
00140
00142 bool deleteMethodByName(const char *name);
00143
00144
00145 private:
00146 std::string m_fileName;
00147 std::string m_schemaFileName;
00148 ms_connection_settings m_cs;
00149
00150 std::string m_majorVersion;
00151 std::string m_minorVersion;
00152
00153 std::string m_encodingName;
00154 bool m_useSchema;
00155
00156 typedef std::vector< ms_crosslinking_method* > method_vector;
00157 method_vector m_methods;
00158
00159 };
00160
00162
00163 }
00164
00165 #endif // MS_CROSSLINKING_CONFIGFILE_HPP
00166