Pass pugi xml_mode by value; refine coding style.
This commit is contained in:
@@ -2,10 +2,11 @@
|
||||
|
||||
#include <list>
|
||||
#include <iostream>
|
||||
#include "boost/lexical_cast.hpp"
|
||||
#include "json/json.h" // jsoncpp
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#include "boost/lexical_cast.hpp"
|
||||
#include "json/json.h"
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// In-memory test data.
|
||||
// There should be some database in a real product.
|
||||
@@ -97,7 +98,7 @@ private:
|
||||
|
||||
static BookStore g_book_store;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
static bool BookFromJson(const std::string& json, Book* book) {
|
||||
Json::Value root;
|
||||
@@ -142,7 +143,7 @@ bool BookListService::Post(const std::string& request_content,
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
bool BookDetailService::Get(const std::vector<std::string>& url_sub_matches,
|
||||
const webcc::UrlQuery& query,
|
||||
@@ -182,7 +183,8 @@ bool BookDetailService::Put(const std::vector<std::string>& url_sub_matches,
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BookDetailService::Delete(const std::vector<std::string>& url_sub_matches) {
|
||||
bool BookDetailService::Delete(
|
||||
const std::vector<std::string>& url_sub_matches) {
|
||||
if (url_sub_matches.size() != 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "webcc/rest_service.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// BookListService handles the HTTP GET and returns the book list based on
|
||||
// query parameters specified in the URL.
|
||||
@@ -25,7 +25,7 @@ class BookListService : public webcc::RestListService {
|
||||
std::string* response_content) final;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// The URL is like '/books/{BookID}', and the 'url_sub_matches' parameter
|
||||
// contains the matched book ID.
|
||||
|
||||
Reference in New Issue
Block a user