From ee728e3dbc1fc66096f94825b9d6d9bbf6c0ce93 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Wed, 11 Sep 2013 18:12:11 -0700 Subject: [PATCH] Add UniformResourceLocator::empty --- modules/beast_asio/http/UniformResourceLocator.cpp | 5 +++++ modules/beast_asio/http/UniformResourceLocator.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/modules/beast_asio/http/UniformResourceLocator.cpp b/modules/beast_asio/http/UniformResourceLocator.cpp index 7324c0c29..d1e76d5b4 100644 --- a/modules/beast_asio/http/UniformResourceLocator.cpp +++ b/modules/beast_asio/http/UniformResourceLocator.cpp @@ -69,6 +69,11 @@ UniformResourceLocator& UniformResourceLocator::operator= (UniformResourceLocato //------------------------------------------------------------------------------ +bool UniformResourceLocator::empty () const +{ + return m_scheme == String::empty; +} + String UniformResourceLocator::scheme () const { return m_scheme; diff --git a/modules/beast_asio/http/UniformResourceLocator.h b/modules/beast_asio/http/UniformResourceLocator.h index 557cadfb8..54c2b3ebc 100644 --- a/modules/beast_asio/http/UniformResourceLocator.h +++ b/modules/beast_asio/http/UniformResourceLocator.h @@ -46,6 +46,9 @@ public: /** Copy assign a URL. */ UniformResourceLocator& operator= (UniformResourceLocator const& other); + /** Returns `true` if this is an empty URL. */ + bool empty () const; + /** Returns the scheme of the URL. If no scheme was specified, the string will be empty. */