client lib include must not depend on _common.hxx
[libt2n] / example-codegen / default.cpp
CommitLineData
85106017 1#include "default.hxx"
1e683bb5 2#include "default_common.hxx"
a96ab628
JT
3
4//! test pass by copy
5LIBT2N_EXPORT std::string testfunc(std::string str)
6{
7 std::string ret;
8 if (str=="throw")
9 throw libt2n::t2n_runtime_error("throw me around");
10 if (str=="big")
11 ret.insert(0,100*1024,'x');
12 else
13 ret=str+", testfunc() was here";
14 return ret;
15}
16
17//! test pass by const reference
18LIBT2N_EXPORT std::string testfunc_ref(const std::string &str)
19{
20 std::string ret;
21 if (str=="throw")
22 throw libt2n::t2n_runtime_error("throw me around");
23 if (str=="big")
24 ret.insert(0,100*1024,'x');
25 else
26 ret=str+", testfunc() was here";
27 return ret;
28}
29
30//! test builtin type
31LIBT2N_EXPORT int t2(int i)
32{
33 return i;
34}