summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-03-23 17:30:19 (GMT)
committerBrad King <brad.king@kitware.com>2015-03-23 17:36:12 (GMT)
commit94256f359999905034ff0065b2a7627348c35220 (patch)
tree8bb0ca600ec32dd585bbff298ea5338ef0aef3a9
parentfe1bb977eef136daecec0d5717fbd7379f139e8a (diff)
downloadCastXML-94256f359999905034ff0065b2a7627348c35220.zip
CastXML-94256f359999905034ff0065b2a7627348c35220.tar.gz
CastXML-94256f359999905034ff0065b2a7627348c35220.tar.bz2
Output: Refactor PrintMembersAttribute steps as overloads
Separate collection of the members of a given context from printing of the attribute. This will allow the attribute to be printed with members collected by other means.
-rw-r--r--src/Output.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Output.cxx b/src/Output.cxx
index 973415b..0d4931b 100644
--- a/src/Output.cxx
+++ b/src/Output.cxx
@@ -252,6 +252,7 @@ class ASTVisitor: public ASTVisitorBase
members of the given declaration context. Also queues the
context members for later output. */
void PrintMembersAttribute(clang::DeclContext const* dc);
+ void PrintMembersAttribute(std::set<unsigned int> const& emitted);
/** Print a bases="..." attribute listing the XML IDREFs for
bases of the given class type. Also queues the base classes
@@ -979,9 +980,13 @@ void ASTVisitor::PrintContextAttribute(clang::Decl const* d)
void ASTVisitor::PrintMembersAttribute(clang::DeclContext const* dc)
{
std::set<unsigned int> emitted;
-
this->AddDeclContextMembers(dc, emitted);
+ this->PrintMembersAttribute(emitted);
+}
+//----------------------------------------------------------------------------
+void ASTVisitor::PrintMembersAttribute(std::set<unsigned int> const& emitted)
+{
if(!emitted.empty()) {
this->OS << " members=\"";
const char* sep = "";