Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of HTTPServer by
Diff: LPC1768/services/http/server/HTTPServer.h
- Revision:
- 2:356c7fa399ae
- Parent:
- 1:56636f5bf71a
- Child:
- 6:d753966e4d97
diff -r 56636f5bf71a -r 356c7fa399ae LPC1768/services/http/server/HTTPServer.h --- a/LPC1768/services/http/server/HTTPServer.h Mon Jun 14 10:22:58 2010 +0000 +++ b/LPC1768/services/http/server/HTTPServer.h Fri Jun 18 09:20:52 2010 +0000 @@ -42,6 +42,20 @@ public: HTTPServer(); ~HTTPServer(); + + struct handlersComp //Used to order handlers in the right way + { + bool operator() (const string& handler1, const string& handler2) const + { + //The first handler is longer than the second one + if (handler1.length() > handler2.length()) + return true; //Returns true if handler1 is to appear before handler2 + else if (handler1.length() < handler2.length()) + return false; + else //To avoid the == case, sort now by address + return ((&handler1)>(&handler2)); + } + }; template<typename T> void addHandler(const char* path) //Template decl in header @@ -55,7 +69,7 @@ void onTCPSocketEvent(TCPSocketEvent e); TCPSocket* m_pTCPSocket; - map< string, HTTPRequestHandler*(*)(const char*, const char*, TCPSocket*) > m_lpHandlers; + map< string, HTTPRequestHandler*(*)(const char*, const char*, TCPSocket*), handlersComp > m_lpHandlers; };