// file : brep/view.cxx -*- C++ -*- // copyright : Copyright (c) 2014-2015 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file #include #include // shared_ptr, make_shared() #include #include using namespace std; namespace brep { void view:: init (cli::scanner& s) { options_ = make_shared (s, cli::unknown_mode::fail, cli::unknown_mode::fail); } void view:: handle (request& rq, response& rs) { ostream& o (rs.content (200, "text/html;charset=utf-8", false)); o << ""; o << "Options:" << "
\ntracing verbosity: " << options_->verb () << "
\ndb endpoint: " << options_->db_host () << ":" << options_->db_port (); o << "

\nCookies:"; for (const auto& c: rq.cookies ()) { o << "
\n" << c.name << "=" << c.value; } o << "

Search" << ""; } }