Humble Framework for SkyOS


Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

HFilename Class Reference
[System]

#include <HFile.h>

Inheritance diagram for HFilename:

HString HObj

Public Member Functions

 HFilename (StringPtr pstr=NULL)
bool Select (StringPtr pstrTitle, uint32 uFlags, sSelectFileTypes *pFileTypes=NULL)
 Lets the user select the filename.
ErrCode GetDir (HString &strDir, bool bWantSlash=false) const
 Returns the directory portion of the file name.
ErrCode SetDir (StringPtr pstrDir)
 Sets the directory without changing the file or the extension.
ErrCode GetExt (HString &strExt, bool bWantDot=false) const
 Returns the file's extension.
ErrCode SetExt (StringPtr pstrExt)
 Sets the directory without changing the file or the extension.
ErrCode GetName (HString &strName) const
 Returns the file's name.
StringPtr GetPath (void) const
 Returns the file's name.
bool IsValid (void) const
 Returns true if the current filename is valid.
HFilenameoperator= (StringPtr pstr)

Protected Member Functions

void build (StringPtr pstrDir, StringPtr pstrFile, StringPtr pstrExt)
 Create a fully-qualified filename (FQF) given a path and file name.
void cleanUp (void)
 Sets all the slashes to the desired type.
void split (TextPtr pstrDir, TextPtr pstrName, TextPtr pstrExt)
 Splits a fully-qualified filespec (FQF) into it's component parts.

Friends

class HFile

Member Function Documentation

bool HFilename::Select StringPtr  pstrTitle,
uint32  uFlags,
sSelectFileTypes *  pFileTypes = NULL
 

This method allos the user to select a file from the OS using the generic "File Open" dialog.

Returns:
true if a file selected, false otherwise
Parameters:
pstrTitle String to display in dialog box caption
uFlags SELECTFILE_* flags
pFileTypes [optional] Array of file types to open

Definition at line 58 of file HFile.h.

void HFilename::build StringPtr  pstrDir,
StringPtr  pstrFile,
StringPtr  pstrExt
[protected]
 

Parameters:
pstrDir Path
pstrFile Filename
pstrExt Extension

Definition at line 93 of file HFile.h.

void HFilename::cleanUp void   )  [protected]
 

This method scans the string looking for improper slashes and corrects them. It also removes all leading and trailing whitespace.

Definition at line 140 of file HFile.h.

void HFilename::split TextPtr  pstrDir,
TextPtr  pstrName,
TextPtr  pstrExt
[protected]
 

Parameters:
pstrDir [optional] Ptr to directory
pstrName [optional] Ptr to name
pstrExt [optional] Ptr to extension (including the '.')

Definition at line 153 of file HFile.h.

ErrCode HFilename::GetDir HString strDir,
bool  bWantSlash = false
const
 

This method returns a string containing the directory portion of the FQF, or an empty string if no directory is present. For example, if the FQF is "/boot/home/humble/projects/humble.mak", then GetDir() will return "/boot/home/humble/projects" or "/boot/home/humble/projects/" if bWantSlash is true.

Returns:
NO_ERROR on success, error code otherwise
Parameters:
[out] strDir String containing just the directory
bWantSlash True to include the final '/' in the result

Definition at line 199 of file HFile.h.

ErrCode HFilename::SetDir StringPtr  pstrDir  ) 
 

Returns:
NO_ERROR on success, error code otherwise
Parameters:
pstrDir Desired directory path (or NULL for root)

Definition at line 224 of file HFile.h.

ErrCode HFilename::GetExt HString strExt,
bool  bWantDot = false
const
 

This method returns a string pointer to the file's extension--not including the dot--or to an empty string if no dot is present.

Returns:
NO_ERROR on success, error code otherwise
Parameters:
[out] strExt String containing just the extension
bWantDot True to include the '.' in the result

Definition at line 249 of file HFile.h.

ErrCode HFilename::SetExt StringPtr  pstrExt  ) 
 

Returns:
NO_ERROR on success, error code otherwise
Parameters:
pstrExt Desired extension (or NULL for no extension)

Definition at line 274 of file HFile.h.

ErrCode HFilename::GetName HString strName  )  const
 

This method returns a string pointer to the file's name--including the extension--or to an empty string if no identifiable file name is present. For example, if the file name is

Returns:
Always NO_ERROR
Parameters:
[out] strName String containing just the name and extension

Definition at line 306 of file HFile.h.

StringPtr HFilename::GetPath void   )  const
 

This method returns a string pointer to the file's full path, or to an empty string.

Returns:
Ptr to file path, or empty string

Definition at line 326 of file HFile.h.

bool HFilename::IsValid void   )  const
 

Returns:
True if valid filename, false otherwise

Definition at line 336 of file HFile.h.


The documentation for this class was generated from the following file:
 

2006.01.09-16:37