• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • KDevelop Utility Library
 

KDevelop Utility Library

  • Relative
  • Name
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Relative::Name Class Reference

#include <rurl.h>

Inheritance diagram for Relative::Name:
Relative::URL Relative::Directory Relative::File

Public Types

enum  Type { File, Directory, Auto }
 

Public Member Functions

 Name (const TQString &rurl, const Type type=Auto)
 
 Name (const char *rurl, const Type type=Auto)
 
void setRURL (const TQString &rurl, const Type type)
 
TQString rurl () const
 
void addPath (const TQString &addendum)
 
void cleanRURL ()
 
TQString extension (bool complete=true) const
 
TQString fileName () const
 
TQString directory () const
 
bool isFile () const
 
bool isDirectory () const
 
bool isValid () const
 
Type type () const
 
void setType (const Type type)
 
bool operator== (const Name &rname)
 
bool operator!= (const Name &rname)
 

Static Public Member Functions

static Name relativeName (const TQString &base, const TQString &url)
 
static TQString cleanName (const TQString &rurl)
 
static TQString correctName (const TQString &rurl, const Type type=Auto)
 

Protected Member Functions

void correct ()
 

Detailed Description

Relative name of a file or directory.

Definition at line 16 of file rurl.h.

Constructor & Destructor Documentation

◆ 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.

Member Function Documentation

◆ 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:
  • rurl.h
  • rurl.cpp

KDevelop Utility Library

Skip menu "KDevelop Utility Library"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

KDevelop Utility Library

Skip menu "KDevelop Utility Library"
  • buildtools
  •   lib
  •     base
  •     parsers
  •       autotools
  •       qmake
  •     widgets
  •   api
  • languages
  •   lib
  •     debugger
  •     designer_integration
  •     interfaces
  • lib
  •   catalog
  •   interfaces
  •     extensions
  •     external
  •     extras
  •   util
  •   widgets
  •     propeditor
  • parts
  •   documentation
  •     interfaces
  • src
  •   profileengine
  •     lib
Generated for KDevelop Utility Library by doxygen 1.8.13
This website is maintained by Timothy Pearson.