Skip to content

Commit

Permalink
要約入力された値に関して取得し、mapに格納可能になる
Browse files Browse the repository at this point in the history
  • Loading branch information
molhot committed Sep 3, 2023
1 parent dac23df commit 63d9aa8
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 29 deletions.
2 changes: 2 additions & 0 deletions srcs/includes/BaseKeyValueMap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class BaseKeyValueMap
BaseKeyValueMap(void);
BaseKeyValueMap(const BaseKeyValueMap &other);
virtual ~BaseKeyValueMap();

virtual void show_value() = 0;
};

#endif
5 changes: 4 additions & 1 deletion srcs/includes/HandlingString.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef HANDLINGSTRING_HPP
#define HANDLINGSTRING_HPP

#include <string>
#include <iostream>
Expand Down Expand Up @@ -30,3 +31,5 @@ class HandlingString
static std::string obtain_beforeword(const std::string other, char delimiter);
static std::string obtain_afterword(const std::string other, char delimiter);
};

#endif
22 changes: 10 additions & 12 deletions srcs/includes/HttpRequest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class HttpRequest
{
private:
RequestLine _requestline;
std::map<std::string, void(*)()> inputvalue_functionmap;
std::map<std::string, BaseKeyValueMap> request_keyvalue_map;
std::map<std::string, void(HttpRequest::*)(const std::string&, const std::string&)> inputvalue_functionmap;
std::map<std::string, BaseKeyValueMap*> request_keyvalue_map;

HttpRequest();
HttpRequest(const HttpRequest &other);
Expand All @@ -41,12 +41,12 @@ class HttpRequest
std::string obtain_request_key(const std::string value);
std::string obtain_request_value(const std::string value);

TwoValueSet ready_TwoValueSet(const std::string &value);
ValueArraySet ready_ValueArraySet(const std::string &value);
ValueDateSet ready_ValueDateSet(const std::string &value);
ValueMap ready_ValueMap(const std::string &value);
ValueSet ready_ValueSet(const std::string &value);
ValueWeightArraySet ready_ValueWeightArraySet(const std::string &value);
TwoValueSet *ready_TwoValueSet(const std::string &value);
ValueArraySet *ready_ValueArraySet(const std::string &value);
ValueDateSet *ready_ValueDateSet(const std::string &value);
ValueMap *ready_ValueMap(const std::string &value);
ValueSet *ready_ValueSet(const std::string &value);
ValueWeightArraySet *ready_ValueWeightArraySet(const std::string &value);
void ready_functionmap(void);

public:
Expand Down Expand Up @@ -75,7 +75,7 @@ class HttpRequest
void set_allow(const std::string &key,const std::string &value);
void set_alt_svc(const std::string &key,const std::string &value);
void set_alt_used(const std::string &key,const std::string &value);
void set_authorization(const std::string &value);
void set_authorization(const std::string &key, const std::string &value);
// void set//か全くわからない うまく分けられん
void set_clear_site_data(const std::string &key,const std::string &value);
void set_connection(const std::string &key,const std::string &value);
Expand Down Expand Up @@ -144,9 +144,7 @@ class HttpRequest
void set_x_xss_protection(const std::string &key,const std::string &value);

//debug関数
void show_requestinfs(void) const;
void show_requestinfs(void);
};

#include "../HttpRequest/HttpRequest.cpp"

#endif
4 changes: 1 addition & 3 deletions srcs/includes/TwoValueSet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ class TwoValueSet: public BaseKeyValueMap
private:
std::string _firstvalue;
std::string _secondValue;

TwoValueSet& operator=(const TwoValueSet &other);

public:
TwoValueSet();
Expand All @@ -23,7 +21,7 @@ class TwoValueSet: public BaseKeyValueMap
std::string get_firstvalue(void) const;
std::string get_secondvalue(void) const;

void show_allvalue(void) const;
void show_value(void);
};

#endif
4 changes: 2 additions & 2 deletions srcs/includes/ValueArraySet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ class ValueArraySet: public BaseKeyValueMap
public:
ValueArraySet();
ValueArraySet(const ValueArraySet &other);
ValueArraySet(const std::vector<std::string> value_array);
ValueArraySet(const std::vector<std::string> &value_array);
ValueArraySet &operator=(const ValueArraySet &other);
~ValueArraySet();

std::vector<std::string> get_value_array(void) const;

void show_value_array_set(void);
void show_value(void);
};

#endif
22 changes: 11 additions & 11 deletions srcs/includes/ValueDateSet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#define VALUEDATESET_HPP

#include <string>
#include <iostream>
#include <sstream>

#include "BaseKeyValueMap.hpp"

Expand All @@ -16,24 +18,22 @@ class ValueDateSet: public BaseKeyValueMap
std::string _minute;
std::string _second;

ValueDateSet();
ValueDateSet(const ValueDateSet &other);
ValueDateSet& operator=(const ValueDateSet &other);

public:
ValueDateSet();
ValueDateSet(const ValueDateSet &other);
ValueDateSet& operator=(const ValueDateSet &other);
ValueDateSet(const std::string &date_format);
~ValueDateSet();

std::string get_valuedateset_day_name();
std::string get_valuedateset_day();
std::string get_valuedateset_month();
std::string get_valuedateset_year();
std::string get_valuedateset_hour();
std::string get_valuedateset_minute();
std::string get_valuedateset_second();
std::string get_valuedateset_day_name() const;
std::string get_valuedateset_day() const;
std::string get_valuedateset_month() const;
std::string get_valuedateset_year() const;
std::string get_valuedateset_hour() const;
std::string get_valuedateset_minute() const;
std::string get_valuedateset_second() const;

void show_value();
};

#endif
3 changes: 3 additions & 0 deletions srcs/includes/ValueMap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <string>
#include <map>
#include <iostream>

#include "BaseKeyValueMap.hpp"

Expand All @@ -25,6 +26,8 @@ class ValueMap: public BaseKeyValueMap

std::string get_only_value(void) const;
std::map<std::string, std::string> get_value_map(void) const;

void show_value();
};

#endif
3 changes: 3 additions & 0 deletions srcs/includes/ValueSet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <vector>
#include <string>
#include <iostream>

#include "BaseKeyValueMap.hpp"

Expand All @@ -19,6 +20,8 @@ class ValueSet: public BaseKeyValueMap
~ValueSet();

std::string get_value_set(void) const;

void show_value();
};

#endif
2 changes: 2 additions & 0 deletions srcs/includes/ValueWeightArraySet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class ValueWeightArraySet: public BaseKeyValueMap
~ValueWeightArraySet();

std::map<std::string, double> get_valueweight_set(void) const;

void show_value();
};

#endif

0 comments on commit 63d9aa8

Please sign in to comment.