#include <filename_list.h>


Public Member Functions | |
| filename_list () | |
| filename_list & | operator= (const filename_list &to_copy) |
| int | total_files () const |
| returns the number of files currently held in the list. | |
| double | total_size () const |
| returns the full size of all files listed. | |
| bool | calculate_progress (const filename &file, double current_offset, int ¤t_file, double ¤t_size) |
| given the last "file" and position, this returns current positioning. | |
| filename_list & | operator= (const structures::string_array &to_copy) |
| void | fill (structures::string_array &to_fill) |
| stuffs the array "to_fill" with the filesnames from our list. | |
| const file_info * | find (const filename &to_check) const |
| locates the record of information for the filename "to_check". | |
| int | locate (const filename &to_find) const |
| bool | member (const filename &to_check) const |
| finds the index for "to_find" or returns a negative number. | |
| bool | member_with_state (const file_info &to_check, file_info::file_similarity comparison_method) |
| returns true if the file "to_check" exists in the list with appropriate equivalence. | |
| basis::astring | text_form () const |
| virtual int | packed_size () const |
| Estimates the space needed for the packed structure. | |
| virtual void | pack (basis::byte_array &packed_form) const |
| Creates a packed form of the packable object in "packed_form". | |
| virtual bool | unpack (basis::byte_array &packed_form) |
| Restores the packable from the "packed_form". | |
Definition at line 34 of file filename_list.h.
| filesystem::filename_list::filename_list | ( | ) |
Definition at line 26 of file filename_list.cpp.
| bool filesystem::filename_list::calculate_progress | ( | const filename & | file, | |
| double | current_offset, | |||
| int & | current_file, | |||
| double & | current_size | |||
| ) |
given the last "file" and position, this returns current positioning.
the "current_file" is set to the index of the "file" in the list (using 1-based numbering for a 1,2,3,... series), and the "current_size" is set to the total amount of bytes processed so far.
Definition at line 57 of file filename_list.cpp.
References locate(), basis::negative(), filesystem::filename::raw(), and basis::astring::t().
| void filesystem::filename_list::fill | ( | structures::string_array & | to_fill | ) |
stuffs the array "to_fill" with the filesnames from our list.
Definition at line 88 of file filename_list.cpp.
References structures::amorph< file_info >::elements(), and basis::array< contents >::reset().
Referenced by filesystem::directory_tree::current().
locates the record of information for the filename "to_check".
do not modify the returned object. it contains the current state of the file in question. if the file wasn't in the list, then NIL is returned.
Definition at line 96 of file filename_list.cpp.
References structures::amorph< file_info >::elements(), basis::astring::iequals(), NIL, and filesystem::filename::raw().
Referenced by filesystem::directory_tree::add_path(), and filesystem::heavy_file_operations::buffer_files().
| int filesystem::filename_list::locate | ( | const filename & | to_find | ) | const |
Definition at line 108 of file filename_list.cpp.
References structures::amorph< file_info >::elements(), basis::astring::iequals(), and filesystem::filename::raw().
Referenced by calculate_progress(), and filesystem::directory_tree::remove_path().
| bool filesystem::filename_list::member | ( | const filename & | to_check | ) | const |
finds the index for "to_find" or returns a negative number.
returns true if "to_check" is listed here.
Definition at line 120 of file filename_list.cpp.
References structures::amorph< file_info >::elements(), basis::astring::iequals(), and filesystem::filename::raw().
Referenced by filesystem::directory_tree::remove_path().
| bool filesystem::filename_list::member_with_state | ( | const file_info & | to_check, | |
| file_info::file_similarity | comparison_method | |||
| ) |
returns true if the file "to_check" exists in the list with appropriate equivalence.
this will fail if the file name isn't present at all. and then it will also not return true if the size is different (when EQUAL_FILESIZE is true), when the timestamp is different (when EQUAL_TIMESTAMP is true), and when the checksum is different (you get the idea).
Definition at line 132 of file filename_list.cpp.
References filesystem::file_info::_checksum, filesystem::file_info::_file_size, filesystem::file_info::_time, structures::amorph< file_info >::elements(), filesystem::file_info::EQUAL_CHECKSUM, filesystem::file_info::EQUAL_FILESIZE, filesystem::file_info::EQUAL_TIMESTAMP, basis::astring::iequals(), and filesystem::filename::raw().
Referenced by filesystem::directory_tree::compare_trees().
| filename_list & filesystem::filename_list::operator= | ( | const structures::string_array & | to_copy | ) |
Definition at line 79 of file filename_list.cpp.
References structures::amorph< file_info >::append(), basis::array< contents >::length(), and structures::amorph< file_info >::reset().
| filename_list & filesystem::filename_list::operator= | ( | const filename_list & | to_copy | ) |
Definition at line 28 of file filename_list.cpp.
References structures::amorph< file_info >::append(), structures::amorph< contents >::elements(), structures::amorph< contents >::get(), and structures::amorph< file_info >::reset().
| void filesystem::filename_list::pack | ( | basis::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 basis::packable.
Definition at line 43 of file filename_list.cpp.
References structures::amorph_pack().
Referenced by filesystem::filename_tree::pack().
| int filesystem::filename_list::packed_size | ( | ) | const [virtual] |
Estimates the space needed for the packed structure.
Implements basis::packable.
Definition at line 40 of file filename_list.cpp.
References structures::amorph_packed_size().
Referenced by filesystem::filename_tree::packed_size().
| astring filesystem::filename_list::text_form | ( | ) | const |
Definition at line 155 of file filename_list.cpp.
References structures::amorph< file_info >::elements().
| int filesystem::filename_list::total_files | ( | ) | const |
returns the number of files currently held in the list.
Definition at line 38 of file filename_list.cpp.
References structures::amorph< file_info >::elements().
| double filesystem::filename_list::total_size | ( | ) | const |
returns the full size of all files listed.
Definition at line 49 of file filename_list.cpp.
References structures::amorph< file_info >::elements().
| bool filesystem::filename_list::unpack | ( | basis::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 basis::packable.
Definition at line 46 of file filename_list.cpp.
References structures::amorph_unpack().
Referenced by octopi::recursive_file_copy::copy_hierarchy(), and filesystem::filename_tree::unpack().
1.6.3