tobitstring(int value) Converts byte to binary string
| 1838 | // |
| 1839 | // Converts byte to binary string |
| 1840 | static int tobitstring(lua_State *L) |
| 1841 | { |
| 1842 | std::bitset<8> bits (luaL_checkinteger(L, 1)); |
| 1843 | std::string temp = bits.to_string().insert(4, " "); |
| 1844 | const char * result = temp.c_str(); |
| 1845 | lua_pushstring(L,result); |
| 1846 | return 1; |
| 1847 | } |
| 1848 | |
| 1849 | // like rawToCString, but will check if the global Lua function tostring() |
| 1850 | // has been replaced with a custom function, and call that instead if so |
nothing calls this directly
no test coverage detected