Rhino C++ API  8.14
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CRhinoDirectoryManager Class Reference

#include <RhinoSdkDirectoryManager.h>

Public Types

enum  FileTypes {
  ftOpen = 0, ftSave = ftOpen, ftImport, ftExport,
  ftTemplate, ftBitmap, ftRender, ftScreenCapture = ftRender,
  ftSaveDisplay = ftRender, ftTextures, ftBump, ftToolbarCollection,
  ftToolbarBitmapExport, ftToolbarBitmapImport = ftToolbarBitmapExport, ftCommandFile, ftRun,
  ftReadFile, ftCommandAlias, ftPlugIn, ftRhino3dmFile,
  ftWorksession, ftAttachReferenceFile, ftCount, force_32bit_file_types = 0xFFFFFFFF
}
 

Public Member Functions

int AppendSearchPath (const wchar_t *lps)
 
FileTypes ConvertRhinoGetFileDialogDialogType (int ft)
 Helper function for internal use. More...
 
void DeleteSearchPath (int i)
 
BOOL32 DirectoryFromFileName (const wchar_t *lpsFileName, ON_wString &dir)
 
BOOL32 GetDefaultDirectory (FileTypes ft, ON_wString &result)
 
BOOL32 InsertSearchPath (int i, const wchar_t *lps)
 
void LoadProfile (CRhinoProfileContext &PC)
 
void SaveProfile (CRhinoProfileContext &PC)
 
const wchar_t * SearchPath (int i) const
 
int SearchPathCount () const
 
const wchar_t * SearchPathCountEntry () const
 
const wchar_t * SearchPathEntryPrefix () const
 
const wchar_t * SearchPathKey () const
 
BOOL32 SetDefaultDirectory (FileTypes ft, const wchar_t *lpsDirectory)
 
BOOL32 SetDefaultDirectoryFromFileName (FileTypes ft, const wchar_t *lpsFileName)
 
void SetWorkingDirectory (const wchar_t *lpsDirectory)
 

Protected Member Functions

const wchar_t * Entry (FileTypes)
 
void Initialize ()
 
const wchar_t * Key ()
 
void Save ()
 Should only be called once by CRhinoApp::ExitInstance() More...
 

Protected Attributes

ON_wString m_dir_list [ftCount]
 
ON_ClassArray< ON_wStringm_search_path
 

Friends

class CRhinoApp
 

Detailed Description

Copyright (c) 1993-2017 Robert McNeel & Associates. All rights reserved. Rhinoceros is a registered trademark of Robert McNeel & Associates.

THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.

For complete Rhino SDK copyright information see http://www.rhino3d.com/developer.

Member Enumeration Documentation

◆ FileTypes

Enumerator
ftOpen 
ftSave 
ftImport 
ftExport 
ftTemplate 
ftBitmap 
ftRender 
ftScreenCapture 
ftSaveDisplay 
ftTextures 
ftBump 
ftToolbarCollection 
ftToolbarBitmapExport 
ftToolbarBitmapImport 
ftCommandFile 
ftRun 
ftReadFile 
ftCommandAlias 
ftPlugIn 
ftRhino3dmFile 
ftWorksession 
ftAttachReferenceFile 
ftCount 

Leave this at the end, it specifies array length

force_32bit_file_types 

for internal use only, this allows adding additional values without breaking the SDK in the future

Member Function Documentation

◆ AppendSearchPath()

int CRhinoDirectoryManager::AppendSearchPath ( const wchar_t *  lps)

Description: Add directory to end of search path. Parameters: lps [in] - Directory to add. Returns: Index of new directory or -1 if an error occurred.

◆ ConvertRhinoGetFileDialogDialogType()

FileTypes CRhinoDirectoryManager::ConvertRhinoGetFileDialogDialogType ( int  ft)

Helper function for internal use.

◆ DeleteSearchPath()

void CRhinoDirectoryManager::DeleteSearchPath ( int  i)

Description: Remove user directory from CRhinoFileUtilities::FindFile Parameters: i [in] - Index of directory to delete. Returns:

◆ DirectoryFromFileName()

BOOL32 CRhinoDirectoryManager::DirectoryFromFileName ( const wchar_t *  lpsFileName,
ON_wString dir 
)

Description: Extract directory name from complete file name. Parameters: lpsFileName [in] - File name to parse. dir [out] - Will contain directory name. Returns: Returns TRUE lpsFileName is not NULL, empty and is a full path.

◆ Entry()

const wchar_t* CRhinoDirectoryManager::Entry ( FileTypes  )
protected

◆ GetDefaultDirectory()

BOOL32 CRhinoDirectoryManager::GetDefaultDirectory ( FileTypes  ft,
ON_wString result 
)

Description: Get default directory for various file I/O operations Parameters: ft [in] - File operation result [out] - Receives default directory name Returns: Returns TRUE if ft is valid otherwise returns FALSE.

◆ Initialize()

void CRhinoDirectoryManager::Initialize ( )
protected

◆ InsertSearchPath()

BOOL32 CRhinoDirectoryManager::InsertSearchPath ( int  i,
const wchar_t *  lps 
)

Description: Insert directory to into search path Parameters: i [in] - Position in list to insert new directory. lps [in] - Directory to add. Returns: TRUE if index in range and lps points to a valid directory.

◆ Key()

const wchar_t* CRhinoDirectoryManager::Key ( )
protected

◆ LoadProfile()

void CRhinoDirectoryManager::LoadProfile ( CRhinoProfileContext PC)

◆ Save()

void CRhinoDirectoryManager::Save ( )
protected

Should only be called once by CRhinoApp::ExitInstance()

◆ SaveProfile()

void CRhinoDirectoryManager::SaveProfile ( CRhinoProfileContext PC)

◆ SearchPath()

const wchar_t* CRhinoDirectoryManager::SearchPath ( int  i) const

Description: Iterate user directories CRhinoFileUtilities::FindFile will look in. Parameters: i [in] - Directory index Returns: NULL if index is out of range otherwise full path to folder

◆ SearchPathCount()

int CRhinoDirectoryManager::SearchPathCount ( ) const

Description: Number of user directories CRhinoFileUtilities::FindFile will look in. Returns: Returns number of user folders CRhinoFileUtilities::FindFile will search when looking for files.

◆ SearchPathCountEntry()

const wchar_t* CRhinoDirectoryManager::SearchPathCountEntry ( ) const

Description: Returns entry which can be used with RhinoApp().m_PC reading and writing functions. Returns: Entry which can be used with RhinoApp().m_PC reading and writing functions to get the number of custom search paths saved.

◆ SearchPathEntryPrefix()

const wchar_t* CRhinoDirectoryManager::SearchPathEntryPrefix ( ) const

Description: Returns entry which can be used with RhinoApp().m_PC reading and writing functions. Returns: Entry which can be used with RhinoApp().m_PC reading and writing functions to get enumerate custom search path registry entries. The first entry will be SearchPathEntryPrefix() + L"00" up to count - 1;

◆ SearchPathKey()

const wchar_t* CRhinoDirectoryManager::SearchPathKey ( ) const

Description: Returns key which can be used with RhinoApp().m_PC reading and writing functions. Returns: Key which can be used with RhinoApp().m_PC reading and writing functions.

◆ SetDefaultDirectory()

BOOL32 CRhinoDirectoryManager::SetDefaultDirectory ( FileTypes  ft,
const wchar_t *  lpsDirectory 
)

Description: Set default directory for various file I/O operations Parameters: ft [in] - File operation lpsDirectory [in] - New default directory for specified file operations Returns: Returns TRUE ft is valid and something placed in result.

◆ SetDefaultDirectoryFromFileName()

BOOL32 CRhinoDirectoryManager::SetDefaultDirectoryFromFileName ( FileTypes  ft,
const wchar_t *  lpsFileName 
)

Description: Set default directory for various file I/O operations. Parameters: ft [in] - File operation lpsFileName [in] - MUST be a fully qualified path. Strips file name from end and calls SetDefaultDirectory Returns: Returns TRUE ft is valid and lpsFileName is not NULL or an empty string.

◆ SetWorkingDirectory()

void CRhinoDirectoryManager::SetWorkingDirectory ( const wchar_t *  lpsDirectory)

Description: Sets all file operations to the same default folder Parameters: lpsDirectory [in] - New default directory for all file operations

Friends And Related Function Documentation

◆ CRhinoApp

friend class CRhinoApp
friend

Member Data Documentation

◆ m_dir_list

ON_wString CRhinoDirectoryManager::m_dir_list[ftCount]
protected

◆ m_search_path

ON_ClassArray<ON_wString> CRhinoDirectoryManager::m_search_path
protected