Skip to content

Commit

Permalink
コンストラクターの変更
Browse files Browse the repository at this point in the history
  • Loading branch information
molhot committed Sep 2, 2023
1 parent d69fcfb commit 52685cc
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 19 deletions.
10 changes: 10 additions & 0 deletions srcs/HttpRequest/BaseKeyValueMap.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#include "../includes/BaseKeyValueMap.hpp"

BaseKeyValueMap::BaseKeyValueMap()
{
//Nothing to do
}

BaseKeyValueMap::BaseKeyValueMap(const BaseKeyValueMap &other)
{
//Nothing to do
}

BaseKeyValueMap::~BaseKeyValueMap()
{
//Nothing to do
Expand Down
2 changes: 1 addition & 1 deletion srcs/HttpRequest/HttpRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +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])(key, line);
this->request_keyvalue_map = (this->*inputvalue_functionmap[key])(key, line);
}
}

Expand Down
15 changes: 15 additions & 0 deletions srcs/HttpRequest/TwoValueSet.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#include "../includes/TwoValueSet.hpp"

TwoValueSet::TwoValueSet()
{
// Nothing to do
}

TwoValueSet::TwoValueSet(std::string const &first_value)
{
this->_firstvalue = first_value;
Expand All @@ -11,6 +16,16 @@ TwoValueSet::TwoValueSet(const std::string &first_value, const std::string &seco
this->_secondValue = second_value;
}

TwoValueSet& TwoValueSet::operator=(const TwoValueSet &other)
{
if (this == &other)
return (*this);
this->_firstvalue = other.get_firstvalue();
this->_secondValue = other.get_secondvalue();

return (*this);
}

TwoValueSet::~TwoValueSet()
{

Expand Down
20 changes: 19 additions & 1 deletion srcs/HttpRequest/ValueArraySet.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
#include "../includes/ValueArraySet.hpp"

ValueArraySet::ValueArraySet()
{

}

ValueArraySet::ValueArraySet(const ValueArraySet &other)
{
this->_value_array = other.get_value_array();
}

ValueArraySet::ValueArraySet(const std::vector<std::string> &value_array)
{
this->_value_array = value_array;
}

ValueArraySet::~ValueArraySet()
ValueArraySet& ValueArraySet::operator=(const ValueArraySet &other)
{
if (this == &other)
return (*this);
this->_value_array = other.get_value_array();
return (*this);
}

ValueArraySet::~ValueArraySet()
{
//Nothing To Do
}

std::vector<std::string> ValueArraySet::get_value_array(void) const
Expand Down
18 changes: 18 additions & 0 deletions srcs/HttpRequest/ValueDateSet.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
#include "../includes/ValueDateSet.hpp"

ValueDateSet::ValueDateSet()
{

}

ValueDateSet& ValueDateSet::operator=(const ValueDateSet &other)
{
if (this == &other)
return (*this);
this->_day_name = other->get_valuedateset_day_name();
this->_day = other->get_valuedateset_day();
this->_month = other->get_valuedateset_month();
this->_year = other->get_valuedateset_year();
this->_hour = other->get_valuedateset_hour();
this->_minute = other->get_valuedateset_minute();
this->_second = other->get_valuedateset_second();
}

ValueDateSet::ValueDateSet(const std::string &date_format)
{
std::vector<std::string> value_array;
Expand Down
17 changes: 0 additions & 17 deletions srcs/HttpRequest/ValueInsertMethod.cpp

This file was deleted.

13 changes: 13 additions & 0 deletions srcs/HttpRequest/ValueMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ ValueMap::ValueMap()

}

ValueMap::ValueMap(const ValueMap &other)
{
this->_value_map = other.get_value_map();
}

ValueMap& ValueMap::operator=(const ValueMap &other)
{
if (this == &other)
return (*this);
this->_value_map = other.get_value_map();
return (*this);
}

ValueMap::~ValueMap()
{

Expand Down
18 changes: 18 additions & 0 deletions srcs/HttpRequest/ValueSet.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
#include "../includes/ValueSet.hpp"

ValueSet::ValueSet()
{

}

ValueSet::ValueSet(const ValueSet &other)
{
this->_value = other.get_value_set();
}

ValueSet& ValueSet::operator=(const ValueSet &other)
{
if (this == &other)
return (*this);
this->_value = other.get_value_set();
return (*this);
}

ValueSet::ValueSet(const std::string &value)
{
this->_value = value;
Expand Down

0 comments on commit 52685cc

Please sign in to comment.