MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / luaToString

Function luaToString

CodeFormatLib/src/CodeFormatLib.cpp:19–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17#endif
18
19std::string luaToString(lua_State *L, int idx) {
20 if (lua_isstring(L, idx)) {
21 return lua_tostring(L, idx);
22 } else if (lua_isinteger(L, idx)) {
23 return std::to_string(lua_tointeger(L, idx));
24 } else if (lua_isnumber(L, idx)) {
25 return std::to_string(lua_tonumber(L, idx));
26 } else if (lua_isboolean(L, idx)) {
27 return lua_toboolean(L, idx) ? "true" : "false";
28 } else {
29 return "nil";
30 }
31}
32
33std::string GetDiagnosisString(DiagnosticType type) {
34 switch (type) {

Callers 7

formatFunction · 0.85
range_formatFunction · 0.85
type_formatFunction · 0.85
set_default_configFunction · 0.85
spell_analysisFunction · 0.85
CreateFromLuaFunction · 0.85
update_name_style_configFunction · 0.85

Calls 4

lua_isstringFunction · 0.85
lua_isnumberFunction · 0.85
lua_tobooleanFunction · 0.85
lua_isintegerFunction · 0.70

Tested by

no test coverage detected