36 testInvariant ()
const
43 DiskListXRD (
const std::string& val_server,
const std::string& val_directory,
57 using namespace msgScanDir;
71 std::string::size_type split1 =
m_list.find (
'\n');
72 if (split1 == std::string::npos)
75 const std::string line (
m_list.substr (0, split1));
79 std::string::size_type split2 = line.find (
'/');
80 if (split2 != std::string::npos &&
81 (line[0] ==
'-' || line[0] ==
'd'))
84 m_file = line.substr (split2);
92 std::string message =
"failed to parse line: \"" + line +
"\"\n" +
m_context;
96 throw std::runtime_error (message);
104 std::string DiskListXRD ::
126 std::string DiskListXRD ::
#define RCU_CHANGE_INVARIANT(x)
#define RCU_NEW_INVARIANT(x)
#define RCU_READ_INVARIANT(x)
std::string m_server
the server from which we are reading
std::string m_context
the context (for error reporting)
bool m_laxParser
whether we employ lax parsing
std::string m_directory
the directory we are reading
std::string m_list
the result of the directory listing
bool m_isRead
whether the directory has been read
DiskListXRD(const std::string &val_server, const std::string &val_dir, bool val_laxParsing=false)
make the listing for the given directory, but replacing the directory with prefix for the path
bool m_isDir
whether this is a directory
std::string m_file
the last file we read
DiskList()
standard constructor
std::string exec_read(const std::string &cmd)
effects: execute the given command and return the output returns: the output of the command guarantee...
This module provides a lot of global definitions, forward declarations and includes that are used by ...