Files
Work/common/Pathfnd.hpp
2024-08-07 09:09:36 -04:00

60 lines
2.0 KiB
C++

#ifndef _COMMON_PATHFIND_HPP_
#define _COMMON_PATHFIND_HPP_
#ifndef _COMMON_WINDOWS_HPP_
#include <common/windows.hpp>
#endif
#ifndef _COMMON_STRING_HPP_
#include <common/string.hpp>
#endif
#ifndef _COMMON_BLOCK_HPP_
#include <common/block.hpp>
#endif
#ifndef _COMMON_FINDDATA_HPP_
#include <common/finddata.hpp>
#endif
class PathFind
{
public:
PathFind(void);
virtual ~PathFind();
WORD findFile(const String &pureFileName,String &pathFileName);
WORD dirList(String pathEntry,Block<String> &subDirList);
WORD fileList(String pathFileSpec,Block<String> &entryList);
WORD getWindowsDirectory(String &windowsDirectoryString);
WORD getSystemDirectory(String &systemDirectoryString);
BOOL getWindowsTempDirectory(String &windowsTempDirectory);
BOOL getTempFileName(String &strPathTempFileName,const String &strPrefix=String());
private:
enum {BackSlash='\\',ForwardSlash='/',Dot='.'};
WORD getPathBlock(void);
WORD searchPath(String pathEntry,String pureFileName,String &pathFileName);
WORD searchPathTranscend(String pathEntry,String pureFileName,String &pathFileName);
WORD getPathTranscend(String pathEntry,Block<String> &pathFileName);
WORD getDirectoryFileEntries(String pathEntry,Block<String> &entryStrings);
WORD getDirEntries(String pathEntryFileSpec,Block<String> &entryStrings);
WORD canTranscend(String &pathEntry);
void fixupPathName(String &pathEntry);
WORD isFile(const String &pathFileName);
WORD getWinDir(String &winDirString);
WORD getCurrDir(String &currDirString);
void subList(Block<String> &subDirList,String pathEntry);
WORD isDirectory(FindData &findData);
BOOL hasWildCard(String &pathFileSpec)const;
BOOL hasPath(String &pathFileSpec)const;
void insertPath(String &pathFileSpec)const;
FindData mFindData;
Block<String> mPathEntry;
String mUpDirString;
String mCurrDirString;
String mBackSlashString;
String mStarDotStarString;
String mStarString;
String mPathString;
String mSemicolonString;
String mWinDirString;
WORD mIsOkay;
};
#endif