Skip to content
Snippets Groups Projects
Commit cf7b0550 authored by Tristan Walter's avatar Tristan Walter
Browse files

windows adjustments

parent 0bba58b3
No related branches found
No related tags found
No related merge requests found
......@@ -31,3 +31,4 @@
*.out
*.app
Application/build/
Application/tmp/
#include "Path.h"
#include <cstdlib>
#if WIN32
#include "../dirent.h"
#define OS_SEP '\\'
......@@ -161,8 +162,7 @@ namespace file {
#if WIN32
if (!folder.empty() && folder.back() == ':')
continue;
if(_mkdir(folder.c_str()) != 0) {
if(CreateDirectory(folder.c_str(), NULL)) {
#else
if(mkdir(folder.c_str(), ACCESSPERMS) != 0) {
#endif
......@@ -231,8 +231,11 @@ namespace file {
U_EXCEPTION("Unknown file type '%S'.", &file.str());
}
}
#if defined(WIN32)
return RemoveDirectory(str().c_str());
#else
return rmdir(str().c_str()) == 0;
#endif
}
bool valid_extension(const file::Path& path, const std::string& filter_extension) {
......
......@@ -128,7 +128,11 @@ namespace cmn {
}
void CommandLine::cd_home() {
#if defined(WIN32)
if(SetCurrentDirectoryA(_wd.c_str()))
#else
if (chdir(_wd.str().c_str()))
#endif
//Debug("Changed directory to '%S'.", &_wd.str());
//else
Error("Cannot change directory to '%S'.", &_wd.str());
......
......@@ -701,7 +701,7 @@ void FrameGrabber::initialize_video() {
}
if(filenames.size() == 1) {
_video = new VideoSource(filenames.front());
_video = new VideoSource(filenames.front().str());
} else {
_video = new VideoSource(filenames);
......@@ -725,11 +725,7 @@ void FrameGrabber::initialize_video() {
if(!SETTING(mask_path).value<file::Path>().empty()) {
auto path = pv::DataLocation::parse("input", SETTING(mask_path).value<file::Path>());
if(path.exists()) {
auto folder = path.remove_filename();
auto ext = path.extension().to_string();
auto base = path.remove_extension();
_video_mask = new VideoSource(base.str(), ext);
_video_mask = new VideoSource(path.str());
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment