summaryrefslogtreecommitdiff
path: root/plugins/!NotAdopted/name_day/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/!NotAdopted/name_day/calendar')
-rw-r--r--plugins/!NotAdopted/name_day/calendar/calendar.cpp157
-rw-r--r--plugins/!NotAdopted/name_day/calendar/calendar.h37
2 files changed, 0 insertions, 194 deletions
diff --git a/plugins/!NotAdopted/name_day/calendar/calendar.cpp b/plugins/!NotAdopted/name_day/calendar/calendar.cpp
deleted file mode 100644
index 209ed2e6a2..0000000000
--- a/plugins/!NotAdopted/name_day/calendar/calendar.cpp
+++ /dev/null
@@ -1,157 +0,0 @@
-/**
- * FIXME:
- *
- *
- */
-
-#include "calendar.h"
-
-
-
-/**
- * @brief constructor
- * @param static names Static array of calendar names.
- *
- * Insert the names into the dynamic array.
- */
-calendar_t::calendar_t(const char *const *const static_names, const size_t names_count, const unsigned icon_id) //:
- //country
- //icon_id
- //names
-{
- names.resize(names_count);
-
- // The first element of the static array is the country name.
-
- country = static_names[0];
-
- for (size_t i = 0; i < names_count - 1; ++i) {
- names[i] = static_names[i + 1];
- }
-
- this->icon_id = icon_id;
-}
-
-
-/**
- * @brief destructor
- *
- */
-calendar_t::~calendar_t(void)
-{
- names.clear();
-}
-
-/**
- * @brief get_name
- * @param day_in_year
- *
- */
-const string &calendar_t::get_name(const unsigned day_in_year) const
-{
- return names[day_in_year];
-}
-
-/**
- * @brief get the day in the year.
- * @return index
- * @param month
- * @param day
- *
- */
-unsigned calendar_t::get_day_in_year(const unsigned month, const unsigned day) const
-{
- // NOTE: it's too late for me to come with some clever
- // alg. for this... :)
-
-
- unsigned index = day + 29 * (month - 1) - 1;
-
- if (month == 1) {
- return index;
- }
-
- // January
- index += 2;
-
- // Jan & Feb end.
- if (month == 2 || month == 3) {
- return index;
- }
-
-
- index += 2;
-
- if (month == 4) {
- return index;
- }
-
- index += 1;
-
- if (month == 5) {
- return index;
- }
-
- index += 2;
-
- if (month == 6) {
- return index;
- }
-
- index += 1;
-
- if (month == 7) {
- return index;
- }
-
- index += 2;
-
- if (month == 8) {
- return index;
- }
-
- index += 2;
-
- if (month == 9) {
- return index;
- }
-
- index += 1;
-
- if (month == 10) {
- return index;
- }
-
- index += 2;
-
- if (month == 11) {
- return index;
- }
-
- index += 1;
-
- return index;
-}
-
-/**
- * @brief get the name
- * @param day Day in month
- * @param month Month in year
- *
- */
-const string &calendar_t::get_name(const unsigned day, const unsigned month) const
-{
- const unsigned day_in_year = get_day_in_year(day, month);
-
- return get_name(day_in_year);
-}
-
-/**
- * @brief get name count
- * @return name_count
- *
- */
-unsigned calendar_t::get_name_count(void) const
-{
- return names.size();
-} \ No newline at end of file
diff --git a/plugins/!NotAdopted/name_day/calendar/calendar.h b/plugins/!NotAdopted/name_day/calendar/calendar.h
deleted file mode 100644
index fda275297f..0000000000
--- a/plugins/!NotAdopted/name_day/calendar/calendar.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * FIXME:
- *
- */
-#ifndef calendar_h
-#define calendar_h
-
-#include <vector>
-#include <string>
-using namespace std;
-
-class calendar_t
-{
- public:
- calendar_t (const char *const *const static_names, const size_t names_count, const unsigned icon_id);
- ~calendar_t ();
-
- const string &get_name (const unsigned day_in_year) const;
- const string &get_name (const unsigned day, const unsigned month) const;
-
- unsigned get_day_in_year (const unsigned month, const unsigned day) const;
- unsigned get_name_count (void) const;
-
-
-
- string country;
- unsigned icon_id;
-
- private:
- calendar_t () {};
-
- vector<string> names;
-
-};
-
-
-#endif // calendar_h \ No newline at end of file