summaryrefslogtreecommitdiff
path: root/includes/SimpleMustache.h
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2013-01-22 08:29:55 -0800
committerPixel <pixel@nobis-crew.org>2013-01-22 08:29:55 -0800
commitf40de21e5666be6fa456fedc60584bd672d12c44 (patch)
treeb80497de619e661e246725b1cebcd68533d4e237 /includes/SimpleMustache.h
parent107d87dc983f34e4ff23a4db188baa650ac51f98 (diff)
Removing some more cruft.
Diffstat (limited to 'includes/SimpleMustache.h')
-rw-r--r--includes/SimpleMustache.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/includes/SimpleMustache.h b/includes/SimpleMustache.h
index 28cb477..b01955b 100644
--- a/includes/SimpleMustache.h
+++ b/includes/SimpleMustache.h
@@ -17,7 +17,7 @@ class SimpleMustache {
Context & operator[](const char * str);
private:
Proxy(Context * parent, ssize_t idx) : m_parent(parent), m_idx(idx) { }
- Context * m_parent;
+ Context * m_parent = NULL;
ssize_t m_idx;
friend class Context;
};
@@ -71,6 +71,9 @@ class SimpleMustache {
friend class Proxy;
friend class SimpleMustache;
+
+ Context(const Context &) = delete;
+ Context & operator=(const Context &) = delete;
};
void setTemplate(IO<Handle> h);
@@ -87,6 +90,7 @@ class SimpleMustache {
void render(IO<Handle> h, Context * ctx) const { AAssert(ctx, "Please pass on a context to render"); render_r(h, ctx, "", m_fragments.begin(), false, -1); }
void empty() { while (!m_fragments.empty()) { delete m_fragments.front(); m_fragments.pop_front(); } }
void checkTemplate() { Fragments::const_iterator end = checkTemplate_r(m_fragments.begin()); AAssert(end == m_fragments.end(), "The template wasn't fully checked; possibly mismatched sections"); }
+ SimpleMustache() { }
~SimpleMustache() { empty(); }
private:
struct Fragment {
@@ -108,6 +112,9 @@ class SimpleMustache {
static String escape(const String & s);
Fragments::const_iterator checkTemplate_r(Fragments::const_iterator begin, const String & endSection = "") const;
+
+ SimpleMustache(const SimpleMustache &) = delete;
+ SimpleMustache & operator=(const SimpleMustache &) = delete;
};
};