a99  V32.6
allegro Windows Hauptprogramm
 Alle Klassen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
lookford.cpp
gehe zur Dokumentation dieser Datei
1 // lookfordb.cpp : Pruefen, ob auf dem Pfad eine DB vorliegt
2 //
3 // Copyright 2011 Universitätsbibliothek Braunschweig, more see bottom
4 
5 #include "stdafx.h"
6 #include <afx.h>
7 
8 
9 
10 int LookForDB(LPSTR lpDBPath, LPSTR lpDBName,char cKonf)
11 {
12  /* Rueckgabe: 1: Datenbank gefunden
13  -1: Kein Index *.Cdx
14  -2: Keine Satztabelle *.tbl
15  -3: Keine Datendate *.Cld
16  */
17  int iReturnValue=1;
18  CFileFind finder;
19  CString csPath=lpDBPath;
20  CString csDBFile;
21  if(lpDBPath[strlen(lpDBPath)-1]!=92) csPath+="\\";
22  // 1. *.Cdx-Datei suchen
23  csDBFile.Format("%s%s.%cdx",csPath.GetBuffer(255),lpDBName,cKonf);
24  if(finder.FindFile(csDBFile.GetBuffer(255))==0)iReturnValue=-1;
25  if(iReturnValue>0){ // 2. *.tbl-Datei suchen
26  csDBFile.Format("%s%s.tbl",csPath.GetBuffer(255),lpDBName);
27  if(finder.FindFile(csDBFile.GetBuffer(255))==0)iReturnValue=-2;
28  }
29  if(iReturnValue>0){ // 3. *.Cld-Datei suchen
30  csDBFile.Format("%s*.%cld",csPath.GetBuffer(255),cKonf);
31  if(finder.FindFile(csDBFile.GetBuffer(255))==0)iReturnValue=-3;
32  }
33  return iReturnValue;
34 }
35 
36 /*
37  Copyright 2011 Universitätsbibliothek Braunschweig
38 
39  Licensed under the Apache License, Version 2.0 (the "License");
40  you may not use this file except in compliance with the License.
41  You may obtain a copy of the License at
42 
43  http://www.apache.org/licenses/LICENSE-2.0
44 
45  Unless required by applicable law or agreed to in writing, software
46  distributed under the License is distributed on an "AS IS" BASIS,
47  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
48  See the License for the specific language governing permissions and
49  limitations under the License.
50 */
51