TF++, Miscellaneous classes and modules in C++:

◆ testfile()

void testfile ( const std::string &  s)

Definition at line 54 of file filetest.cc.

References applytest(), tfxx::file::creatable(), tfxx::file::exists(), tfxx::file::readable(), tfxx::file::regular(), tfxx::file::uniquenew(), and tfxx::file::writable().

Referenced by main().

55 {
56  cout << endl;
57  cout << "testing file " << s << endl;
58  applytest(tfxx::file::exists(s.c_str()), "does", "exist");
59  applytest(tfxx::file::regular(s.c_str()), "is", "regular");
60  applytest(tfxx::file::readable(s.c_str()), "is", "readable");
61  applytest(tfxx::file::writable(s.c_str()), "is", "writable");
62  applytest(tfxx::file::creatable(s.c_str()), "is", "creatable");
63  cout << "a unique new filename would be "
64  << tfxx::file::uniquenew(s.c_str()) << endl;
65 }
bool writable(const char *path)
Definition: filestatus.cc:82
bool regular(const char *path)
Definition: filestatus.cc:103
bool creatable(const char *path)
Definition: filestatus.cc:56
std::string uniquenew(const char *path)
Definition: filestatus.cc:113
void applytest(const bool &f, const char *a, const char *b)
Definition: filetest.cc:47
bool readable(const char *path)
Definition: filestatus.cc:92
bool exists(const char *path)
Definition: filestatus.cc:71
Here is the call graph for this function:
Here is the caller graph for this function: