Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

MutableFilePath Class Reference

Inheritance diagram for MutableFilePath:

FilePath List of all members.

Public Member Functions

 this ()
 this (FilePath other)
 this (char[] name)
MutableFilePath setExt (char[] ext)
MutableFilePath setName (char[] name)
MutableFilePath setPath (char[] path)
MutableFilePath setRoot (char[] root)
MutableFilePath setSuffix (char[] suffix)

Private Member Functions

final MutableFilePath set (char[]*x, char[]*v)
 this (Uri uri)
void reset ()
bool isAbsolute ()
char[] getRoot ()
char[] getPath ()
char[] getName ()
char[] getExtension ()
char[] getSuffix ()
char[] toString ()
void write (IWriter write)
IBuffer write (IBuffer buf)
MutableUri toUri ()
char[] toUtf8 ()
wchar[] toUtf16 ()
char[] splice (FilePath base)
IBuffer splice (FilePath base, IBuffer buf)
FilePath toParent ()
bool isChild ()
FilePath toSibling (char[] name)
FilePath toSibling (char[] name, char[] ext)
FilePath toSibling (char[] name, char[] ext, char[] suffix)

Static Private Member Functions

static char[] normalize (inout char[] path)

Detailed Description

Mutable version of FilePath, which allows one to change individual attributes. A change to any attribute will cause method toString() to rebuild the output.

Definition at line 609 of file FilePath.d.


Member Function Documentation

this  )  [inline]
 

Create an empty MutableFilePath

Reimplemented from FilePath.

Definition at line 617 of file FilePath.d.

this FilePath  other  )  [inline]
 

Create a MutableFilePath through reference to another.

Reimplemented from FilePath.

Definition at line 627 of file FilePath.d.

this char[]  name  )  [inline]
 

Create a MutableFilePath via a filename.

Reimplemented from FilePath.

Definition at line 638 of file FilePath.d.

final MutableFilePath set char *[]  x,
char *[]  v
[inline, private]
 

Set the extension of this FilePath.

Definition at line 649 of file FilePath.d.

MutableFilePath setExt char[]  ext  )  [inline]
 

Set the extension of this FilePath.

Definition at line 662 of file FilePath.d.

MutableFilePath setName char[]  name  )  [inline]
 

Set the name of this FilePath.

Definition at line 673 of file FilePath.d.

MutableFilePath setPath char[]  path  )  [inline]
 

Set the path of this FilePath.

Definition at line 684 of file FilePath.d.

MutableFilePath setRoot char[]  root  )  [inline]
 

Set the root of this FilePath (such as "c:")

Definition at line 695 of file FilePath.d.

MutableFilePath setSuffix char[]  suffix  )  [inline]
 

Set the suffix of this FilePath.

Definition at line 706 of file FilePath.d.

this Uri  uri  )  [inline, inherited]
 

Definition at line 119 of file FilePath.d.

References FilePath::path.

static char [] normalize inout char[]  path  )  [inline, static, inherited]
 

Convert path separators to the correct format. This mutates the provided 'path' content, so .dup it as necessary.

Definition at line 224 of file FilePath.d.

References version.

void reset  )  [inline, inherited]
 

Definition at line 245 of file FilePath.d.

Referenced by FilePath::toParent(), FilePath::toSibling(), and FilePath::toUtf8().

bool isAbsolute  )  [inline, inherited]
 

Returns true if this FilePath is *not* relative to the current working directory.

Definition at line 258 of file FilePath.d.

References FilePath::path, and FilePath::root.

Referenced by FilePath::toUri().

char [] getRoot  )  [inline, inherited]
 

Return the root of this path. Roots are constructs such as "c:".

Definition at line 272 of file FilePath.d.

References FilePath::root.

char [] getPath  )  [inline, inherited]
 

Return the file path. Paths start with a '/' but do not end with one. The root path is empty. Directory paths are split such that the directory name is placed into the 'name' member.

Definition at line 286 of file FilePath.d.

References FilePath::path.

char [] getName  )  [inline, inherited]
 

Return the name of this file, or directory.

Definition at line 297 of file FilePath.d.

Referenced by FileScan::simpleFilter(), and testScanFiles().

char [] getExtension  )  [inline, inherited]
 

Return the file-extension, sans seperator

Definition at line 308 of file FilePath.d.

Referenced by ServletResponse::copyFile(), FileScan::simpleFilter(), and testScanFiles().

char [] getSuffix  )  [inline, inherited]
 

Suffix is like extension, except it can include multiple '.' sequences. For example, "wumpus1.foo.bar" has suffix "foo.bar" and extension "bar".

Definition at line 321 of file FilePath.d.

References FilePath::suffix.

char [] toString  )  [inline, inherited]
 

Convert this FilePath to a char[]. This is expected to execute optimally in most cases.

Definition at line 333 of file FilePath.d.

References Buffer, FilePath::fp, FilePath::MaxFilePathSize, and FilePath::write().

Referenced by FileBucket::Record::eof(), FileConduit::getName(), FileProxy::toString(), and FilePath::toUtf16().

void write IWriter  write  )  [inline, inherited]
 

Write this FilePath to the given IWriter. This makes the FilePath compatible with all Writers. Note that we could leverage the write(IBuffer) method here, but that would bypass any special character converters attached to the IWriter.

Reimplemented from IWritable.

Definition at line 361 of file FilePath.d.

References FilePath::name, FilePath::path, and FilePath::root.

Referenced by FilePath::splice(), and FilePath::toString().

IBuffer write IBuffer  buf  )  [inline, inherited]
 

Convert this FilePath to a char[] in the provided buffer

Definition at line 382 of file FilePath.d.

MutableUri toUri  )  [inline, inherited]
 

Definition at line 407 of file FilePath.d.

References FilePath::isAbsolute(), FilePath::name, FilePath::path, FilePath::root, MutableUri::setHost(), MutableUri::setPath(), MutableUri::setScheme(), and version.

Referenced by testFilePath().

char [] toUtf8  )  [inline, inherited]
 

Return a zero terminated version of this file path. Note that the compiler places a zero at the end of each static string, as does the allocator for char[] requests.

In typical usage, this will not need to duplicate the path

Definition at line 438 of file FilePath.d.

References FilePath::fp, and FilePath::reset().

Referenced by FileProxy::VersionPosix::createDirectory(), FileProxy::VersionWin32::createDirectory(), FileProxy::VersionPosix::createFile(), FileProxy::VersionWin32::createFile(), FileProxy::VersionPosix::getInfo(), FileProxy::VersionWin32::getInfo(), FileConduit::VersionPosix::open(), FileConduit::VersionWin32::open(), FileProxy::VersionPosix::remove(), FileProxy::VersionWin32::remove(), FileSystem::VersionPosix::setDirectory(), FileSystem::VersionWin32::setDirectory(), FileProxy::VersionPosix::toList(), and FileProxy::VersionWin32::toList().

wchar [] toUtf16  )  [inline, inherited]
 

Definition at line 453 of file FilePath.d.

References FilePath::toString().

Referenced by FileProxy::VersionWin32::createDirectory(), FileProxy::VersionWin32::createFile(), FileProxy::VersionWin32::getInfo(), FileConduit::VersionWin32::open(), FileProxy::VersionWin32::remove(), FileSystem::VersionWin32::setDirectory(), and FileProxy::VersionWin32::toList().

char [] splice FilePath  base  )  [inline, inherited]
 

Splice this FilePath onto the end of the provided base path. Output is return as a char[].

Definition at line 470 of file FilePath.d.

References Buffer, FilePath::MaxFilePathSize, and Uri::toString().

IBuffer splice FilePath  base,
IBuffer  buf
[inline, inherited]
 

Splice this FilePath onto the end of the provided base path. Output is placed into the provided IBuffer.

Definition at line 482 of file FilePath.d.

References IBuffer::append(), IBuffer::getLimit(), FilePath::name, FilePath::path, and FilePath::write().

FilePath toParent  )  [inline, inherited]
 

Returns a FilePath representing the parent of this one. An exception is thrown if there is not parent (at the root).

Definition at line 527 of file FilePath.d.

References FilePath, FilePath::locateParent(), FilePath::path, and FilePath::reset().

bool isChild  )  [inline, inherited]
 

Returns true if this FilePath has a parent.

Definition at line 552 of file FilePath.d.

FilePath toSibling char[]  name  )  [inline, inherited]
 

Return a cloned FilePath with a different name.

Definition at line 563 of file FilePath.d.

Referenced by FilePath::toSibling().

FilePath toSibling char[]  name,
char[]  ext
[inline, inherited]
 

Return a cloned FilePath with a different name and extension. Note that the suffix is destroyed.

Definition at line 575 of file FilePath.d.

References FilePath::suffix, and FilePath::toSibling().

FilePath toSibling char[]  name,
char[]  ext,
char[]  suffix
[inline, inherited]
 

Return a cloned FilePath with a different name, extension, and suffix.

Definition at line 587 of file FilePath.d.

References FilePath::ext, FilePath, FilePath::name, FilePath::reset(), and FilePath::suffix.


The documentation for this class was generated from the following file:
Generated on Fri Nov 11 18:44:40 2005 for Mango by  doxygen 1.4.0