Public Member Functions | Static Public Attributes | Private Attributes

Burger::Filename Class Reference

#include <fmfile.h>

List of all members.

Public Member Functions

 Filename ()
 ~Filename ()
 Release any memory allocated.
BURGER_INLINE const char * GetPtr () const
BURGER_INLINE char * GetPtr ()
void Set (const char *pInput)
 Sets the pathname to the input string.
void Clear (void)
 Set the filename to an empty string.
void Expand (const char *pInput)
 Expand a filename by using prefix mapping.
void ToWindows (const char *pInput)
 Expand a filename into Windows/MSDOS format.
void FromWindows (const char *pInput)
void ToMacOSX (const char *pInput)
void FromMacOSX (const char *pInput)
void ToMac (const char *pInput)
void FromMac (const char *pInput, long lDirID, short sVRefNum)
BURGER_INLINE long GetDirID (void) const
BURGER_INLINE short GetVRefNum (void) const
BURGER_INLINE void SetDirID (long lDirID)
BURGER_INLINE void SetVRefNum (short sVRefNum)
BURGER_INLINE void FromNative (const char *pInput)
BURGER_INLINE void ToNative (const char *pInput)

Static Public Attributes

static const Word BUFFERSIZE = 512-(sizeof(char *)+sizeof(long)+sizeof(short))

Private Attributes

char * m_pFilename
 Pointer to the string.
long m_lDirID
 Directory reference used by MacOS.
short m_sVRefNum
 Volume reference used by copy and rename.
char m_Filename [BUFFERSIZE]
 Space for the string in most cases.

Constructor & Destructor Documentation

Burger::Filename::Filename (  )  [inline]
Burger::Filename::~Filename (  ) 

Release any memory allocated.

If in the course of setting a pathname to an excessive length, release any extra allocated memory. In most cases, this does nothing.


Member Function Documentation

void Burger::Filename::Clear ( void   ) 

Set the filename to an empty string.

If in the course of setting a pathname to an excessive length, release any extra allocated memory. In most cases, this simply resets the cached buffer to an empty string.

void Burger::Filename::Expand ( const char *  pInput  ) 

Expand a filename by using prefix mapping.

Using the rules for a Burgerlib type pathname, expand a path into a FULL pathname native to the Burgerlib file system.

Directory delimiters are colons only. If the path starts with a colon, then it is a full pathname starting with a volume name. If the path starts with ".D2:" then it is a full pathname starting with a drive number. If the path starts with a "$:","*:" or "@:" then use special prefix numbers 32-34 If the path starts with 0: through 31: then use prefix 0-31. Otherwise prepend the pathname with the contents of prefix 8 ("Default")

If the path after the prefix is removed is a period then POP the number of directories from the pathname for each period present after the first. Example "..:PrevDir:File:" will go down one directory and up the directory PrevDir

All returned pathnames will have a trailing colon

Parameters:
pInput Pointer to a pathname string
void Burger::Filename::FromMac ( const char *  pInput,
long  lDirID,
short  sVRefNum 
)
void Burger::Filename::FromMacOSX ( const char *  pInput  ) 
BURGER_INLINE void Burger::Filename::FromNative ( const char *  pInput  )  [inline]
void Burger::Filename::FromWindows ( const char *  pInput  ) 
BURGER_INLINE long Burger::Filename::GetDirID ( void   )  const [inline]
BURGER_INLINE char* Burger::Filename::GetPtr ( void   )  [inline]
BURGER_INLINE const char* Burger::Filename::GetPtr ( void   )  const [inline]
BURGER_INLINE short Burger::Filename::GetVRefNum ( void   )  const [inline]
void Burger::Filename::Set ( const char *  pInput  ) 

Sets the pathname to the input string.

Given a string passed by pInput, set the contained string to match. In a majority of cases, no memory is allocated. If in the rare case the string is of a large length, allocate a buffer and store the string inside.

Parameters:
pInput Pointer to a valid "C" string or NULL to force the class to empty.
BURGER_INLINE void Burger::Filename::SetDirID ( long  lDirID  )  [inline]
BURGER_INLINE void Burger::Filename::SetVRefNum ( short  sVRefNum  )  [inline]
void Burger::Filename::ToMac ( const char *  pInput  ) 
void Burger::Filename::ToMacOSX ( const char *  pInput  ) 
BURGER_INLINE void Burger::Filename::ToNative ( const char *  pInput  )  [inline]
void Burger::Filename::ToWindows ( const char *  pInput  ) 

Expand a filename into Windows/MSDOS format.

Using the rules for a Burgerlib type pathname, expand a path into a FULL pathname native to the Windows/MSDOS file system.

Directory delimiters are colons only. If the path starts with a colon, then it is a full pathname starting with a volume name. If the path starts with ".Dxx:" then it is a full pathname starting with a drive number. If the path starts with a "$:","*:" or "@:" then use special prefix numbers 32-34 If the path starts with 0: through 31: then use prefix 0-31. Otherwise prepend the pathname with the contents of prefix 8 ("Default")

If the path after the prefix is removed is a period then POP the number of directories from the pathname for each period present after the first. Example "..:PrevDir:File:" will go down one directory and up the directory PrevDir

All returned pathnames will NOT have a trailing "\", they will take the form of c:.txt or similar

Parameters:
pInput Pointer to a pathname string

Member Data Documentation

const Word Burger::Filename::BUFFERSIZE = 512-(sizeof(char *)+sizeof(long)+sizeof(short)) [static]

Space for the string in most cases.

Directory reference used by MacOS.

Pointer to the string.

Volume reference used by copy and rename.