Last change
on this file since 538 was
538,
checked in by epyon, 8 years ago
|
- ECS rollback of usage of index_table
- ECS prototype hashed_index_table
- lua iterator interface
- lua stack_proxy interface
- table_guard iteration
|
File size:
820 bytes
|
Line | |
---|
1 | // Copyright (C) 2017-2017 ChaosForge Ltd
|
---|
2 | // http://chaosforge.org/
|
---|
3 | //
|
---|
4 | // This file is part of Nova libraries.
|
---|
5 | // For conditions of distribution and use, see copying.txt file in root folder.
|
---|
6 |
|
---|
7 | #include "nv/lua/lua_proxy.hh"
|
---|
8 |
|
---|
9 | #include "nv/lua/lua_raw.hh"
|
---|
10 | #include "nv/lua/lua_state.hh"
|
---|
11 |
|
---|
12 | using namespace nv;
|
---|
13 | using namespace nv::lua;
|
---|
14 |
|
---|
15 | nv::string64 nv::lua::stack_proxy::get_string64() const
|
---|
16 | {
|
---|
17 | size_t l = 0;
|
---|
18 | const char* str = nullptr;
|
---|
19 | if ( lua_type( *m_state, m_index ) == LUA_TSTRING )
|
---|
20 | {
|
---|
21 | str = lua_tolstring( *m_state, m_index, &l );
|
---|
22 | }
|
---|
23 | return string64( str, static_cast<uint32>( l ) );
|
---|
24 | }
|
---|
25 |
|
---|
26 | nv::string64 nv::lua::stack_proxy::to_string64()
|
---|
27 | {
|
---|
28 | size_t l = 0;
|
---|
29 | const char* str = nullptr;
|
---|
30 | str = lua_tolstring( *m_state, m_index, &l );
|
---|
31 | return string64( str, static_cast<uint32>( l ) );
|
---|
32 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.