Skip to content

Commit

Permalink
クラスの変更完了
Browse files Browse the repository at this point in the history
  • Loading branch information
molhot committed Aug 31, 2023
1 parent ddcecfa commit 53a11ef
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
5 changes: 2 additions & 3 deletions srcs/HttpRequest/HttpRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ HttpRequest::HttpRequest(const std::string &all_request_text)
key = this->obtain_request_key(line);
value = this->obtain_request_value(line);
if (this->check_keyword_exist(key) == true)
this->_key_value_map = (this->*inputvalue_functionmap[key])(line);
std::cout << "line ended" << std::endl;
this->_key_value_map = (this->*inputvalue_functionmap[key])(key, line);
}
}

Expand Down Expand Up @@ -849,7 +848,7 @@ void HttpRequest::set_x_xss_protection(const std::string &key, const std::string
}

template <typename T>
void HttpRequest<T>::ready_functionmap()
void HttpRequest::ready_functionmap()
{
this->inputvalue_functionmap["Accept"] = &HttpRequest::ready_accept;
this->inputvalue_functionmap["Accept-CH"] = &HttpRequest::set_accept_ch;
Expand Down
28 changes: 20 additions & 8 deletions srcs/HttpRequest/ValueDateSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,26 @@

ValueDateSet::ValueDateSet(const std::string &date_format)
{
//分割するための方法を書く
this->_year = date_format;
this->_day = "";
this->_month = "";
this->_year = "";
this->_hour = "";
this->_minute = "";
this->_second = "";
std::vector<std::string> value_array;

std::stringstream ss(all_value);
std::string line;

std::getline(ss, this->_day_name, ',');
std::getline(ss, line, ',');

std::stringstream sss(line);
std::getline(sss, this->_day, ' ');
std::getline(sss, this->_month, ' ');
std::getline(sss, this->_year, ' ');

std::string hour_minute_second;
std::getline(sss, hour_minute_second, ' ');

std::stringstream ssss(hour_minute_second);
std::getline(ssss, this->_hour, ':');
std::getline(ssss, this->_minute, ':');
std::getline(ssss, this->_second, ':');
}

ValueDateSet::~ValueDateSet()
Expand Down

0 comments on commit 53a11ef

Please sign in to comment.