diff --git a/src/kamokan_impl/CMakeLists.txt b/src/kamokan_impl/CMakeLists.txt index a1f4a8e..27ca084 100644 --- a/src/kamokan_impl/CMakeLists.txt +++ b/src/kamokan_impl/CMakeLists.txt @@ -21,7 +21,7 @@ add_library(${PROJECT_NAME} STATIC storage.cpp string_conv.cpp edit_response.cpp - pastie_retrieving_response.cpp + general_pastie_response.cpp ) target_include_directories(${PROJECT_NAME} diff --git a/src/kamokan_impl/edit_response.cpp b/src/kamokan_impl/edit_response.cpp index f221fa8..af92119 100644 --- a/src/kamokan_impl/edit_response.cpp +++ b/src/kamokan_impl/edit_response.cpp @@ -24,11 +24,11 @@ namespace kamokan { std::ostream* parStreamOut, const Kakoune::SafePtr& parCgiEnv ) : - PastieRetrievingResponse(parSettings, parStreamOut, parCgiEnv) + GeneralPastieResponse(parSettings, parStreamOut, parCgiEnv) { } - tawashi::HttpHeader EditResponse::on_retrieving_process() { + tawashi::HttpHeader EditResponse::on_general_pastie_process() { return tawashi::make_header_type_html(); } diff --git a/src/kamokan_impl/edit_response.hpp b/src/kamokan_impl/edit_response.hpp index 094c425..ebd98ec 100644 --- a/src/kamokan_impl/edit_response.hpp +++ b/src/kamokan_impl/edit_response.hpp @@ -17,10 +17,10 @@ #pragma once -#include "pastie_retrieving_response.hpp" +#include "general_pastie_response.hpp" namespace kamokan { - class EditResponse : public PastieRetrievingResponse { + class EditResponse : public GeneralPastieResponse { public: EditResponse ( const Kakoune::SafePtr& parSettings, @@ -35,6 +35,6 @@ namespace kamokan { private: virtual std::string on_pastie_prepare (std::string&& parPastie) override; - virtual tawashi::HttpHeader on_retrieving_process() override; + virtual tawashi::HttpHeader on_general_pastie_process() override; }; } //namespace kamokan diff --git a/src/kamokan_impl/pastie_retrieving_response.cpp b/src/kamokan_impl/general_pastie_response.cpp similarity index 89% rename from src/kamokan_impl/pastie_retrieving_response.cpp rename to src/kamokan_impl/general_pastie_response.cpp index 0a0bdf4..4cb34a7 100644 --- a/src/kamokan_impl/pastie_retrieving_response.cpp +++ b/src/kamokan_impl/general_pastie_response.cpp @@ -15,7 +15,7 @@ * along with "kamokan". If not, see . */ -#include "pastie_retrieving_response.hpp" +#include "general_pastie_response.hpp" #include "cgi_env.hpp" #include "settings_bag.hpp" #include "error_reasons.hpp" @@ -57,7 +57,7 @@ namespace kamokan { } } //unnamed namespace - PastieRetrievingResponse::PastieRetrievingResponse ( + GeneralPastieResponse::GeneralPastieResponse ( const Kakoune::SafePtr& parSettings, std::ostream* parStreamOut, const Kakoune::SafePtr& parCgiEnv @@ -66,7 +66,7 @@ namespace kamokan { { } - tawashi::HttpHeader PastieRetrievingResponse::on_process() { + tawashi::HttpHeader GeneralPastieResponse::on_process() { using tawashi::ErrorReasons; boost::string_view token = get_search_token(cgi_env()); @@ -84,10 +84,10 @@ namespace kamokan { assert(not token_invalid()); assert(not pastie_not_found()); - return this->on_retrieving_process(); + return this->on_general_pastie_process(); } - void PastieRetrievingResponse::on_mustache_prepare (mstch::map& parContext) { + void GeneralPastieResponse::on_mustache_prepare (mstch::map& parContext) { assert(m_pastie_info.pastie); assert(not token_invalid()); assert(not pastie_not_found()); @@ -102,12 +102,12 @@ namespace kamokan { parContext["pastie_page"] = true; } - bool PastieRetrievingResponse::token_invalid() const { + bool GeneralPastieResponse::token_invalid() const { assert(m_pastie_info.valid_token or not m_pastie_info.pastie); return not m_pastie_info.valid_token; } - bool PastieRetrievingResponse::pastie_not_found() const { + bool GeneralPastieResponse::pastie_not_found() const { return not m_pastie_info.pastie; } } //namespace kamokan diff --git a/src/kamokan_impl/pastie_retrieving_response.hpp b/src/kamokan_impl/general_pastie_response.hpp similarity index 90% rename from src/kamokan_impl/pastie_retrieving_response.hpp rename to src/kamokan_impl/general_pastie_response.hpp index ff4e876..d4f99cd 100644 --- a/src/kamokan_impl/pastie_retrieving_response.hpp +++ b/src/kamokan_impl/general_pastie_response.hpp @@ -21,9 +21,9 @@ #include namespace kamokan { - class PastieRetrievingResponse : public Response { + class GeneralPastieResponse : public Response { public: - PastieRetrievingResponse ( + GeneralPastieResponse ( const Kakoune::SafePtr& parSettings, std::ostream* parStreamOut, const Kakoune::SafePtr& parCgiEnv @@ -37,7 +37,7 @@ namespace kamokan { virtual tawashi::HttpHeader on_process() override final; virtual void on_mustache_prepare (mstch::map& parContext) override final; virtual std::string on_pastie_prepare (std::string&& parPastie) = 0; - virtual tawashi::HttpHeader on_retrieving_process() = 0; + virtual tawashi::HttpHeader on_general_pastie_process() = 0; Storage::RetrievedPastie m_pastie_info; }; diff --git a/src/kamokan_impl/pastie_response.cpp b/src/kamokan_impl/pastie_response.cpp index f7dadc9..a320da5 100644 --- a/src/kamokan_impl/pastie_response.cpp +++ b/src/kamokan_impl/pastie_response.cpp @@ -43,14 +43,14 @@ namespace kamokan { std::ostream* parStreamOut, const Kakoune::SafePtr& parCgiEnv ) : - PastieRetrievingResponse(parSettings, parStreamOut, parCgiEnv), + GeneralPastieResponse(parSettings, parStreamOut, parCgiEnv), m_langmap_dir(parSettings->as("langmap_dir")), m_plain_text(false), m_syntax_highlight(true) { } - tawashi::HttpHeader PastieResponse::on_retrieving_process() { + tawashi::HttpHeader PastieResponse::on_general_pastie_process() { auto get = cgi_env().query_string_split(); const std::string& query_str(cgi_env().query_string()); if (get["m"] == "plain" or query_str.empty()) { diff --git a/src/kamokan_impl/pastie_response.hpp b/src/kamokan_impl/pastie_response.hpp index 7773fa4..03e5a86 100644 --- a/src/kamokan_impl/pastie_response.hpp +++ b/src/kamokan_impl/pastie_response.hpp @@ -17,12 +17,12 @@ #pragma once -#include "pastie_retrieving_response.hpp" +#include "general_pastie_response.hpp" #include #include namespace kamokan { - class PastieResponse final : public PastieRetrievingResponse { + class PastieResponse final : public GeneralPastieResponse { public: PastieResponse ( const Kakoune::SafePtr& parSettings, @@ -36,7 +36,7 @@ namespace kamokan { private: virtual std::string on_mustache_retrieve() override; virtual std::string on_pastie_prepare (std::string&& parPastie) override; - virtual tawashi::HttpHeader on_retrieving_process() override; + virtual tawashi::HttpHeader on_general_pastie_process() override; std::string m_lang_file; std::string m_langmap_dir;