API Reference > OdDb Classes > OdDbBaseHostAppServices Class > OdDbBaseHostAppServices Methods > OdDbBaseHostAppServices::findFile Method
OdDbBaseHostAppServices::findFile Method
Syntax
C++
virtual OdString findFile(const OdString& filename, OdDbBaseDatabase* pDb = 0, FindFileHint hint = kDefault) = 0;
Parameters 
Description 
const OdString& filename 
[in] Name of the file to find.  
OdDbBaseDatabase* pDb = 0 
[in] Pointer to the database context.  
FindFileHint hint = kDefault 
[in] Hint that indicates the type of file that is required. 

Returns an empty string if the file is not found. 

This function is called by the ODA Platform when the database needs access to a file, such as a font file, a template file, etc. 

pDb == 0 specifies that this file search is not related to a database. 

If pDb != 0, call pDb->getFilename() to determine the path to the DWG file associated with the database. 

The typical search order is as follows: 

  1. The filename itself.
  2. The current directory.
  3. The drawing directory (for shx font, image, and xref files).
  4. The directories listed in the ACAD environment variable.
  5. The Windows fonts directory (only for TTF fonts on Windows).
 

hint must be one of the following: 

 

Name 
Value 
Description Extension 
kDefault 
Any file. any 
kFontFile 
Can be either SHX or TTF file. SHX or TTF 
kCompiledShapeFile 
SHX file. SHX 
kTrueTypeFontFile 
TTF file. TTF 
kEmbeddedImageFile 
Image file. ISM 
kXRefDrawing 
Drawing template file. DWT 
kPatternFile 
Pattern file (PAT) PAT 
kTXApplication 
ODA Xtension file. TX 
kFontMapFile 
FontMap file FMP 
kUnderlayFile 
Underlay file 
kTextureMapFile 
10 
 

Returns the fully qualified path to the specified file. 

 

The client application can, in fact return any non-null string, so long as the application can handle that string in OdDbSystemServices::createFile.

Copyright © 2002–2020. Open Design Alliance. All rights reserved.