ICompoundName

ICompoundName represents paths for files, network resources, and other named objects.


ICompoundName - Member Functions and Data by Group

Constructors & Destructor

Construct and destruct compound name objects.


[view class]
~ICompoundName
Destructor.
public:
virtual ~ICompoundName()
Delete the object.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
ICompoundName
Construct a new ICompoundName object.


Overload 1
Constructor.
public:
ICompoundName( const IText& path, const ICompoundNameParser& parser )
This function uses the specified parser to construct a compound name from the specified text.

path
The text from which to construct the compound name.
parser
The parser to use to construct the compound name from the text.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
Empty constructor.
public:
ICompoundName()

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 3
Copy constructor.
public:
ICompoundName(const ICompoundName& copyMe)
This function constructs a copy of the given object.

copyMe
The object to copy.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
operator =
Assignment operator.
public:
ICompoundName& operator =(const ICompoundName& copyMe)
Copy the given object to another ICompoundName object.

copyMe
The object to copy.

Return
A reference to this object.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Accessing Path Components

These methods allow you to access individual path components.


[view class]
componentAt
Get specified component.
public:
virtual IText componentAt(unsigned long index) const
Get the component at the given index of the path. The first component is at index==1.

index
The index of the component to return. The first component is at index == 1.

Return
An IText object with the component text in it.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
lastComponent
Get last component.
public:
virtual IText lastComponent() const
Get the last component of the path.

Return
An IText object with the text of the last component.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
numberOfComponents
Get number of components.
public:
virtual unsigned long numberOfComponents() const
Get the number of components in the path.

Return
An unsigned long with the number of components.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Comparing and Querying

These methods compare compound names and query information about them.


[view class]
hash
Hash.
public:
virtual long hash() const
Get the hash value.

Return
A long value with the hash in it.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
isFullPath
Is full path.
public:
virtual bool isFullPath() const
Determine if this is a full path. This function returns true if the object is a full path, false if it's a relative path.

Return
A bool value that indicates whether this object represents a full path or not.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
operator !=
Inequality operator.
public:
virtual bool operator !=( const ICompoundName& anotherPath ) const
Test for inequality with the given object.

anotherPath
The object to test for inequality.

Return
A bool value that indicates whether the objects are equal or not.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
operator ==
Equality operator.
public:
virtual bool operator ==( const ICompoundName& anotherPath ) const
Test for equality with the given object.

anotherPath
The object to test for equality.

Return
A bool value that indicates whether the objects are equal or not.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setFullPath
Make full path.
public:
virtual void setFullPath(bool isFull)
Make this path a full path name.

isFull
The value indicating whether to make the object a full path (true) or not (false).

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Manipulating Paths

These methods allow you to add and remove name segments of a compound name.


[view class]
append
Append path.
public:
virtual void append(const ICompoundName& relativePath)
Append one path to another.

relativePath
The path to append.

Exception

IInvalidParameter is thrown if relativePath is a full path.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
appendComponent
Append component.
public:
virtual void appendComponent(const IText& componentPath)
Append a single component to the path.

componentPath
The component to append.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
factorCommonRoot
Remove common components.
public:
virtual void factorCommonRoot( const ICompoundName& anotherPath, ICompoundName& commonRoot, ICompoundName& rootToLeaf ) const
Remove the path name components common to two path names.

If two paths have common roots, as in /usr/include/sys/mode.h (in "this") and /usr/include/Foo.h (in "anotherPath"), this method finds the common part (in "commonRoot"), leaving (in "rootToLeaf"), sys/mode.h.

anotherPath
The path to compare against.
commonRoot
On output, specifies the components common to both paths.
rootToLeaf
On output, specifies the components of this path that were not common to the other path.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
truncate
Remove components from the end of this path.


Overload 1
Truncate path.
public:
virtual void truncate(const ICompoundName& relativePath)
Removes the components of another path from the end of this path.

Truncate is similar to factorCommonRoot, but works from the "end" of the path, not the beginning. If "this" path is /usr/include/sys/mode.h, and "relativePath" is sys/mode.h, this member function will change "this" to be /usr/include.

relativePath
The path to remove from the end of this path.

Exception

IInvalidParameter is thrown if relativePath does not exist at the end of this path.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
Truncate path.
public:
virtual void truncate(unsigned long segmentsToRemove)
Remove the specified number of components from the end of this path.

segmentsToRemove
The number of components to remove.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Streaming

These methods support the streaming of compound name objects.


[view class]
readFromStream
Stream in.
public:
virtual void readFromStream(IDataStream& fromwhere)
Read the object from the given data stream.

fromwhere
From where to stream the data.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
writeToStream
Stream out.
public:
virtual void writeToStream(IDataStream& towhere) const
Write the object to the given data stream.

towhere
Where to stream the data.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


ICompoundName - Inherited Member Functions and Data

Inherited Public Functions

IMStreamable

Inherited Public Data

Inherited Protected Functions

IMStreamable

Inherited Protected Data