ls and reverseLs

This commit is contained in:
Dave Schuyler 2003-09-26 22:56:07 +00:00
parent 1f96f60e2b
commit 47fd8335df
3 changed files with 31 additions and 3 deletions

View File

@ -25,8 +25,7 @@
#pragma warning (disable : 4231)
#endif
#include <dtoolbase.h>
#include "dtoolbase.h"
#include "notifyCategoryProxy.h"
NotifyCategoryDecl(dconfig, EXPCL_DTOOLCONFIG, EXPTP_DTOOLCONFIG);

View File

@ -373,6 +373,33 @@ ls(ostream &out, int indent_level) const {
}
}
////////////////////////////////////////////////////////////////////
// Function: NodePath::reverse_ls
// Access: Published
// Description: Lists the hierarchy at and above the referenced node.
////////////////////////////////////////////////////////////////////
INLINE void NodePath::
reverse_ls() const {
reverse_ls(nout);
}
////////////////////////////////////////////////////////////////////
// Function: NodePath::reverse_ls
// Access: Published
// Description: Lists the hierarchy at and above the referenced node.
////////////////////////////////////////////////////////////////////
INLINE int NodePath::
reverse_ls(ostream &out, int indent_level) const {
if (is_empty()) {
out << "(empty)\n";
return 0;
} else if (has_parent()) {
indent_level = get_parent().reverse_ls(out, indent_level);
}
node()->write(out, indent_level);
return indent_level + 2;
}
////////////////////////////////////////////////////////////////////
// Function: NodePath::get_state
// Access: Published

View File

@ -216,6 +216,8 @@ PUBLISHED:
INLINE void ls() const;
INLINE void ls(ostream &out, int indent_level = 0) const;
INLINE void reverse_ls() const;
INLINE int reverse_ls(ostream &out, int indent_level = 0) const;
// Aggregate transform and state information.