X Tutup
Skip to content

Commit e40eccf

Browse files
author
Sebastiano Merlino
committed
Moved http_endpoint to subdir details
Aligned with its namespace
1 parent 376f138 commit e40eccf

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

src/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ METASOURCES = AUTO
2121
lib_LTLIBRARIES = libhttpserver.la
2222
libhttpserver_la_SOURCES = string_utilities.cpp webserver.cpp http_utils.cpp http_endpoint.cpp http_request.cpp http_response.cpp http_resource.cpp
2323
noinst_HEADERS = httpserver/string_utilities.hpp gettext.h
24-
nobase_include_HEADERS = httpserver.hpp httpserver/create_webserver.hpp httpserver/webserver.hpp httpserver/http_utils.hpp httpserver/http_endpoint.hpp httpserver/http_request.hpp httpserver/http_response.hpp httpserver/http_resource.hpp httpserver/binders.hpp httpserver/event_supplier.hpp httpserver/details/event_tuple.hpp httpserver/details/http_resource_mirror.hpp
24+
nobase_include_HEADERS = httpserver.hpp httpserver/create_webserver.hpp httpserver/webserver.hpp httpserver/http_utils.hpp httpserver/details/http_endpoint.hpp httpserver/http_request.hpp httpserver/http_response.hpp httpserver/http_resource.hpp httpserver/binders.hpp httpserver/event_supplier.hpp httpserver/details/event_tuple.hpp httpserver/details/http_resource_mirror.hpp
2525
AM_CXXFLAGS += -fPIC -Wall
2626
libhttpserver_la_LIBADD = -lmicrohttpd
2727
libhttpserver_la_LDFLAGS =

src/http_endpoint.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
1515
You should have received a copy of the GNU Lesser General Public
1616
License along with this library; if not, write to the Free Software
17-
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
17+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
1818
USA
1919
*/
2020

21-
#include "http_endpoint.hpp"
21+
#include "details/http_endpoint.hpp"
2222
#include "http_utils.hpp"
2323
#include "string_utilities.hpp"
2424

@@ -67,7 +67,7 @@ http_endpoint::http_endpoint
6767
{
6868
for(unsigned int i = 0; i< parts.size(); i++)
6969
{
70-
if((parts[i] != "") && (parts[i][0] != '{'))
70+
if((parts[i] != "") && (parts[i][0] != '{'))
7171
{
7272
if(first)
7373
{
@@ -85,14 +85,14 @@ http_endpoint::http_endpoint
8585
{
8686
this->url_modded += "/" + parts[i];
8787
}
88-
}
89-
else
88+
}
89+
else
9090
{
9191
if(
92-
(parts[i].size() >= 3) &&
93-
(parts[i][0] == '{') &&
94-
(parts[i][parts[i].size() - 1] == '}')
95-
)
92+
(parts[i].size() >= 3) &&
93+
(parts[i][0] == '{') &&
94+
(parts[i][parts[i].size() - 1] == '}')
95+
)
9696
{
9797
int bar = parts[i].find_first_of('|');
9898
if(bar != (int)string::npos)
@@ -128,8 +128,8 @@ http_endpoint::http_endpoint
128128
}
129129
}
130130
this->chunk_positions.push_back(i);
131-
}
132-
else
131+
}
132+
else
133133
{
134134
throw bad_http_endpoint();
135135
}
@@ -156,7 +156,7 @@ http_endpoint::http_endpoint
156156
if(use_regex)
157157
{
158158
this->url_modded += "$";
159-
regcomp(&(this->re_url_modded), url_modded.c_str(),
159+
regcomp(&(this->re_url_modded), url_modded.c_str(),
160160
REG_EXTENDED|REG_ICASE|REG_NOSUB
161161
);
162162
reg_compiled = true;
@@ -173,7 +173,7 @@ http_endpoint::http_endpoint(const http_endpoint& h):
173173
reg_compiled(h.reg_compiled)
174174
{
175175
if(this->reg_compiled)
176-
regcomp(&(this->re_url_modded), url_modded.c_str(),
176+
regcomp(&(this->re_url_modded), url_modded.c_str(),
177177
REG_EXTENDED|REG_ICASE|REG_NOSUB
178178
);
179179
}
@@ -185,7 +185,7 @@ http_endpoint& http_endpoint::operator =(const http_endpoint& h)
185185
this->family_url = h.family_url;
186186
this->reg_compiled = h.reg_compiled;
187187
if(this->reg_compiled)
188-
regcomp(&(this->re_url_modded), url_modded.c_str(),
188+
regcomp(&(this->re_url_modded), url_modded.c_str(),
189189
REG_EXTENDED|REG_ICASE|REG_NOSUB
190190
);
191191
this->url_pars = h.url_pars;
@@ -194,12 +194,12 @@ http_endpoint& http_endpoint::operator =(const http_endpoint& h)
194194
return *this;
195195
}
196196

197-
bool http_endpoint::operator <(const http_endpoint& b) const
197+
bool http_endpoint::operator <(const http_endpoint& b) const
198198
{
199199
COMPARATOR(this->url_modded, b.url_modded, toupper);
200200
}
201201

202-
bool http_endpoint::match(const http_endpoint& url) const
202+
bool http_endpoint::match(const http_endpoint& url) const
203203
{
204204
if(this->family_url && (url.url_pieces.size() >= this->url_pieces.size()))
205205
{
@@ -220,7 +220,7 @@ bool http_endpoint::match(const http_endpoint& url) const
220220
return regexec(&(this->re_url_modded), nn.c_str(), 0, NULL, 0) == 0;
221221
}
222222
else
223-
return regexec(&(this->re_url_modded),
223+
return regexec(&(this->re_url_modded),
224224
url.url_modded.c_str(), 0, NULL, 0) == 0;
225225
}
226226

src/httpserver.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#define _HTTPSERVER_HPP_INSIDE_
55

66
#include "httpserver/http_utils.hpp"
7-
#include "httpserver/http_endpoint.hpp"
7+
#include "httpserver/details/http_endpoint.hpp"
88
#include "httpserver/http_resource.hpp"
99
#include "httpserver/http_response.hpp"
1010
#include "httpserver/http_request.hpp"

src/webserver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#include "http_resource.hpp"
4040
#include "http_response.hpp"
4141
#include "http_request.hpp"
42-
#include "http_endpoint.hpp"
42+
#include "details/http_endpoint.hpp"
4343
#include "string_utilities.hpp"
4444
#include "details/http_resource_mirror.hpp"
4545
#include "details/event_tuple.hpp"

0 commit comments

Comments
 (0)
X Tutup