mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
add remove_subfile(string)
This commit is contained in:
parent
3cc301259a
commit
ddaf3f172f
@ -328,6 +328,31 @@ get_encryption_iteration_count() const {
|
||||
return _encryption_iteration_count;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: Multifile::remove_subfile
|
||||
// Access: Published
|
||||
// Description: Removes the named subfile from the Multifile, if it
|
||||
// exists; returns true if successfully removed, or
|
||||
// false if it did not exist in the first place. The
|
||||
// file will not actually be removed from the disk until
|
||||
// the next call to flush().
|
||||
//
|
||||
// Note that this does not actually remove the data from
|
||||
// the indicated subfile; it simply removes it from the
|
||||
// index. The Multifile will not be reduced in size
|
||||
// after this operation, until the next call to
|
||||
// repack().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE bool Multifile::
|
||||
remove_subfile(const string &subfile_name) {
|
||||
int index = find_subfile(subfile_name);
|
||||
if (index >= 0) {
|
||||
remove_subfile(index);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: Multifile::read_subfile
|
||||
// Access: Published
|
||||
|
@ -90,6 +90,7 @@ PUBLISHED:
|
||||
bool scan_directory(vector_string &contents,
|
||||
const string &subfile_name) const;
|
||||
void remove_subfile(int index);
|
||||
INLINE bool remove_subfile(const string &subfile_name);
|
||||
const string &get_subfile_name(int index) const;
|
||||
MAKE_SEQ(get_subfile_names, get_num_subfiles, get_subfile_name);
|
||||
size_t get_subfile_length(int index) const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user