Added appendComponent() and getComponentAt() functions.

This commit is contained in:
Vincent Richard 2004-12-17 23:02:37 +00:00
parent 90b9650ede
commit 1d44fdfab5
2 changed files with 38 additions and 0 deletions

View File

@ -192,5 +192,23 @@ const bool path::isDirectParentOf(const path& p) const
}
void path::appendComponent(const path::component& c)
{
m_list.push_back(c);
}
const path::component& path::getComponentAt(const int pos) const
{
return (m_list[pos]);
}
path::component& path::getComponentAt(const int pos)
{
return (m_list[pos]);
}
} // utility
} // vmime

View File

@ -65,6 +65,26 @@ public:
const bool operator==(const path& p) const;
const bool operator!=(const path& p) const;
/** Append a component to the path.
*
* @param c component to add
*/
void appendComponent(const component& c);
/** Return the component at the specified position.
*
* @param pos position
* @return component at position 'pos'
*/
const component& getComponentAt(const int pos) const;
/** Return the component at the specified position.
*
* @param pos position
* @return component at position 'pos'
*/
component& getComponentAt(const int pos);
/** Test whether this path is empty (root).
*
* @return true if the path is empty (no components = root)