mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
add InternalName::join(sep)
This commit is contained in:
parent
94962c15d2
commit
67d12cdd4a
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user