Exemplo n.º 1
0
static void test_parent(const fs::path & in, const std::string & out) {
	
	fs::path p = in.parent();
	arx_assert_msg(p.string() == out, "\"%s\".parent() -> \"%s\" != \"%s\"",
	               in.string().c_str(), p.string().c_str(), out.c_str());
	
	fs::path temp = in;
	temp.up();
	arx_assert_msg(temp.string() == out, "\"%s\".up() ->\"%s\" != \"%s\"",
	               in.string().c_str(), temp.string().c_str(), out.c_str());
	
}
Exemplo n.º 2
0
SnapShot::SnapShot(const fs::path & name, bool replace) {
	
	int num = 0;
	
	do {
		
		ostringstream oss;
		oss << name.filename() << '_' << num << ".bmp";
		
		file = name.parent() / oss.str();
		
		num++;
	} while(!replace && fs::exists(file));
	
}