@@ -7,7 +7,7 @@ namespace base {
77
88class File final : public Data {
99 public:
10- explicit File (const String & path); // Open read-only file
10+ explicit File (const Path & path); // Open read-only file
1111
1212 using Handle::Close;
1313
@@ -17,38 +17,37 @@ class File final : public Data {
1717 }
1818 }
1919
20- static bool IsFile (const String & path, String* error = nullptr );
21- static bool IsExecutable (const String & path, String* error = nullptr );
22- static bool Exists (const String & path, String* error = nullptr );
20+ static bool IsFile (const Path & path, String* error = nullptr );
21+ static bool IsExecutable (const Path & path, String* error = nullptr );
22+ static bool Exists (const Path & path, String* error = nullptr );
2323
2424 ui64 Size (String* error = nullptr ) const ;
2525 bool Read (Immutable* output, String* error = nullptr );
2626 bool Hash (Immutable* output, const List<Literal>& skip_list = List<Literal>(),
2727 String* error = nullptr);
2828
29- bool CopyInto (const String & dst_path, String* error = nullptr );
29+ bool CopyInto (const Path & dst_path, String* error = nullptr );
3030
31- static ui64 Size (const String & path, String* error = nullptr );
32- static bool Read (const String & path, Immutable* output,
31+ static ui64 Size (const Path & path, String* error = nullptr );
32+ static bool Read (const Path & path, Immutable* output,
3333 String* error = nullptr );
34- static bool Write (const String & path, Immutable input,
34+ static bool Write (const Path & path, Immutable input,
3535 String* error = nullptr );
36- static bool Hash (const String & path, Immutable* output,
36+ static bool Hash (const Path & path, Immutable* output,
3737 const List<Literal>& skip_list = List<Literal>(),
3838 String* error = nullptr);
3939
40- static bool Copy (const String & src_path, const String & dst_path,
40+ static bool Copy (const Path & src_path, const Path & dst_path,
4141 String* error = nullptr );
42- static bool Link (const String& src_path , const String& dst_path ,
42+ static bool Move (const Path& src , const Path& dst ,
4343 String* error = nullptr );
44- static bool Move (const String& src, const String& dst,
45- String* error = nullptr );
46- static bool Delete (const String& path, String* error = nullptr );
44+ static bool Delete (const Path& path, String* error = nullptr );
4745
4846 private:
49- File (const String & path, ui64 size); // Open truncated write-only file
47+ File (const Path & path, ui64 size); // Open truncated write-only file
5048 bool Close (String* error = nullptr );
5149
50+ String path_;
5251 String error_;
5352 String move_on_close_;
5453};
0 commit comments