llvm.org GIT mirror llvm / 357b571
Remove unimplemented function prototypes from PathV2. They can be readded when someone cares enough. Patch by Aaron Ballman! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139682 91177308-0d34-0410-b5e6-96231b3b80d8 Benjamin Kramer 9 years ago
2 changed file(s) with 7 addition(s) and 147 deletion(s). Raw diff Collapse all Expand all
200200 /// platform specific error_code.
201201 error_code resize_file(const Twine &path, uint64_t size);
202202
203 /// @brief Make file readable.
204 ///
205 /// @param path Input path.
206 /// @param value If true, make readable, else, make unreadable.
207 /// @results errc::success if readability has been successfully set, otherwise a
208 /// platform specific error_code.
209 error_code set_read(const Twine &path, bool value);
210
211 /// @brief Make file writeable.
212 ///
213 /// @param path Input path.
214 /// @param value If true, make writeable, else, make unwriteable.
215 /// @results errc::success if writeability has been successfully set, otherwise
216 /// a platform specific error_code.
217 error_code set_write(const Twine &path, bool value);
218
219 /// @brief Make file executable.
220 ///
221 /// @param path Input path.
222 /// @param value If true, make executable, else, make unexecutable.
223 /// @results errc::success if executability has been successfully set, otherwise
224 /// a platform specific error_code.
225 error_code set_execute(const Twine &path, bool value);
226
227203 /// @}
228204 /// @name Physical Observers
229205 /// @{
288264 /// platform specific error_code.
289265 error_code is_directory(const Twine &path, bool &result);
290266
291 /// @brief Is path an empty file?
292 ///
293 /// @param path Input path.
294 /// @param result Set to true if \a path is a an empty file, false if it is not.
295 /// Undefined otherwise.
296 /// @results errc::success if result has been successfully set, otherwise a
297 /// platform specific error_code.
298 error_code is_empty(const Twine &path, bool &result);
299
300267 /// @brief Does status represent a regular file?
301268 ///
302269 /// @param status A file_status previously returned from status.
345312 /// platform specific error_code.
346313 error_code is_symlink(const Twine &path, bool &result);
347314
348 /// @brief Get last write time without changing it.
349 ///
350 /// @param path Input path.
351 /// @param result Set to the last write time (UNIX time) of \a path if it
352 /// exists.
353 /// @results errc::success if result has been successfully set, otherwise a
354 /// platform specific error_code.
355 error_code last_write_time(const Twine &path, std::time_t &result);
356
357 /// @brief Set last write time.
358 ///
359 /// @param path Input path.
360 /// @param value Time to set (UNIX time) \a path's last write time to.
361 /// @results errc::success if result has been successfully set, otherwise a
362 /// platform specific error_code.
363 error_code set_last_write_time(const Twine &path, std::time_t value);
364
365 /// @brief Read a symlink's value.
366 ///
367 /// @param path Input path.
368 /// @param result Set to the value of the symbolic link \a path.
369 /// @results errc::success if result has been successfully set, otherwise a
370 /// platform specific error_code.
371 error_code read_symlink(const Twine &path, SmallVectorImpl &result);
372
373 /// @brief Get disk space usage information.
374 ///
375 /// @param path Input path.
376 /// @param result Set to the capacity, free, and available space on the device
377 /// \a path is on.
378 /// @results errc::success if result has been successfully set, otherwise a
379 /// platform specific error_code.
380 error_code disk_space(const Twine &path, space_info &result);
381
382315 /// @brief Get file status as if by POSIX stat().
383316 ///
384317 /// @param path Input path.
400333 /// @results errc::success if result has been successfully set, otherwise a
401334 /// platform specific error_code.
402335 error_code status_known(const Twine &path, bool &result);
403
404 /// @brief Get file status as if by POSIX lstat().
405 ///
406 /// Does not resolve symlinks.
407 ///
408 /// @param path Input path.
409 /// @param result Set to the file status.
410 /// @results errc::success if result has been successfully set, otherwise a
411 /// platform specific error_code.
412 error_code symlink_status(const Twine &path, file_status &result);
413336
414337 /// @brief Generate a unique path and open it as a file.
415338 ///
474397 /// platform specific error_code.
475398 error_code identify_magic(const Twine &path, LLVMFileType &result);
476399
477 /// @brief Is file bitcode?
478 ///
479 /// @param path Input path.
480 /// @param result Set to true if \a path is a bitcode file, false if it is not,
481 /// undefined otherwise.
482 /// @results errc::success if result has been successfully set, otherwise a
483 /// platform specific error_code.
484 error_code is_bitcode(const Twine &path, bool &result);
485
486 /// @brief Is file a dynamic library?
487 ///
488 /// @param path Input path.
489 /// @param result Set to true if \a path is a dynamic library, false if it is
490 /// not, undefined otherwise.
491 /// @results errc::success if result has been successfully set, otherwise a
492 /// platform specific error_code.
493 error_code is_dynamic_library(const Twine &path, bool &result);
494
495 /// @brief Is an object file?
496 ///
497 /// @param path Input path.
498 /// @param result Set to true if \a path is an object file, false if it is not,
499 /// undefined otherwise.
500 /// @results errc::success if result has been successfully set, otherwise a
501 /// platform specific error_code.
502 error_code is_object_file(const Twine &path, bool &result);
503
504 /// @brief Can file be read?
505 ///
506 /// @param path Input path.
507 /// @param result Set to true if \a path is readable, false it it is not,
508 /// undefined otherwise.
509 /// @results errc::success if result has been successfully set, otherwise a
510 /// platform specific error_code.
511 error_code can_read(const Twine &path, bool &result);
512
513 /// @brief Can file be written?
514 ///
515 /// @param path Input path.
516 /// @param result Set to true if \a path is writeable, false it it is not,
517 /// undefined otherwise.
518 /// @results errc::success if result has been successfully set, otherwise a
519 /// platform specific error_code.
520 error_code can_write(const Twine &path, bool &result);
521
522 /// @brief Can file be executed?
523 ///
524 /// @param path Input path.
525 /// @param result Set to true if \a path is executable, false it it is not,
526 /// undefined otherwise.
527 /// @results errc::success if result has been successfully set, otherwise a
528 /// platform specific error_code.
529 error_code can_execute(const Twine &path, bool &result);
530
531400 /// @brief Get library paths the system linker uses.
532401 ///
533402 /// @param result Set to the list of system library paths.
571440 /// @{
572441
573442 /// directory_entry - A single entry in a directory. Caches the status either
574 /// from the result of the iteration syscall, or the first time status or
575 /// symlink_status is called.
443 /// from the result of the iteration syscall, or the first time status is
444 /// called.
576445 class directory_entry {
577446 std::string Path;
578447 mutable file_status Status;
579 mutable file_status SymlinkStatus;
580448
581449 public:
582 explicit directory_entry(const Twine &path, file_status st = file_status(),
583 file_status symlink_st = file_status())
450 explicit directory_entry(const Twine &path, file_status st = file_status())
584451 : Path(path.str())
585 , Status(st)
586 , SymlinkStatus(symlink_st) {}
452 , Status(st) {}
587453
588454 directory_entry() {}
589455
590 void assign(const Twine &path, file_status st = file_status(),
591 file_status symlink_st = file_status()) {
456 void assign(const Twine &path, file_status st = file_status()) {
592457 Path = path.str();
593458 Status = st;
594 SymlinkStatus = symlink_st;
595459 }
596460
597 void replace_filename(const Twine &filename, file_status st = file_status(),
598 file_status symlink_st = file_status());
461 void replace_filename(const Twine &filename, file_status st = file_status());
599462
600463 const std::string &path() const { return Path; }
601464 error_code status(file_status &result) const;
602 error_code symlink_status(file_status &result) const;
603465
604466 bool operator==(const directory_entry& rhs) const { return Path == rhs.Path; }
605467 bool operator!=(const directory_entry& rhs) const { return !(*this == rhs); }
681681 !is_symlink(status);
682682 }
683683
684 void directory_entry::replace_filename(const Twine &filename, file_status st,
685 file_status symlink_st) {
684 void directory_entry::replace_filename(const Twine &filename, file_status st) {
686685 SmallString<128> path(Path.begin(), Path.end());
687686 path::remove_filename(path);
688687 path::append(path, filename);
689688 Path = path.str();
690689 Status = st;
691 SymlinkStatus = symlink_st;
692690 }
693691
694692 error_code has_magic(const Twine &path, const Twine &magic, bool &result) {