From ea454e6ee42f08ce14ea2aba49183f881cfc87bc Mon Sep 17 00:00:00 2001 From: Maria Dimashova Date: Tue, 4 Oct 2011 06:32:18 +0000 Subject: [PATCH] uncommented the samples parts compiled under MSVC --- samples/cpp/latentsvm_multidetect.cpp | 34 +++++++++++++-------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/samples/cpp/latentsvm_multidetect.cpp b/samples/cpp/latentsvm_multidetect.cpp index e3eae6acff..176fb8af80 100644 --- a/samples/cpp/latentsvm_multidetect.cpp +++ b/samples/cpp/latentsvm_multidetect.cpp @@ -4,7 +4,7 @@ #include "opencv2/contrib/contrib.hpp" #ifdef WIN32 -//#include +#include #else #include #endif @@ -62,22 +62,22 @@ void readDirectory( const string& directoryName, vector& filenames, bool filenames.clear(); #ifdef WIN32 -// struct _finddata_t s_file; -// string str = directoryName + "\\*.*"; - -// intptr_t h_file = _findfirst( str.c_str(), &s_file ); -// if( h_file == -1L ) -// { -// do -// { -// if( addDirectoryName ) -// filenames.push_back(directoryName + "/" + s_file.name); -// else -// filenames.push_back((string)s_file.name); -// } -// while( _findnext( h_file, &s_file ) == 0 ); -// } -// _findclose( h_file ); + struct _finddata_t s_file; + string str = directoryName + "\\*.*"; + + intptr_t h_file = _findfirst( str.c_str(), &s_file ); + if( h_file != static_cast(-1.0) ) + { + do + { + if( addDirectoryName ) + filenames.push_back(directoryName + "\\" + s_file.name); + else + filenames.push_back((string)s_file.name); + } + while( _findnext( h_file, &s_file ) == 0 ); + } + _findclose( h_file ); #else DIR* dir = opendir( directoryName.c_str() ); if( dir != NULL ) -- GitLab