stencet  v0.1.16
Build C++ web server modules that allow easy routing and deployment.
region.h
1 /* Copyright (C) 2012-2013 Justin Berger
2  The full license is available in the LICENSE file at the root of this project and is also available at http://opensource.org/licenses/MIT. */
3 
4 #pragma once
5 #include <iostream>
6 #include <stencet/viewModel.h>
7 #include <stencet/mscanf.h>
8 #include <vector>
9 #include <functional>
10 #include <string>
11 #include "expression.h"
12 
13 namespace stencet {
14  struct Region {
15  virtual void render(std::ostream& out, ViewContext& vm) const = 0;
16  virtual ~Region();
17  };
18 
19  struct VariableRegion : public Region {
20  Expr* expression = 0;
21  ~VariableRegion();
22 
23  VariableRegion(const std::string& name);
24  virtual void render(std::ostream& out, ViewContext& vm) const;
25  };
26 
27  struct LiteralRegion : public Region {
28  std::string data;
29  LiteralRegion(const std::string&);
30  LiteralRegion();
31  virtual void render(std::ostream& out, ViewContext& vm) const;
32  };
33 
34 }