- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Exponent::Basics::CSystemString Class Reference

Inheritance diagram for Exponent::Basics::CSystemString:

List of all members.

## Detailed Description

Path handling string class.

Stores a string and provides path handling functionality on that string

Date:
  21/08/2004

Author:
  Paul Chana

Version:
  1.0.0 Initial version

  1.0.1 Fixed bug in the = operator that would turn your string to mush because the string equality was not checking if passed object was this

  1.0.2 Added removeLastPathComponent function

  1.0.3 Added removeFirstPathComponent function

Note:
  All contents of this source code are copyright 2005 Exp Digital Uk.
  This source file is covered by the licence conditions of the Infinity API. You should have recieved a copy
  with the source code. If you didnt, please refer to http://www.expdigital.co.uk All content is the Intellectual property of Exp Digital Uk.
  Certain sections of this code may come from other sources. They are credited where applicable.
  If you have comments, suggestions or bug reports please visit http://support.expdigital.co.uk

Id
  CSystemString.hpp,v 1.4 2007/02/08 21:06:44 paul Exp

Definition at line 40 of file CSystemString.hpp.

## Public Member Functions

- virtual void appendNewExtension (const CString &ext, const bool removeOld=true)
- virtual void appendNewExtension (const char *ext, const bool removeOld=true)
- virtual void appendPath (const CString &path)
- virtual void appendSystemSeperator ()
- CSystemString (const CSystemString &string)
- CSystemString (const CString &string)
- CSystemString (const char *string=" ")
- virtual CString getDriveLetter (bool withDriveSeperators=true)
- virtual CString getFolderPath ()
- virtual long getNumberOfPathComponents ()
- virtual CString * getPathComponent (const long index)
- virtual CString getTheExtension ()
- virtual CString getTheFilename () const
- virtual bool hasExtension (const CString &ext) const
- virtual bool hasExtension (const char *ext) const
- virtual bool hasExtension () const
- virtual bool isFolder () const
- virtual bool operator! ()
- virtual bool operator!= (CSystemString &string)
- virtual bool operator!= (const char *string)
- virtual CSystemString & operator+= (const char *string)
- virtual CSystemString & operator+= (const CString &string)
- virtual CSystemString & operator= (const char *string)
- virtual CSystemString & operator= (const CSystemString &string)
- virtual bool operator== (CSystemString &string)
- virtual bool operator== (const char *equals)
- virtual char operator[] (const long index)
- virtual void removeExtension ()
- virtual void removeFirstPathComponent ()
- virtual void removeLastPathComponent ()
- virtual void replacePathSeperators ()
- virtual void stripFilename ()
- virtual ~CSystemString ()

## Static Public Attributes

- static const long CSYSTEM_STRING_MAX_PATH = _MAX_PATH
- static const char * CSYSTEM_STRING_SYSTEM_SEPERATOR

## Constructor & Destructor Documentation

Exponent::Basics::CSystemString::CSystemString | ( | const char * | string = `" "` | ) |

Construction

Parameters:

  | string | The string to store

Exponent::Basics::CSystemString::CSystemString | ( | const CString & | string | ) |

Construction

Parameters:

  | string | The string to store

Exponent::Basics::CSystemString::CSystemString | ( | const CSystemString & | string | ) |

Copy Construction

Parameters:

  | string | The string to store

virtual Exponent::Basics::CSystemString::~CSystemString | ( |  | ) | `[virtual]`

Destructor

## Member Function Documentation

virtual void Exponent::Basics::CSystemString::appendNewExtension | ( | const CString & | ext,
|  | const bool | removeOld = `true` |
| ) |  |  | `[virtual]`

Append a new extension

Parameters:

  | ext | The extension to append. Doesnt require a leading '.'
  | removeOld | If true the old extension (if one exists) is remove, if false new extension is simply appended

virtual void Exponent::Basics::CSystemString::appendNewExtension | ( | const char * | ext,
|  | const bool | removeOld = `true` |
| ) |  |  | `[virtual]`

Append a new extension

Parameters:

  | ext | The extension to append. Doesnt require a leading '.'
  | removeOld | If true the old extension (if one exists) is remove, if false new extension is simply appended

virtual void Exponent::Basics::CSystemString::appendPath | ( | const CString & | path | ) | `[virtual]`

Append a path string - before appending, appends a path seperator

Parameters:

  | path | The stirng to append to the end of the path

virtual void Exponent::Basics::CSystemString::appendSystemSeperator | ( |  | ) | `[virtual]`

Append a new system seperator (\ or / depending on OS)

virtual CString Exponent::Basics::CSystemString::getDriveLetter | ( | bool | withDriveSeperators = `true` | ) | `[virtual]`

Get the drive letter of the string (on mac volume name)

Parameters:

  | withDriveSeperators | If true includes ":\\" (PC) or "/" (Mac), if false doesnt include them

Return values:

  | CString | The drive letter

virtual CString Exponent::Basics::CSystemString::getFolderPath | ( |  | ) | `[virtual]`

Get the folder part of the path

Return values:

  | CString | The folder part of the path.

virtual long Exponent::Basics::CSystemString::getNumberOfPathComponents | ( |  | ) | `[virtual]`

Get the number of path components

Return values:

  | long | The number of path components

virtual CString* Exponent::Basics::CSystemString::getPathComponent | ( | const long | index | ) | `[virtual]`

Get a specific path component

Parameters:

  | index | The index of the path component

Return values:

  | CString* | The path component. You are responsible for deleting the returned memory

virtual CString Exponent::Basics::CSystemString::getTheExtension | ( |  | ) | `[virtual]`

Get the extension

Return values:

  | CString | The extension, up to you to delete memory returned

virtual CString Exponent::Basics::CSystemString::getTheFilename | ( |  | ) | const`[virtual]`

Get the filename

Return values:

  | CString | The filename, up to you to delete memory returned

virtual bool Exponent::Basics::CSystemString::hasExtension | ( | const CString & | ext | ) | const`[virtual]`

Does the path have this extension

Parameters:

  | ext | The extension to check for

Return values:

  | bool | True if string has matching extension, false otherwise

virtual bool Exponent::Basics::CSystemString::hasExtension | ( | const char * | ext | ) | const`[virtual]`

Does the path have this extension

Parameters:

  | ext | The extension to check for

Return values:

  | bool | True if string has matching extension, false otherwise

virtual bool Exponent::Basics::CSystemString::hasExtension | ( |  | ) | const`[virtual]`

Does the path have an extension

Return values:

  | bool | True if path has extension, false otherwise

virtual bool Exponent::Basics::CSystemString::isFolder | ( |  | ) | const`[virtual]`

Is this a folder

Return values:

  | bool | True if path is to a folder, false otherwise

virtual bool Exponent::Basics::CSystemString::operator! | ( |  | ) | `[virtual]`

Check if the string is empty

Return values:

  | bool | True if number of characters is == 0, false otherwise

virtual bool Exponent::Basics::CSystemString::operator!= | ( | CSystemString & | string | ) | `[virtual]`

InEquality operator

Parameters:

  | string | the string to compare to

Return values:

  | bool | True if strings are inequal, false otherwise

virtual bool Exponent::Basics::CSystemString::operator!= | ( | const char * | string | ) | `[virtual]`

InEquality operator

Parameters:

  | string | the string to compare to

Return values:

  | bool | True if strings are inequal, false otherwise

virtual CSystemString& Exponent::Basics::CSystemString::operator+= | ( | const char * | string | ) | `[virtual]`

Concatenation operator

Parameters:

  | string | The string to append to the end of this

Return values:

  | CSystemString& | A reference to this

Reimplemented from Exponent::Basics::CString.

virtual CSystemString& Exponent::Basics::CSystemString::operator+= | ( | const CString & | string | ) | `[virtual]`

Concatenation operator

Parameters:

  | string | The string to append to the end of this

Return values:

  | CSystemString& | A reference to this

Reimplemented from Exponent::Basics::CString.

virtual CSystemString& Exponent::Basics::CSystemString::operator= | ( | const char * | string | ) | `[virtual]`

Assignment operator

Parameters:

  | string | The string to copy

Return values:

  | CSystemString& | A reference to this

Reimplemented from Exponent::Basics::CString.

virtual CSystemString& Exponent::Basics::CSystemString::operator= | ( | const CSystemString & | string | ) | `[virtual]`

Assignment operator

Parameters:

  | string | The string to copy

Return values:

  | CSystemString& | A reference to this

virtual bool Exponent::Basics::CSystemString::operator== | ( | CSystemString & | string | ) | `[virtual]`

Equality operator

Parameters:

  | string | the string to compare to

Return values:

  | bool | True if strings are equal, false otherwise

virtual bool Exponent::Basics::CSystemString::operator== | ( | const char * | equals | ) | `[virtual]`

Equality operator

Parameters:

  | equals | the string to compare to

Return values:

  | bool | True if strings are equal, false otherwise

virtual char Exponent::Basics::CSystemString::operator[] | ( | const long | index | ) | `[virtual]`

Subscript operator

Parameters:

  | index | The index of the character you require

Return values:

  | char | The character at the specified index

virtual void Exponent::Basics::CSystemString::removeExtension | ( |  | ) | `[virtual]`

Remove the extension from the string

virtual void Exponent::Basics::CSystemString::removeFirstPathComponent | ( |  | ) | `[virtual]`

Remove the first path component

virtual void Exponent::Basics::CSystemString::removeLastPathComponent | ( |  | ) | `[virtual]`

Remove the last path component

virtual void Exponent::Basics::CSystemString::replacePathSeperators | ( |  | ) | `[virtual]`

Replace all path seperators with the correct format for the current OS

virtual void Exponent::Basics::CSystemString::stripFilename | ( |  | ) | `[virtual]`

Strip the filename from the string

## Member Data Documentation

const long Exponent::Basics::CSystemString::CSYSTEM_STRING_MAX_PATH = _MAX_PATH`[static]`

Maximum path length

Definition at line 53 of file CSystemString.hpp.

const char* Exponent::Basics::CSystemString::CSYSTEM_STRING_SYSTEM_SEPERATOR`[static]`

System specific path seperator

Definition at line 52 of file CSystemString.hpp.