mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-09-19 19:19:05 +01:00
68290655b1
This change is fully backwards compatible with the old ContainerInfo parser, as it is just adding new fields. The old fields will continue to be used by legacy OICodeGen until that is removed. Also add a README to document the format.
35 lines
772 B
TOML
35 lines
772 B
TOML
[info]
|
|
type_name = "std::deque"
|
|
stub_template_params = [1]
|
|
ctype = "LIST_TYPE"
|
|
header = "deque"
|
|
|
|
# Old:
|
|
typeName = "std::deque<"
|
|
ns = ["namespace std"]
|
|
numTemplateParams = 1
|
|
replaceTemplateParamIndex = []
|
|
allocatorIndex = 1
|
|
|
|
[codegen]
|
|
decl = """
|
|
template<typename T, typename Allocator>
|
|
void getSizeType(const %1%<T, Allocator> &container, size_t& returnArg);
|
|
"""
|
|
|
|
func = """
|
|
template<typename T, typename Allocator>
|
|
void getSizeType(const %1%<T, Allocator> &container, size_t& returnArg)
|
|
{
|
|
SAVE_SIZE(sizeof(%1%<T>));
|
|
|
|
SAVE_DATA((uintptr_t)&container);
|
|
SAVE_DATA((uintptr_t)container.size());
|
|
|
|
// The double ampersand is needed otherwise this loop doesn't work with vector<bool>
|
|
for (auto&& it: container) {
|
|
getSizeType(it, returnArg);
|
|
}
|
|
}
|
|
"""
|