SaltAPI  1.1
An API for the HTTPd / Zia by Salty Studio.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Header.cpp
Go to the documentation of this file.
1 //
2 // Created by wery_a on 09/01/17.
3 //
4 
5 #include "HTTP/Header.hpp"
6 
7 namespace HTTP {
9 
10  }
11 
13 
14  }
15 
16  std::string const &Header::Get(std::string const &key) const {
17  std::map<std::string, std::string>::const_iterator it = m_headers.find(key);
18  return it->second;
19  }
20 
21  void Header::Set(std::string const &key, std::string const &value) {
22  if (m_headers.find(key) == m_headers.end()) {
23  // TODO warning key doesn't exist
24  }
25  m_headers[key] = value;
26  }
27 
28  void Header::Add(std::string const &key, std::string const &value) {
29  if (m_headers.find(key) != m_headers.end()) {
30  // TODO warning already exist
31  }
32  m_headers[key] = value;
33  }
34 
35  void Header::Del(std::string const &key) {
36  if (m_headers.find(key) == m_headers.end()) {
37  // TODO warning key doesn't exist
38  }
39  m_headers.erase(key);
40  }
41 }
std::string const & Get(std::string const &key) const
Definition: Header.cpp:16
void Set(std::string const &key, std::string const &value)
Definition: Header.cpp:21
virtual ~Header()
Definition: Header.cpp:12
void Add(std::string const &key, std::string const &value)
Definition: Header.cpp:28
void Del(std::string const &key)
Definition: Header.cpp:35