00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MS_CRONOPTIONS_HPP
00020 #define MS_CRONOPTIONS_HPP
00021
00022
00023 #include <string>
00024 #include <vector>
00025
00026
00027 namespace matrix_science {
00033
00034
00037 class MS_MASCOTRESFILE_API ms_cronjob
00038 {
00039 friend class ms_datfile;
00040 friend class ms_cronoptions;
00041
00042 public:
00044 ms_cronjob();
00045
00047 ms_cronjob(const ms_cronjob& src);
00048
00050 ~ms_cronjob();
00051
00053 void defaultValues();
00054
00056 void copyFrom(const ms_cronjob* right);
00057
00058 #ifndef SWIG
00059
00060 ms_cronjob& operator=(const ms_cronjob& right);
00061 #endif
00062
00063 bool isEnabled() const;
00064
00066 void setEnabled(const bool enabled);
00067
00069 bool isMinute(const int min) const;
00070
00072 void setMinute(const int min, const bool value);
00073
00075 bool isHour(const int hour) const;
00076
00078 void setHour(const int hour, const bool value);
00079
00081 bool isDayOfMonth(const int day) const;
00082
00084 void setDayOfMonth(const int day, const bool value);
00085
00087 bool isMonthOfYear(const int month) const;
00088
00090 void setMonthOfYear(const int month, const bool value);
00091
00093 bool isDayOfWeek(const int day) const;
00094
00096 void setDayOfWeek(const int day, const bool value);
00097
00099 std::string getCommandStr() const;
00100
00102 void setCommandStr(const char* str);
00103
00104
00105 std::string getStringValue() const;
00106
00107 private:
00108 bool enabled_;
00109 bool minute_[60];
00110 bool hour_[24];
00111 bool dayOfMonth_[32];
00112 bool monthOfYear_[13];
00113 bool dayOfWeek_[7];
00114 std::string szCommand_;
00115
00116 void setCustomString();
00117 std::string customString_;
00118 };
00119
00121
00149 class MS_MASCOTRESFILE_API ms_cronoptions: public ms_customproperty
00150 {
00151 friend class ms_datfile;
00152 public:
00153
00155 ms_cronoptions();
00156
00158 ms_cronoptions(const ms_cronoptions& src);
00159
00161 ~ms_cronoptions();
00162
00164 void defaultValues();
00165
00167 void copyFrom(const ms_cronoptions* right);
00168
00169 #ifndef SWIG
00170
00171 ms_cronoptions& operator=(const ms_cronoptions& right);
00172 #endif
00173
00174 bool isSectionAvailable() const;
00175
00177 void setSectionAvailable(const bool value);
00178
00180 bool isCronEnabled() const;
00181
00183 void setCronEnabled(const bool value);
00184
00186 int getNumberOfCronJobs() const;
00187
00189 const ms_cronjob getCronJob(const int idx) const;
00190
00192 bool setCronJob(const int idx, const ms_cronjob job);
00193
00195 bool deleteCronJob(const int idx);
00196
00198 void clearCronJobs();
00199
00201 void appendCronJob(const ms_cronjob* job);
00202
00204 int getLoggingLevel() const;
00205
00207 bool setLoggingLevel(const int level);
00208
00210 std::string getLogFileName() const;
00211
00213 bool setLogFileName(const std::string & fileName);
00214
00215
00216 #ifdef SUPPRESS_MS_CUSTOMPROPERTY_INHERITANCE
00217 #include "suppress_ms_customproperty.hpp"
00218 #endif
00219
00220 private:
00221 int findProperty(const ms_cronjob & job) const;
00222 bool getPropertyNameValue(const ms_cronjob & job, std::string & name, std::string & value) const;
00223 bool sectionAvailable_;
00224 bool cronEnabled_;
00225 std::vector< ms_cronjob > cronJobArray_;
00226 int loggingLevel_;
00227 std::string logFileName_;
00228 };
00230 }
00231
00232 #endif // MS_CRONOPTIONS_HPP
00233
00234