@@ -64,11 +64,11 @@ namespace crow
64
64
}
65
65
66
66
private:
67
- std::string tag_name (const Action& action)
67
+ std::string tag_name (const Action& action) const
68
68
{
69
69
return body_.substr (action.start , action.end - action.start );
70
70
}
71
- auto find_context (const std::string& name, const std::vector<context*>& stack, bool shouldUseOnlyFirstStackValue = false ) -> std::pair<bool, context&>
71
+ auto find_context (const std::string& name, const std::vector<context*>& stack, bool shouldUseOnlyFirstStackValue = false ) const -> std::pair<bool, context&>
72
72
{
73
73
if (name == " ." )
74
74
{
@@ -133,7 +133,7 @@ namespace crow
133
133
return {false , empty_str};
134
134
}
135
135
136
- void escape (const std::string& in, std::string& out)
136
+ void escape (const std::string& in, std::string& out) const
137
137
{
138
138
out.reserve (out.size () + in.size ());
139
139
for (auto it = in.begin (); it != in.end (); ++it)
@@ -153,7 +153,7 @@ namespace crow
153
153
}
154
154
}
155
155
156
- bool isTagInsideObjectBlock (const int & current, const std::vector<context*>& stack)
156
+ bool isTagInsideObjectBlock (const int & current, const std::vector<context*>& stack) const
157
157
{
158
158
int openedBlock = 0 ;
159
159
int totalBlocksBefore = 0 ;
@@ -179,7 +179,7 @@ namespace crow
179
179
return false ;
180
180
}
181
181
182
- void render_internal (int actionBegin, int actionEnd, std::vector<context*>& stack, std::string& out, int indent)
182
+ void render_internal (int actionBegin, int actionEnd, std::vector<context*>& stack, std::string& out, int indent) const
183
183
{
184
184
int current = actionBegin;
185
185
@@ -323,7 +323,7 @@ namespace crow
323
323
auto & fragment = fragments_[actionEnd];
324
324
render_fragment (fragment, indent, out);
325
325
}
326
- void render_fragment (const std::pair<int , int > fragment, int indent, std::string& out)
326
+ void render_fragment (const std::pair<int , int > fragment, int indent, std::string& out) const
327
327
{
328
328
if (indent)
329
329
{
@@ -339,7 +339,7 @@ namespace crow
339
339
}
340
340
341
341
public:
342
- std::string render ()
342
+ std::string render () const
343
343
{
344
344
context empty_ctx;
345
345
std::vector<context*> stack;
@@ -349,7 +349,7 @@ namespace crow
349
349
render_internal (0 , fragments_.size () - 1 , stack, ret, 0 );
350
350
return ret;
351
351
}
352
- std::string render (context& ctx)
352
+ std::string render (context& ctx) const
353
353
{
354
354
std::vector<context*> stack;
355
355
stack.emplace_back (&ctx);
0 commit comments