FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
synth/examples/simple_ssi.cpp at master · ajg/synth · GitHub
ajg
/
synth
Public
Notifications
You must be signed in to change notification settings
Fork
45
Star
68
Code
Issues
2
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
synth
/
examples
/
simple_ssi.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
27 lines (22 loc) · 782 Bytes
Breadcrumbs
synth
/
examples
/
simple_ssi.cpp
Copy path
File metadata and controls
27 lines (22 loc) · 782 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#
include
<
map
>
#
include
<
string
>
#
include
<
iostream
>
#
include
<
ajg/synth.hpp
>
typedef
ajg::synth::default_traits<
char
> traits_type;
typedef
ajg::synth::engines::ssi::engine<traits_type> engine_type;
typedef
ajg::synth::templates::string_template<engine_type> template_type;
int
main
() {
//
Parse the template.
template_type
const
t
(
"
Howdy, <!--#echo var='user' -->!
"
"
Your balance is <!--#echo var='points' -->.
"
);
//
Create some data.
std::map<std::string, engine_type::value_type> m;
m[
"
user
"
] =
"
Dolph Lundgren
"
;
m[
"
points
"
] =
42
;
//
Render to different destinations:
t.
render_to_stream
(std::cout, m);
t.
render_to_path
(
"
greeting.txt
"
, m);
std::cout << t.
render_to_string
(m);
return
0
;
}
Back
|
FazBrowse Home
|
New Git URL