Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
vczh committed Jul 27, 2020
1 parent 43a47d1 commit 692aeca
Show file tree
Hide file tree
Showing 6 changed files with 640 additions and 601 deletions.
1 change: 0 additions & 1 deletion Cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
- [ ] Fix signature for Curry.
- [ ] Refine document comment
- [ ] Generate `C++ name -> <symbols>` file, so that `<article>` could have hyper-links to document pages
- [ ] Automatically generate `registered types` list
- [ ] VlppParser
- [ ] Fix document for `ParsingTable`
- [ ] Add `header:` in codegen so that generated files have license comment
Expand Down
3 changes: 3 additions & 0 deletions Tools/CppDoc/DocIndex/Main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <Render.h>
#include <ExportReflectableTypes.h>

/***********************************************************************
Main
Expand Down Expand Up @@ -69,6 +70,8 @@ int main()
folderFragment,
folderReference
);

ExportReflectableTypes(folderOutput);
}

return 0;
Expand Down
42 changes: 40 additions & 2 deletions Tools/CppDoc/Reflection/Source/ExportReflectableTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,56 @@ void LogTypes(Ptr<XmlElement> xmlRoot, const WString& projectName, SortedList<WS
{
auto td = GetGlobalTypeManager()->GetTypeDescriptor(i);
WString tdName = td->GetTypeName();
WString cppName = CppGetFullName(td);

if (loaded.Contains(tdName)) continue;
loaded.Add(tdName);

auto xmlType = MakePtr<XmlElement>();
xmlType->name.value = L"type";
xmlProject->subNodes.Add(xmlType);

switch (td->GetTypeDescriptorFlags())
{
case TypeDescriptorFlags::Object:
xmlType->name.value = L"Object";
break;
case TypeDescriptorFlags::IDescriptable:
xmlType->name.value = L"IDescriptable";
break;
case TypeDescriptorFlags::Class:
xmlType->name.value = L"Class";
break;
case TypeDescriptorFlags::Interface:
xmlType->name.value = L"Interface";
break;
case TypeDescriptorFlags::Primitive:
xmlType->name.value = L"Primitive";
break;
case TypeDescriptorFlags::Struct:
xmlType->name.value = L"Struct";
break;
case TypeDescriptorFlags::FlagEnum:
xmlType->name.value = L"FlagEnum";
break;
case TypeDescriptorFlags::NormalEnum:
xmlType->name.value = L"NormalEnum";
break;
default:
xmlType->name.value = L"Undefined";
}

{
auto attr = MakePtr<XmlAttribute>();
attr->name.value = L"registered";
attr->name.value = L"name";
attr->value.value = tdName;
xmlType->attributes.Add(attr);
}
{
auto attr = MakePtr<XmlAttribute>();
attr->name.value = L"cpp";
attr->value.value = cppName;
xmlType->attributes.Add(attr);
}
}
}

Expand Down
2 changes: 0 additions & 2 deletions Tools/CppDoc/UnitTest_ExecuteCases/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ int main()
preprocessedFiles.Add(File(L"../UnitTest_Cases/TypePrinter.i"));
preprocessedFiles.Add(File(L"../UnitTest_Cases/STL.i"));

#if 0
Console::WriteLine(L"Cleaning ...");
FOREACH(File, file, preprocessedFiles)
{
Expand Down Expand Up @@ -81,7 +80,6 @@ int main()
folderReference
);
}
#endif

{
Folder folderOutput(L"../../Demos/_Test");
Expand Down
1 change: 1 addition & 0 deletions Tools/Demos/Gaclib/Reflection.xml

Large diffs are not rendered by default.

Loading

0 comments on commit 692aeca

Please sign in to comment.