From 637fd157a03142438353346ec9b6da76b41870ff Mon Sep 17 00:00:00 2001 From: Pixel Date: Tue, 29 Nov 2011 19:18:42 -0800 Subject: Getting rid of the std::pair; they are ugly as hell. --- includes/HttpServer.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'includes/HttpServer.h') diff --git a/includes/HttpServer.h b/includes/HttpServer.h index 227faa4..6c97799 100644 --- a/includes/HttpServer.h +++ b/includes/HttpServer.h @@ -22,7 +22,9 @@ class HttpServer { public: Action(const Regex & regex, const Regex & host = Regexes::any) : m_regex(regex), m_host(host), m_refCount(0) { } ~Action() { Assert(m_refCount == 0); } - typedef std::pair ActionMatch; + struct ActionMatch { + Regex::Captures uri, host; + }; ActionMatch matches(const char * uri, const char * host); void unref() { if (Atomic::Decrement(&m_refCount) == 0) delete this; } void ref() { Atomic::Increment(&m_refCount); } @@ -41,7 +43,10 @@ class HttpServer { void setLocal(const char * local) { Assert(!m_started); m_local = local; } void registerAction(Action * action); void flushAllActions(); - typedef std::pair ActionFound; + struct ActionFound { + Action * action; + Action::ActionMatch matches; + }; ActionFound findAction(const char * uri, const char * host); private: bool m_started; -- cgit v1.2.3