diff options
clean up
18 files changed, 0 insertions, 427 deletions
| -rw-r--r-- | Utills/KN_exams_poll/README.md | 15 | ||||
| -rw-r--r-- | Utills/KN_exams_poll/poll.txt | 1 | ||||
| -rw-r--r-- | Utills/KN_exams_poll/schedule.md | 8 | ||||
| -rw-r--r-- | Utills/si_14.06/task1/Optional/Optional.hpp | 109 | ||||
| -rw-r--r-- | Utills/si_14.06/task1/Source.cpp | 17 | ||||
| -rw-r--r-- | Utills/si_14.06/task2/Source.cpp | 14 | ||||
| -rw-r--r-- | Utills/si_14.06/task2/ValueArray/ValueArray.cpp | 72 | ||||
| -rw-r--r-- | Utills/si_14.06/task2/ValueArray/ValueArray.h | 26 | ||||
| -rw-r--r-- | Utills/si_14.06/task2/Values/Date/Date.cpp | 19 | ||||
| -rw-r--r-- | Utills/si_14.06/task2/Values/Date/Date.h | 22 | ||||
| -rw-r--r-- | Utills/si_14.06/task2/Values/DateTime/DateTime.cpp | 14 | ||||
| -rw-r--r-- | Utills/si_14.06/task2/Values/DateTime/DateTime.h | 14 | ||||
| -rw-r--r-- | Utills/si_14.06/task2/Values/String/StringValue.cpp | 14 | ||||
| -rw-r--r-- | Utills/si_14.06/task2/Values/String/StringValue.h | 15 | ||||
| -rw-r--r-- | Utills/si_14.06/task2/Values/Time/Time.cpp | 19 | ||||
| -rw-r--r-- | Utills/si_14.06/task2/Values/Time/Time.h | 19 | ||||
| -rw-r--r-- | Utills/si_14.06/task2/Values/ValueBase/Value.cpp | 11 | ||||
| -rw-r--r-- | Utills/si_14.06/task2/Values/ValueBase/Value.h | 18 |
diff --git a/Utills/KN_exams_poll/README.md b/Utills/KN_exams_poll/README.md deleted file mode 100644 index a5a7125..0000000 --- a/Utills/KN_exams_poll/README.md +++ /dev/null @@ -1,15 +0,0 @@ -Събеседването ще се проведе **присъствено във ФМИ**. - -Събеседването ще се състои и 3-те дни от **16:00 в зала 101**. -Разпределние по дни: -| 29.06 | 01.07 | 02.07 | -|-------|-------|-------| -| 82097 | 82302 | 81864 | -| 82264 | 82273 | 82291 | -| 82178 | 82285 | 82266 | -| 82281 | 82278 | 82275 | -| 81930 | 82271 | 82103 | -| 81928 | 82287 | 82090 | -| | 82303 | 82268 | -| | | 82262 | -| | | 81448 | diff --git a/Utills/KN_exams_poll/poll.txt b/Utills/KN_exams_poll/poll.txt deleted file mode 100644 index 4ffc75f..0000000 --- a/Utills/KN_exams_poll/poll.txt +++ /dev/null @@ -1 +0,0 @@ -https://forms.gle/2ciPStWkxz319C8k9 diff --git a/Utills/KN_exams_poll/schedule.md b/Utills/KN_exams_poll/schedule.md deleted file mode 100644 index 10f8757..0000000 --- a/Utills/KN_exams_poll/schedule.md +++ /dev/null @@ -1,8 +0,0 @@ -Дати: - - - 29.06 - - 01.07 - - 02.07 - -[Анкета за ден за събеседване](https://forms.gle/2ciPStWkxz319C8k9) - diff --git a/Utills/si_14.06/task1/Optional/Optional.hpp b/Utills/si_14.06/task1/Optional/Optional.hpp deleted file mode 100644 index cf1ec0d..0000000 --- a/Utills/si_14.06/task1/Optional/Optional.hpp +++ /dev/null @@ -1,109 +0,0 @@ -#include <iostream> - -template <typename T> -class Optional -{ - T* objPtr; - - void copyFrom(const Optional<T>& other); - void free(); - -public: - Optional(); - Optional(const T& obj); - - Optional(const Optional& other); - Optional<T>& operator=(const Optional<T>& other); - - ~Optional(); - - void setValue(const T& obj); - T getValue() const; - - bool containsValue() const; - - bool operator==(const Optional<T>& other) const; - bool operator!=(const Optional<T>& other) const; -}; - -template <typename T> -Optional<T>::Optional() : objPtr(nullptr) -{}; - -template <typename T> -Optional<T>::Optional(const T& obj) -{ - objPtr = new T(obj); -} - -template <typename T> -void Optional<T>::setValue(const T& obj) -{ - delete objPtr; - objPtr = new T(obj); -} - -template <typename T> -T Optional<T>::getValue() const -{ - if (!obj) - throw std::exception("No value assigned!"); - return *objPtr; -} - -template <typename T> -bool Optional<T>::containsValue() const -{ - return objPtr != nullptr; -} - -template <typename T> -void Optional<T>::copyFrom(const Optional<T>& other) -{ - if (!other.obj) - objPtr = nullptr; - else - objPtr = new T(*other.obj); -} - -template <typename T> -void Optional<T>::free() -{ - delete objPtr; -} - -template <typename T> -Optional<T>::Optional(const Optional<T>& other) -{ - copyFrom(other); -} - -template <typename T> -Optional<T>& Optional<T>::operator=(const Optional<T>& other) -{ - if (this != &other) - { - free(); - copyFrom(other); - } - - return *this; -} - -template <typename T> -Optional<T>::~Optional() -{ - free(); -} - -template <typename T> -bool Optional<T>::operator==(const Optional<T>& other) const -{ - return (!objPtr && !other.objPtr) || (objPtr && other.objPtr && *objPtr == *other.objPtr); -} - -template <typename T> -bool Optional<T>::operator!=(const Optional<T>& other) const -{ - return !operator==(other); -} diff --git a/Utills/si_14.06/task1/Source.cpp b/Utills/si_14.06/task1/Source.cpp deleted file mode 100644 index d8397a0..0000000 --- a/Utills/si_14.06/task1/Source.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include <iostream> -#include "Optional/Optional.hpp" - - - -int main() -{ - Optional<int> o; - - std::cout << o.containsValue() << std::endl; - - o.setValue(12); - - Optional<int> o2(12); - - std::cout << (o == o2) << std::endl; -}
\ No newline at end of file diff --git a/Utills/si_14.06/task2/Source.cpp b/Utills/si_14.06/task2/Source.cpp deleted file mode 100644 index e8e1a2d..0000000 --- a/Utills/si_14.06/task2/Source.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include <iostream> -#include "ValueArray/ValueArray.h" - -int main() -{ - ValueArray v; - - v.addDate("First school day",15, 9, 2021); - v.addTime("Work day start", 10, 15); - v.addDateTime("Portugal - Germany", 19, 06, 2021, 19, 10); - v.addString("Name", "Test"); - - v.print(); -}
\ No newline at end of file diff --git a/Utills/si_14.06/task2/ValueArray/ValueArray.cpp b/Utills/si_14.06/task2/ValueArray/ValueArray.cpp deleted file mode 100644 index 8e06a95..0000000 --- a/Utills/si_14.06/task2/ValueArray/ValueArray.cpp +++ /dev/null @@ -1,72 +0,0 @@ -#include <iostream> -#include "ValueArray.h" -#include "../Values/Date/Date.h" -#include "../Values/Time/Time.h" -#include "../Values/String/StringValue.h" -#include "../Values/DateTime/DateTime.h" - -void ValueArray::print() const -{ - std::cout << "["; - for (int i = 0; i < arr.size(); i++) - { - std::cout << arr[i]->toString(); - - if (i != arr.size() - 1) - std::cout << ", "; - - } - std::cout << "]"; -} - - -void ValueArray::free() -{ - for (int i = 0; i < arr.size(); i++) - delete arr[i]; - arr.clear(); -} - -void ValueArray::copyFrom(const ValueArray& other) -{ - arr.resize(other.arr.size()); - - for (int i = 0; i < arr.size(); i++) - arr[i] = other.arr[i]->clone(); -} - -void ValueArray::addDate(const std::string& name, unsigned day, unsigned month, unsigned year) -{ - arr.push_back(new Date(name, day, month, year)); -} -void ValueArray::addTime(const std::string& name, unsigned hours, unsigned mins) -{ - arr.push_back(new Time(name, hours, mins)); -} -void ValueArray::addString(const std::string& name, const std::string& value) -{ - arr.push_back(new StringValue(name,value)); -} -void ValueArray::addDateTime(const std::string& name, unsigned day, unsigned month, unsigned year, unsigned hours, unsigned mins) -{ - arr.push_back(new DateTime(name, day, month, year, hours, mins)); -} - -ValueArray::ValueArray(const ValueArray& other) -{ - copyFrom(other); -} -ValueArray& ValueArray::operator= (const ValueArray& other) -{ - if (this != &other) - { - free(); - copyFrom(other); - } - return *this; -} - -ValueArray::~ValueArray() -{ - free(); -}
\ No newline at end of file diff --git a/Utills/si_14.06/task2/ValueArray/ValueArray.h b/Utills/si_14.06/task2/ValueArray/ValueArray.h deleted file mode 100644 index 39bdcbc..0000000 --- a/Utills/si_14.06/task2/ValueArray/ValueArray.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include <vector> -#include "../Values/ValueBase/Value.h" - -class ValueArray -{ - std::vector<Value*> arr; - - void copyFrom(const ValueArray& other); - void free(); - -public: - void print() const; - - ValueArray() = default; - ValueArray(const ValueArray& other); - ValueArray& operator=(const ValueArray& other); - - //factory pattern ? - void addDate(const std::string& name, unsigned day, unsigned month, unsigned year); - void addTime(const std::string& name, unsigned hours, unsigned mins); - void addString(const std::string& name, const std::string& value); - void addDateTime(const std::string& name, unsigned day, unsigned month, unsigned year, unsigned hours, unsigned mins); - ~ValueArray(); -};
\ No newline at end of file diff --git a/Utills/si_14.06/task2/Values/Date/Date.cpp b/Utills/si_14.06/task2/Values/Date/Date.cpp deleted file mode 100644 index 3d872d3..0000000 --- a/Utills/si_14.06/task2/Values/Date/Date.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "Date.h" - -//validation is needed for the date fields! -Date::Date(const std::string& name, unsigned day, unsigned month, unsigned year) : Value(name), year(year), month(month), day(day) -{} - -std::string Date::getDateString() const -{ - return std::to_string(day) + "." + std::to_string(month) + "." + std::to_string(year);; -} -std::string Date::toString() const -{ - return getPrefix() + getDateString() + "}"; -} - -Value* Date::clone() const -{ - return new Date(*this); -}
\ No newline at end of file diff --git a/Utills/si_14.06/task2/Values/Date/Date.h b/Utills/si_14.06/task2/Values/Date/Date.h deleted file mode 100644 index 6194225..0000000 --- a/Utills/si_14.06/task2/Values/Date/Date.h +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -#include "../ValueBase/Value.h" - -class Date : public virtual Value -{ - unsigned day; - unsigned month; - unsigned year; - -protected: - - std::string getDateString() const; - -public: - - Date(const std::string& name, unsigned day, unsigned month, unsigned year); - - Value* clone() const; - - std::string toString() const; -};
\ No newline at end of file diff --git a/Utills/si_14.06/task2/Values/DateTime/DateTime.cpp b/Utills/si_14.06/task2/Values/DateTime/DateTime.cpp deleted file mode 100644 index b2e7e97..0000000 --- a/Utills/si_14.06/task2/Values/DateTime/DateTime.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "DateTime.h" - -DateTime::DateTime(const std::string& name, size_t day, size_t month, size_t year, size_t hours, size_t mins) : Value(name), Date(name, day, month, year), Time(name, hours,mins) -{} - -std::string DateTime::toString() const -{ - return getPrefix() + getDateString() + ", " + getTimeString() + "}"; -} - -Value* DateTime::clone() const -{ - return new DateTime(*this); -}
\ No newline at end of file diff --git a/Utills/si_14.06/task2/Values/DateTime/DateTime.h b/Utills/si_14.06/task2/Values/DateTime/DateTime.h deleted file mode 100644 index 61d6a9a..0000000 --- a/Utills/si_14.06/task2/Values/DateTime/DateTime.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include "../Date/Date.h" -#include "../Time/Time.h" - -class DateTime : public Date, public Time -{ -public: - DateTime(const std::string& name, size_t day, size_t month, size_t year, size_t hours, size_t mins); - - std::string toString() const; - - Value* clone() const; -};
\ No newline at end of file diff --git a/Utills/si_14.06/task2/Values/String/StringValue.cpp b/Utills/si_14.06/task2/Values/String/StringValue.cpp deleted file mode 100644 index 8d47f24..0000000 --- a/Utills/si_14.06/task2/Values/String/StringValue.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "StringValue.h" - -StringValue::StringValue(const std::string& name, const std::string& value) : Value(name), value(value) -{} - -std::string StringValue::toString() const -{ - return getPrefix() + '\"' + value + '\"' + "}"; -} - -Value* StringValue::clone() const -{ - return new StringValue(*this); -}
\ No newline at end of file diff --git a/Utills/si_14.06/task2/Values/String/StringValue.h b/Utills/si_14.06/task2/Values/String/StringValue.h deleted file mode 100644 index 4e1500f..0000000 --- a/Utills/si_14.06/task2/Values/String/StringValue.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include "../ValueBase/Value.h" - -class StringValue : public Value -{ - std::string value; -public: - - StringValue(const std::string& name, const std::string& value); - - Value* clone() const; - - std::string toString() const; -};
\ No newline at end of file diff --git a/Utills/si_14.06/task2/Values/Time/Time.cpp b/Utills/si_14.06/task2/Values/Time/Time.cpp deleted file mode 100644 index 5b49e54..0000000 --- a/Utills/si_14.06/task2/Values/Time/Time.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "Time.h" - -//validation is needed for the time fields! -Time::Time(const std::string& name, unsigned hours, unsigned mins) : Value(name), hours(hours), mins(mins) -{} - -std::string Time::getTimeString() const -{ - return std::to_string(hours) + ":" + std::to_string(mins); -} -std::string Time::toString() const -{ - return getPrefix() + getTimeString() + "}"; -} - -Value* Time::clone() const -{ - return new Time(*this); -}
\ No newline at end of file diff --git a/Utills/si_14.06/task2/Values/Time/Time.h b/Utills/si_14.06/task2/Values/Time/Time.h deleted file mode 100644 index 1d93d49..0000000 --- a/Utills/si_14.06/task2/Values/Time/Time.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once - -#include "../ValueBase/Value.h" - -class Time : public virtual Value -{ - unsigned hours; - unsigned mins; - -protected: - std::string Time::getTimeString() const; - -public: - Time(const std::string& name, unsigned hours, unsigned mins); - - Value* clone() const; - - std::string toString() const; -};
\ No newline at end of file diff --git a/Utills/si_14.06/task2/Values/ValueBase/Value.cpp b/Utills/si_14.06/task2/Values/ValueBase/Value.cpp deleted file mode 100644 index cd7c821..0000000 --- a/Utills/si_14.06/task2/Values/ValueBase/Value.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "Value.h" - -Value::Value(const std::string& valueName) : valueName(valueName) -{ - -} - -std::string Value::getPrefix() const -{ - return "{ " + valueName + " : "; -}
\ No newline at end of file diff --git a/Utills/si_14.06/task2/Values/ValueBase/Value.h b/Utills/si_14.06/task2/Values/ValueBase/Value.h deleted file mode 100644 index e3320f3..0000000 --- a/Utills/si_14.06/task2/Values/ValueBase/Value.h +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once -#include <string> - -class Value -{ -protected: - std::string valueName; -public: - Value(const std::string& valueName); - - std::string getPrefix() const; - - virtual std::string toString() const = 0; - - virtual Value* clone() const = 0; - - virtual ~Value(){} -};
\ No newline at end of file |
