/usr/lib/R/site-library/dplyr/include/dplyr/BoolResult.h is in r-cran-dplyr 0.7.4-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | #ifndef dplyr_tools_BoolResult_H
#define dplyr_tools_BoolResult_H
#include <tools/utils.h>
namespace dplyr {
class BoolResult {
public:
BoolResult(bool result_) : result(result_) {}
BoolResult(bool result_, const CharacterVector& msg) : result(result_), message(msg) {}
inline operator SEXP() const {
LogicalVector res = LogicalVector::create(result);
res.attr("comment") = message;
set_class(res, "BoolResult");
return res;
}
inline operator bool() const {
return result;
}
inline std::string why_not() const {
R_xlen_t n = message.length();
if (n == 0)
return "";
if (n == 1)
return std::string(message[0]);
std::stringstream ss;
ss << "\n";
for (int i = 0; i < n; ++i) {
ss << "- " << std::string(message[i]) << "\n";
}
return ss.str();
}
private:
bool result;
CharacterVector message;
};
inline BoolResult no_because(const CharacterVector& msg) {
return BoolResult(false, msg);
}
inline BoolResult yes() {
return true;
}
}
#endif
|