MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / addStrings

Function addStrings

test/cffi/project/Project.cpp:171–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169
170
171HxString addStrings(HxString s0, HxString s1)
172{
173 if (hxs_encoding(s0)!=hx::StringUtf16 && hxs_encoding(s1)!=hx::StringUtf16)
174 {
175 std::string w0 = hxs_utf8(s0,0);
176 std::string w1 = hxs_utf8(s1,0);
177 std::string result = w0+w1;
178 return alloc_hxs_utf8( result.c_str(), result.size() );
179 }
180 std::wstring w0 = hxs_wchar(s0,0);
181 std::wstring w1 = hxs_wchar(s1,0);
182 std::wstring result = w0+w1;
183 return alloc_hxs_wchar( result.c_str(), result.size() );
184}
185DEFINE_PRIME2(addStrings);
186
187

Callers

nothing calls this directly

Calls 7

hxs_encodingFunction · 0.85
hxs_utf8Function · 0.85
alloc_hxs_utf8Function · 0.85
hxs_wcharFunction · 0.85
alloc_hxs_wcharFunction · 0.85
c_strMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected