diff --git a/panda/src/gobj/internalName.cxx b/panda/src/gobj/internalName.cxx index 703b12dc9e..8ee046338f 100644 --- a/panda/src/gobj/internalName.cxx +++ b/panda/src/gobj/internalName.cxx @@ -154,6 +154,25 @@ get_name() const { } } +//////////////////////////////////////////////////////////////////// +// Function: InternalName::join +// Access: Published +// Description: Like get_name, but uses a custom separator instead +// of ".". +//////////////////////////////////////////////////////////////////// +string InternalName:: +join(const string &sep) const { + if (_parent == get_root()) { + return _basename; + + } else if (_parent == (InternalName *)NULL) { + return string(); + + } else { + return _parent->join(sep) + sep + _basename; + } +} + //////////////////////////////////////////////////////////////////// // Function: InternalName::find_ancestor // Access: Published diff --git a/panda/src/gobj/internalName.h b/panda/src/gobj/internalName.h index 88ad2fdda4..7c3c42e259 100644 --- a/panda/src/gobj/internalName.h +++ b/panda/src/gobj/internalName.h @@ -53,6 +53,7 @@ PUBLISHED: INLINE InternalName *get_parent() const; string get_name() const; + string join(const string &sep) const; INLINE const string &get_basename() const; int find_ancestor(const string &basename) const;