RTBKit
0.9
Open-source framework to create real-time ad bidding systems.
|
00001 /* url_js.h -*- C++ -*- 00002 JS encoding/decoding for URLs. 00003 */ 00004 00005 #pragma once 00006 00007 #include "soa/js/js_utils.h" 00008 #include "soa/types/url.h" 00009 00010 namespace Datacratic { 00011 00012 class Url; 00013 00014 namespace JS { 00015 00016 inline void to_js(JS::JSValue & value, const Url & url) 00017 { 00018 to_js(value, url.toString()); 00019 } 00020 00021 inline Url from_js(const JSValue & value, Url * = 0) 00022 { 00023 std::string s; 00024 s = from_js(value, (std::string *)0); 00025 return Url(s); 00026 } 00027 00028 inline Url from_js_ref(const JSValue & value, Url * = 0) 00029 { 00030 return from_js(value, (Url *)0); 00031 } 00032 00033 } // namespace JS 00034 } // namespace Datacratic