includes : collect_typename |
Add in any includes from the typename passed.
Only other methods of this same object can call this method. This is called 'private' access.
The data-type returned is "booltype"; Returns true if successful.
This method is contained in the object "includes".
The method takes the following arguments:
filedef : Pointer to tgl_structure_parser
Not sure.
obj : Pointer to @schemaobj
Not sure.
tn : Read-only reference to @typename
The typename to add.
includes : stringsetptrtype
The include set to add to.
The namespaces "ph::tools::schema" and "ph::xmlobj" are used.
The files "../cppxmlobj/reflect/jscript_object_navigator.hpp", "schema/schema_typeimpl.hpp" and "tgl_tablecol.hpp" are included.
Collect includes for a particular typename.
if (tn.type() == "ptrtypename") { // TBD: deal with these correctly. They need to correctly look at the ptr type // to pull in the correct include. return true; } if (tn.type() == "enumtypename") { {Process enum} } else { {Find type implementation} } return true;
1 Process the include for an enumeration. We need to handle language specifics here rather than hard coding .hpp. This only applies to the C++ language.
{Process enum} ≡ if (_language == "C++") { std::string e = tn.get("enumeration"); xmlobj *f = obj->root()->find(e); if (!f) { filedef->error("Could not find enumeration object [" + e + "]."); return false; } includes->insert("\\"" + f->get("classname") + ".hpp\\""); }
2 Seatch back to find typeimpl which matches the name of this type, and for the language we are implementing.
{Find type implementation} ≡ schema_typeimpl *typeimpl = find_typeimpl(obj, tn.type(), _language); if (typeimpl) { std::string include = typeimpl->get("include"); if (include != "") includes->insert(include); } else { filedef->error("Could not find " + _language + " type implementation for '" + tn.type() + "'."); return false; }