VSM C++ SDK
Vehicle Specific Modules SDK
http_parser.h
1 // Copyright (c) 2014, Smart Projects Holdings Ltd
2 // All rights reserved.
3 // See LICENSE file for license details.
4 
10 #ifndef _PROPERTIES_H_
11 #define _PROPERTIES_H_
12 
13 #include <istream>
14 #include <map>
15 #include <string.h>
16 #include <ugcs/vsm/exception.h>
17 
18 namespace ugcs {
19 namespace vsm {
20 
30 public:
32  bool operator() (const std::string& lhs, const std::string& rhs) const {
33  return strcasecmp(lhs.c_str(), rhs.c_str()) < 0;
34  }
35  };
36 
40  bool
41  Parse(std::istream &in);
42 
44  bool
45  Header_exists(const std::string &name) const;
46 
51  std::string
52  Get_header_value(const std::string &name) const;
53 
56  std::string
57  Get_method() const;
58 
59  std::string parser_error;
60 
61 private:
62  std::map<std::string, std::string, string_compare_ignore_case> header_table;
63  std::string http_method;
64 };
65 
66 } /* namespace vsm */
67 } /* namespace ugcs */
68 
69 #endif /* _PROPERTIES_H_ */
UGCS root namespace.
Definition: android-linux/ugcs/vsm/platform_sockets.h:27
std::string Get_method() const
Get HTTP method name.
bool Parse(std::istream &in)
Parse http header from text stream.
bool Header_exists(const std::string &name) const
Check if the header field with the specified name exists.
VSM exceptions definition.
std::string Get_header_value(const std::string &name) const
Get string value of header.
This class implements limited HTTP parser according to RFC7230 Supports:
Definition: http_parser.h:29