#include <rurl.h>
|
enum | Type { File,
Directory,
Auto
} |
|
Relative name of a file or directory.
Definition at line 16 of file rurl.h.
◆ Name()
Relative::Name::Name |
( |
const TQString & |
rurl, |
|
|
const Type |
type = Auto |
|
) |
| |
Constructor takes the relative name of a directory or file.
Leading slash in the name will be deleted. If type is Auto names like: name/name/ are directories name/name are files. Trailing slash will be deleted for files (type == File).
Definition at line 10 of file rurl.cpp.
◆ addPath()
void Relative::Name::addPath |
( |
const TQString & |
addendum | ) |
|
Adds addendum to the directory path.
This honors file names so if RName represents /dir1/dir2/fname.ext addPath(dir3) will change RName to /dir1/dir2/dir3/fname.ext
Definition at line 80 of file rurl.cpp.
◆ cleanName()
TQString Relative::Name::cleanName |
( |
const TQString & |
rurl | ) |
|
|
static |
Cleans rurl by removing extra slashes.
Definition at line 91 of file rurl.cpp.
◆ cleanRURL()
void Relative::Name::cleanRURL |
( |
| ) |
|
Removes "//" from the name.
Definition at line 86 of file rurl.cpp.
◆ correct()
void Relative::Name::correct |
( |
| ) |
|
|
protected |
Corrects m_rurl and m_type according to the relative name storing policy, i.e.
removes leading slash, removes trailing slash for files, changes type to be either File or Directory, but not Auto. Also cleans url (see cleanRURL).
Definition at line 22 of file rurl.cpp.
◆ correctName()
TQString Relative::Name::correctName |
( |
const TQString & |
rurl, |
|
|
const Type |
type = Auto |
|
) |
| |
|
static |
Corrects rurl according to the given type and returns corrected url.
Also cleans url (see cleanRURL).
Definition at line 46 of file rurl.cpp.
◆ directory()
TQString Relative::Name::directory |
( |
| ) |
const |
Returns the name of the directory or TQString() if there are no dirs in path.
Definition at line 130 of file rurl.cpp.
◆ extension()
TQString Relative::Name::extension |
( |
bool |
complete = true | ) |
const |
Returns the extension of a file or TQString() for directories.
If complete is true then returns extensions like "tar.gz". Else returns "gz".
Definition at line 110 of file rurl.cpp.
◆ fileName()
TQString Relative::Name::fileName |
( |
| ) |
const |
Returns the name of the file without the path or TQString() for directories.
Definition at line 123 of file rurl.cpp.
◆ isDirectory()
bool Relative::Name::isDirectory |
( |
| ) |
const |
Returns true if the type of RName is directory.
Definition at line 143 of file rurl.cpp.
◆ isFile()
bool Relative::Name::isFile |
( |
| ) |
const |
Returns true if the type of RName is file.
Definition at line 138 of file rurl.cpp.
◆ isValid()
bool Relative::Name::isValid |
( |
| ) |
const |
Checks if RName is valid.
Definition at line 158 of file rurl.cpp.
◆ relativeName()
Name Relative::Name::relativeName |
( |
const TQString & |
base, |
|
|
const TQString & |
url |
|
) |
| |
|
static |
Creates and returns relative name between base and url.
Base and url should be absolute. Base is considered to be a directory.
Definition at line 184 of file rurl.cpp.
◆ rurl()
TQString Relative::Name::rurl |
( |
| ) |
const |
Gets the relative name in form dir/dir/ -> directory or dir/dir/file -> file.
Definition at line 75 of file rurl.cpp.
◆ setRURL()
void Relative::Name::setRURL |
( |
const TQString & |
rurl, |
|
|
const Type |
type |
|
) |
| |
Sets the relative name.
Definition at line 68 of file rurl.cpp.
◆ setType()
void Relative::Name::setType |
( |
const Type |
type | ) |
|
Sets a type of the relative name - file or directory.
If Auto is passed, nothing happens.
Definition at line 179 of file rurl.cpp.
◆ type()
Name::Type Relative::Name::type |
( |
| ) |
const |
Returns a type of the relative name - file or directory.
Definition at line 174 of file rurl.cpp.
The documentation for this class was generated from the following files: