22 int main(
int argc,
char* argv[]) {
29 clp.
add_param_string(
"op", op,
"operation: glob | glob_files | read | write");
31 std::vector<std::string> paths;
45 std::cout <<
"No entries returned in glob." << std::endl;
49 <<
" type " << fi.type
50 <<
" size " << fi.size
51 <<
" size_ex_psum " << fi.size_ex_psum
55 else if (op ==
"glob_files")
60 std::cout <<
"No files returned in glob." << std::endl;
64 <<
" type " << fi.type
65 <<
" size " << fi.size
66 <<
" size_ex_psum " << fi.size_ex_psum
70 else if (op ==
"read")
77 char buffer[64 * 1024];
79 while ((rb = rs->read(buffer,
sizeof(buffer))) > 0) {
80 std::cout.write(buffer, rb);
84 else if (op ==
"write")
90 char buffer[64 * 1024];
91 while (std::cin.read(buffer,
sizeof(buffer)), std::cin.gcount()) {
92 ws->write(buffer, std::cin.gcount());
97 LOG1 <<
"Unknown operation \"" << op <<
"\".";
FileList Glob(const std::vector< std::string > &globlist, const GlobType >ype)
Reads a glob path list and deliver a file list, sizes, and prefixsums (in bytes) for all matching fil...
void set_description(const std::string &description)
Set description of program, text will be wrapped.
void Initialize()
Initialize VFS layer.
ReadStreamPtr OpenReadStream(const std::string &path, const common::Range &range)
Construct reader for given path uri.
General information of vfs file.
void Deinitialize()
Deinitialize VFS layer.
std::basic_string< char, std::char_traits< char >, Allocator< char > > string
string with Manager tracking
Command line parser which automatically fills variables and prints nice usage messages.
void add_param_string(const std::string &name, std::string &dest, const std::string &desc)
add string parameter [name] with description and store to dest
void add_param_stringlist(const std::string &name, std::vector< std::string > &dest, const std::string &desc)
List of file info and additional overall info.
WriteStreamPtr OpenWriteStream(const std::string &path)
bool process(int argc, const char *const *argv, std::ostream &os)