Added a convenience function to make an internal name with an integer suffix

This commit is contained in:
Josh Yelon 2008-01-25 03:29:18 +00:00
parent 7625c2cfa2
commit baa7dfcb33
2 changed files with 14 additions and 0 deletions

View File

@ -301,6 +301,19 @@ finalize(BamReader *) {
nassertv(get_ref_count() != 0);
}
////////////////////////////////////////////////////////////////////
// Function: InternalName::make
// Access: Published, Static
// Description: Make using a string and an integer. Concatenates
// the two.
////////////////////////////////////////////////////////////////////
PT(InternalName) InternalName::
make(const string &name, int index) {
std::ostringstream full;
full << name << index;
return make(full.str());
}
////////////////////////////////////////////////////////////////////
// Function: InternalName::make_from_bam
// Access: Protected, Static

View File

@ -52,6 +52,7 @@ PUBLISHED:
bool unref() const;
INLINE static PT(InternalName) make(const string &name);
INLINE static PT(InternalName) make(const string &name, int index);
PT(InternalName) append(const string &basename);
INLINE InternalName *get_parent() const;