#include <filename_list.h>
Inheritance diagram for filename_list:


Public Member Functions | |
| filename_list () | |
| filename_list & | operator= (const filename_list &to_copy) |
| int | total_files () const |
| double | total_size () const |
| bool | calculate_progress (const filename &file, double current_offset, int ¤t_file, double ¤t_size) |
| filename_list & | operator= (const string_array &to_copy) |
| void | fill (string_array &to_fill) |
| const file_info * | find (const filename &to_check) const |
| int | locate (const filename &to_find) const |
| finds the index of the record for "to_find" or returns a negative number. | |
| bool | member (const filename &to_check) const |
| bool | member (const file_info &to_check, bool check_size=true, bool check_checksum=true) const |
| istring | text_form () const |
| virtual void | pack (byte_array &packed_form) const |
| Creates a packed form of the packable object in "packed_form". | |
| virtual bool | unpack (byte_array &packed_form) |
| Restores the packable from the "packed_form". | |
This is based on an amorph so that adding to the list is efficient. The underlying type held is actually a file_info rather than a filename. This should not impose much extra overhead.
Note: this is a heavyweight header; it shouldn't be used in other headers.
Definition at line 32 of file filename_list.h.
| filename_list::filename_list | ( | ) |
Definition at line 24 of file filename_list.cpp.
| filename_list & filename_list::operator= | ( | const filename_list & | to_copy | ) |
Definition at line 26 of file filename_list.cpp.
References amorph< file_info >::append(), amorph< contents >::elements(), amorph< contents >::get(), and amorph< file_info >::reset().
| int filename_list::total_files | ( | ) | const |
| double filename_list::total_size | ( | ) | const |
Definition at line 44 of file filename_list.cpp.
References file_info::_file_size, amorph< file_info >::elements(), and amorph< file_info >::get().
| bool filename_list::calculate_progress | ( | const filename & | file, | |
| double | current_offset, | |||
| int & | current_file, | |||
| double & | current_size | |||
| ) |
Definition at line 52 of file filename_list.cpp.
References amorph< file_info >::get(), locate(), negative(), filename::raw(), and istring::t().
| filename_list & filename_list::operator= | ( | const string_array & | to_copy | ) |
Definition at line 74 of file filename_list.cpp.
References amorph< file_info >::append(), array< contents >::length(), and amorph< file_info >::reset().
| void filename_list::fill | ( | string_array & | to_fill | ) |
Definition at line 83 of file filename_list.cpp.
References amorph< file_info >::elements(), amorph< file_info >::get(), filename::raw(), and array< contents >::reset().
Referenced by directory_tree::current().
Definition at line 91 of file filename_list.cpp.
References amorph< file_info >::elements(), amorph< file_info >::get(), istring::iequals(), NIL, and filename::raw().
Referenced by directory_tree::add_path(), and heavy_file_operations::buffer_files().
| int filename_list::locate | ( | const filename & | to_find | ) | const |
finds the index of the record for "to_find" or returns a negative number.
Definition at line 103 of file filename_list.cpp.
References amorph< file_info >::elements(), amorph< file_info >::get(), istring::iequals(), common::NOT_FOUND, and filename::raw().
Referenced by advance(), calculate_progress(), and directory_tree::remove_path().
| bool filename_list::member | ( | const filename & | to_check | ) | const |
Definition at line 115 of file filename_list.cpp.
References amorph< file_info >::elements(), amorph< file_info >::get(), istring::iequals(), and filename::raw().
Referenced by directory_tree::compare_trees(), and directory_tree::remove_path().
| bool filename_list::member | ( | const file_info & | to_check, | |
| bool | check_size = true, |
|||
| bool | check_checksum = true | |||
| ) | const |
Definition at line 127 of file filename_list.cpp.
References file_info::_checksum, file_info::_file_size, amorph< file_info >::elements(), amorph< file_info >::get(), istring::iequals(), and filename::raw().
| istring filename_list::text_form | ( | ) | const |
Definition at line 149 of file filename_list.cpp.
References amorph< file_info >::elements(), amorph< file_info >::get(), log_base::platform_ending(), and file_info::text_form().
| void filename_list::pack | ( | byte_array & | packed_form | ) | const [virtual] |
Creates a packed form of the packable object in "packed_form".
This must append to the data in "packed_form" rather than clearing prior contents.
Implements packable.
Definition at line 38 of file filename_list.cpp.
References amorph_pack().
Referenced by filename_tree::pack().
| bool filename_list::unpack | ( | byte_array & | packed_form | ) | [virtual] |
Restores the packable from the "packed_form".
This object becomes the unpacked form, and therefore must lose any of its prior contents that depend on the data in "packed_form". This is up to the derived unpack function to figure out. The "packed_form" is modified by extracting all of the pieces that are used for this object; the remainder stays in "packed_form". true is returned if the unpacking was successful.
Implements packable.
Definition at line 41 of file filename_list.cpp.
References amorph_unpack().
Referenced by recursive_file_copy::copy_hierarchy(), and filename_tree::unpack().
1.5.1