- BORLAND/: Borland C++ 4.52 (chosen over 4.5 by byte-match: CODE/RP/CW32.LIB
is identical to 4.52's install lib). BCC32/TLINK32/TLIB/MAKE run natively on
Win11; CODE/BT/OPT.MAK is the shipped BTL4OPT.EXE's exact flag recipe
(extender = Borland PowerPack DPMI32, not Phar Lap TNT).
- restoration/source410/: the literal 1995-form reconstruction of the missing
BT game source (never mixed into CODE/). Round 1-3 state:
* 6 of 10 surviving original TUs COMPILE CLEAN under the period toolchain
(BTMSSN, BTCNSL, BTSCNRL, BTTEAM, BTL4MODE, BTL4ARND) - first builds
since 1996.
* BT_L4/BTL4APP.CPP pilot reconstruction: 12/12 functions, Fail() lands on
its binary-recorded line 400 exactly.
* BT/BTCNSL.HPP: console wire IDs recovered from the binary's ctors
(Killed=9, Damaged=10, ScoreUpdate=13, DeathWithoutHonor=15 [T1];
TeamScore=12 flagged [T4]).
* MUNGA/: 8 engine-header backfills back-dated from the BT412 WinTesla tree
(VDATA numbering decomp-verified; AUDREND's OpenAL-era virtual removed -
the period compiler is the drift detector).
* Tooling: backdate.py (WinTesla->1995 header transform), compile410.sh
(per-TU verification sweep under authentic OPT.MAK flags).
* README: corrected roadmap - MECH.HPP is the capstone grown with the mech
TU reconstructions; BTREG.CPP green = the header-family milestone.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
177 lines
4.3 KiB
C++
177 lines
4.3 KiB
C++
//----------------------------------------------------------------------------
|
|
// IdeHook - (C) Copyright 1994 by Borland International
|
|
//----------------------------------------------------------------------------
|
|
#ifndef __PATHSPEC_H
|
|
#define __PATHSPEC_H
|
|
|
|
#ifndef __DIR_H
|
|
# include <dir.h>
|
|
#endif
|
|
|
|
// //
|
|
// class PathSpec for manipulation file paths //
|
|
// //
|
|
|
|
class PathSpec
|
|
{
|
|
public:
|
|
// ctor //
|
|
|
|
PathSpec( const char * = "" );
|
|
|
|
// accessors //
|
|
|
|
const char * path();
|
|
const char * drive();
|
|
const char * dir();
|
|
const char * file();
|
|
const char * ext();
|
|
|
|
void path(const char *);
|
|
void drive(const char *);
|
|
void dir(const char *);
|
|
void file(const char *);
|
|
void ext(const char *);
|
|
void fileext( const char * );
|
|
|
|
long age();
|
|
|
|
// flags() returns FILENAME, WILDCARDS etc. flags found in dir.h //
|
|
|
|
int flags();
|
|
|
|
// explicit splitter/merger //
|
|
|
|
int split();
|
|
void merge();
|
|
|
|
// disk manipulation and polling //
|
|
|
|
int exists();
|
|
int first();
|
|
int next();
|
|
|
|
// Are this and another PathSpec referring to the same drive? //
|
|
|
|
int sameDrive( PathSpec & );
|
|
|
|
// Is this PathSpec really representing a directory? //
|
|
|
|
int isDirectory();
|
|
|
|
void addTrailingSlash();
|
|
|
|
// Strip the trailing slash from the path() element and return //
|
|
// the path(). (Calling this invalidates the use dir(), file() //
|
|
// and ext()). //
|
|
|
|
char * stripTrailingSlash();
|
|
|
|
// //
|
|
// Do a FileOpen dialog on this pathSpec... //
|
|
// 'filter' should use the pipe character ('|')//
|
|
// as a separator //
|
|
// (e.g. "All files (*.*)|*.*|") //
|
|
// NOTE: In this implementation 'hwndParent' //
|
|
// is a Windows' HWND. //
|
|
// //
|
|
|
|
int openFileDialog
|
|
(
|
|
const char * filter = 0,
|
|
const char * initialDir = 0,
|
|
unsigned long hwndParent = 0
|
|
);
|
|
|
|
int newFileDialog
|
|
(
|
|
const char * filter = 0,
|
|
const char * initialDir = 0,
|
|
unsigned long hwndParent = 0
|
|
);
|
|
|
|
int fileDialog
|
|
(
|
|
const char * filter = 0,
|
|
const char * initialDir = 0,
|
|
unsigned long hwndParent = 0,
|
|
unsigned long flags = 0
|
|
);
|
|
private:
|
|
|
|
char _path [ MAXPATH ];
|
|
char _drive[ MAXDRIVE ];
|
|
char _dir [ MAXDIR ];
|
|
char _file [ MAXFILE ];
|
|
char _ext [ MAXEXT ];
|
|
int _flags;
|
|
|
|
struct ffblk _dta;
|
|
};
|
|
|
|
inline
|
|
PathSpec::PathSpec( const char * apath )
|
|
{
|
|
path( apath );
|
|
}
|
|
|
|
inline const char *
|
|
PathSpec::path()
|
|
{
|
|
return( _path );
|
|
}
|
|
|
|
inline const char *
|
|
PathSpec::drive()
|
|
{
|
|
return( _drive );
|
|
}
|
|
|
|
inline const char *
|
|
PathSpec::dir()
|
|
{
|
|
return( _dir );
|
|
}
|
|
|
|
inline const char *
|
|
PathSpec::file()
|
|
{
|
|
return( _file );
|
|
}
|
|
|
|
inline const char *
|
|
PathSpec::ext()
|
|
{
|
|
return( _ext );
|
|
}
|
|
|
|
inline int
|
|
PathSpec::flags()
|
|
{
|
|
return( _flags );
|
|
}
|
|
|
|
inline int
|
|
PathSpec::exists()
|
|
{
|
|
return( first() );
|
|
}
|
|
|
|
inline long
|
|
PathSpec::age()
|
|
{
|
|
if( exists() )
|
|
{
|
|
unsigned long date = _dta.ff_fdate;
|
|
unsigned long time = _dta.ff_ftime;
|
|
|
|
return( (long)( (date << 16) | time ) );
|
|
}
|
|
return( -1L );
|
|
}
|
|
|
|
#endif __PATHSPEC_H
|
|
|
|
// End of file
|
|
|