diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/HttpServer.cc | 2 | ||||
-rw-r--r-- | src/SimpleMustache.cc | 12 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/HttpServer.cc b/src/HttpServer.cc index 2e3f703..69d58cd 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -35,6 +35,8 @@ class HttpWorker : public Task { HttpWorker(IO<Handle> io, void * server); ~HttpWorker(); static void buildErrorTemplate(IO<Handle> h) { m_errorTemplate.setTemplate(h); } + template<size_t S> + static void buildErrorTemplate(const char str[S]) { m_errorTemplate.setTemplate(str, S); } static void buildErrorTemplate(const char * str, ssize_t s) { m_errorTemplate.setTemplate(str, s); } static void buildErrorTemplate(const String & str) { m_errorTemplate.setTemplate(str); } private: diff --git a/src/SimpleMustache.cc b/src/SimpleMustache.cc index 92fefeb..d2db99f 100644 --- a/src/SimpleMustache.cc +++ b/src/SimpleMustache.cc @@ -328,9 +328,9 @@ void Balau::SimpleMustache::setTemplate(IO<Handle> _h) { m_fragments.push_back(curFragment); } -Balau::SimpleMustache::Fragments::iterator Balau::SimpleMustache::checkTemplate_r(Fragments::iterator begin, const String & endSection) { - Fragments::iterator cur; - Fragments::iterator end = m_fragments.end(); +Balau::SimpleMustache::Fragments::const_iterator Balau::SimpleMustache::checkTemplate_r(Fragments::const_iterator begin, const String & endSection) const { + Fragments::const_iterator cur; + Fragments::const_iterator end = m_fragments.end(); for (cur = begin; cur != end; cur++) { Fragment * fr = *cur; @@ -346,9 +346,9 @@ Balau::SimpleMustache::Fragments::iterator Balau::SimpleMustache::checkTemplate_ return end; } -Balau::SimpleMustache::Fragments::iterator Balau::SimpleMustache::render_r(IO<Handle> h, Context * ctx, const String & endSection, Fragments::iterator begin, bool noWrite, int forceIdx) { - Fragments::iterator cur; - Fragments::iterator end = m_fragments.end(); +Balau::SimpleMustache::Fragments::const_iterator Balau::SimpleMustache::render_r(IO<Handle> h, Context * ctx, const String & endSection, Fragments::const_iterator begin, bool noWrite, int forceIdx) const { + Fragments::const_iterator cur; + Fragments::const_iterator end = m_fragments.end(); if (endSection.strlen() != 0) { int depth = 0; |