~ubuntu-branches/debian/stretch/openbabel/stretch

« back to all changes in this revision

Viewing changes to src/dlhandler_win32.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck
  • Date: 2008-07-22 23:54:58 UTC
  • mfrom: (3.1.10 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080722235458-3o606czluviz4akx
Tags: 2.2.0-2
* Upload to unstable.
* debian/control: Updated descriptions.
* debian/patches/gauss_cube_format.patch: New patch, makes the 
  gaussian cube format available again.
* debian/rules (DEB_DH_MAKESHLIBS_ARGS_libopenbabel3): Removed.
* debian/rules (DEB_CONFIGURE_EXTRA_FLAGS): Likewise.
* debian/libopenbabel3.install: Adjust formats directory to single 
  version hierarchy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
16
GNU General Public License for more details.
17
17
***********************************************************************/
 
18
#include <openbabel/babelconfig.h>
18
19
 
19
20
#include <cstdarg>
20
21
#include <iostream>
23
24
//#include <winbase.h>
24
25
//#include <direct.h>
25
26
#include <windows.h>
26
 
#include "dlhandler.h"
 
27
#include <openbabel/dlhandler.h>
27
28
using namespace std;
28
29
 
29
30
 
30
 
 
31
31
bool DLHandler::getConvDirectory(string& convPath)
32
32
{
33
33
    char path[MAX_PATH+1];
51
51
        file_list.push_back(filename);
52
52
        return -1;
53
53
    }
54
 
    int pos = filename.find_last_of("\\/");
 
54
    size_t pos = filename.find_last_of("\\/");
55
55
    if(pos!=string::npos)
56
56
        return findFiles(file_list,filename.substr(pos+1), filename.substr(0,pos+1));
57
57
    else
62
62
{
63
63
    WIN32_FIND_DATA file_data;
64
64
    HANDLE handle;
65
 
    if ((handle = FindFirstFile ((path + pattern).c_str(), &file_data)) == INVALID_HANDLE_VALUE)
66
 
        return 0;
67
 
 
68
 
    ULONG value = (file_data.dwFileAttributes) & FILE_ATTRIBUTE_DIRECTORY;
69
 
    if (value != FILE_ATTRIBUTE_DIRECTORY)
70
 
    {
71
 
        string s = file_data.cFileName;
72
 
        file_list.push_back(path + s);
73
 
 
74
 
        while (FindNextFile (handle, &file_data))
75
 
        {
76
 
            value = (file_data.dwFileAttributes) & FILE_ATTRIBUTE_DIRECTORY;
77
 
            if (value != FILE_ATTRIBUTE_DIRECTORY)
78
 
            {
79
 
                s = file_data.cFileName;
80
 
                file_list.push_back(path + s);
81
 
            }
82
 
        }
83
 
    }
84
 
 
 
65
        handle = FindFirstFile ((path + pattern).c_str(), &file_data);
 
66
        while(handle!=INVALID_HANDLE_VALUE)
 
67
        {
 
68
                ULONG value = (file_data.dwFileAttributes) & FILE_ATTRIBUTE_DIRECTORY;
 
69
                if (value != FILE_ATTRIBUTE_DIRECTORY)
 
70
                {
 
71
                  string s = file_data.cFileName;
 
72
                  file_list.push_back(path + s);
 
73
                }
 
74
                if(!FindNextFile (handle, &file_data))
 
75
                        break;
 
76
        }
85
77
    if (! (FindClose (handle)))
86
78
        return 0;// couldn't close search handle
87
79
    return file_list.size();