「🗑️」 clean(ex00): cleaned debug
This commit is contained in:
@@ -14,13 +14,8 @@ Date::Date(void)
|
|||||||
Date::Date(std::string str)
|
Date::Date(std::string str)
|
||||||
{
|
{
|
||||||
for (size_t i = 0; str[i]; ++i)
|
for (size_t i = 0; str[i]; ++i)
|
||||||
{
|
|
||||||
if (!isdigit(str[i]) && !((i == (str.length() - 6) || i == (str.length() - 3)) && str[i] == '-'))
|
if (!isdigit(str[i]) && !((i == (str.length() - 6) || i == (str.length() - 3)) && str[i] == '-'))
|
||||||
{
|
|
||||||
std::cout << str.length() - 6 << i << std::endl;
|
|
||||||
throw std::invalid_argument("invalid date.");
|
throw std::invalid_argument("invalid date.");
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_value = 0;
|
_value = 0;
|
||||||
for (std::string::iterator it = str.begin(); it < str.end(); ++it)
|
for (std::string::iterator it = str.begin(); it < str.end(); ++it)
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
date | value
|
date | value
|
||||||
2002.01-2 | 5
|
2002.01-2 | 5
|
||||||
|
|
||||||
|
2011-01-03 |
|
||||||
1971-01-02 | 5
|
1971-01-02 | 5
|
||||||
1971-31-02 | 5
|
1971-31-02 | 5
|
||||||
2011-01-03 | 3
|
2011-01-03 | 3
|
||||||
|
|||||||
Reference in New Issue
Block a user