From 980697406d0817d9c4e8f8a71807155f263a4b7f Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Mon, 1 Jul 2013 22:50:38 +0300 Subject: [PATCH] Fixed up indentation and bracing (to use a more consistent coding style). --- CefSharp/Request.cpp | 49 +++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/CefSharp/Request.cpp b/CefSharp/Request.cpp index 50cf9f61b..2de9c049f 100644 --- a/CefSharp/Request.cpp +++ b/CefSharp/Request.cpp @@ -11,7 +11,7 @@ namespace CefSharp void CefRequestWrapper::Url::set(String^ url) { - if(url == nullptr) + if (url == nullptr) { throw gcnew System::ArgumentException("cannot be null", "url"); } @@ -24,35 +24,38 @@ namespace CefSharp { return toClr(_wrappedRequest->GetMethod()); } - + String^ CefRequestWrapper::Body::get() { - CefPostData::ElementVector ev; - - CefRefPtr data = _wrappedRequest->GetPostData(); + CefPostData::ElementVector ev; - if(data.get() != nullptr) { - data.get()->GetElements(ev); + CefRefPtr data = _wrappedRequest->GetPostData(); - for (CefPostData::ElementVector::iterator it = ev.begin(); it != ev.end(); ++it) - { - CefPostDataElement *el = it->get(); - - if(el->GetType() == PDE_TYPE_BYTES) - { - size_t count = el->GetBytesCount(); - char* bytes = new char[count]; + if (data.get() != nullptr) + { + data.get()->GetElements(ev); - el->GetBytes(count, bytes); + for (CefPostData::ElementVector::iterator it = ev.begin(); it != ev.end(); ++it) + { + CefPostDataElement *el = it->get(); - return gcnew String(bytes, 0, count); - } else if(el->GetType() == PDE_TYPE_FILE) { - return toClr(el->GetFile()); - } - } - } + if (el->GetType() == PDE_TYPE_BYTES) + { + size_t count = el->GetBytesCount(); + char* bytes = new char[count]; - return nullptr; + el->GetBytes(count, bytes); + + return gcnew String(bytes, 0, count); + } + else if (el->GetType() == PDE_TYPE_FILE) + { + return toClr(el->GetFile()); + } + } + } + + return nullptr; } IDictionary^ CefRequestWrapper::GetHeaders()