| 43 | // ---------------------------------------------------------------------------------------- |
| 44 | |
| 45 | class file |
| 46 | { |
| 47 | /*! |
| 48 | INITIAL VALUES |
| 49 | state.name == name() |
| 50 | state.full_name == full_name() |
| 51 | state.file_size == size() |
| 52 | state.last_modified == last_modified() |
| 53 | |
| 54 | CONVENTION |
| 55 | state.name == name() |
| 56 | state.full_name == full_name() |
| 57 | state.file_size == size() |
| 58 | state.last_modified == last_modified() |
| 59 | |
| 60 | !*/ |
| 61 | |
| 62 | friend class directory; |
| 63 | |
| 64 | struct data |
| 65 | { |
| 66 | uint64 file_size; |
| 67 | std::string name; |
| 68 | std::string full_name; |
| 69 | std::chrono::time_point<std::chrono::system_clock> last_modified; |
| 70 | }; |
| 71 | |
| 72 | void init(const std::string& name); |
| 73 | |
| 74 | public: |
| 75 | |
| 76 | struct private_constructor{}; |
| 77 | inline file ( |
| 78 | const std::string& name, |
| 79 | const std::string& full_name, |
| 80 | const uint64 file_size, |
| 81 | const std::chrono::time_point<std::chrono::system_clock>& last_modified, |
| 82 | private_constructor |
| 83 | ) |
| 84 | { |
| 85 | state.file_size = file_size; |
| 86 | state.name = name; |
| 87 | state.full_name = full_name; |
| 88 | state.last_modified = last_modified; |
| 89 | } |
| 90 | |
| 91 | |
| 92 | class file_not_found : public error { |
| 93 | public: file_not_found(const std::string& s): error(s){} |
| 94 | }; |
| 95 | |
| 96 | inline file ( |
| 97 | ) |
| 98 | { |
| 99 | state.file_size = 0; |
| 100 | } |
| 101 | |
| 102 | file ( |
no outgoing calls
no test coverage detected