Aimsun Next Scripting  24.0
Public Member Functions | Public Attributes | List of all members
GKFilePath Class Reference

Public Member Functions

 GKFilePath ()
 
 GKFilePath (const GKModel &model, const QString &path)
 
bool isRelative () const
 
bool isAbsolute () const
 
bool isInsideProject () const
 
bool isEmpty () const
 
bool exists () const
 
const QString & string () const
 
const QString path () const
 
const QString fileName () const
 
QString getProjectPath () const
 
QString getRelativePath () const
 
MethodCode if (const auto relPath=sipCpp->getRelativePath())
 
End QString getAbsolutePath () const
 
const GKModelgetModel () const
 
void setPath (const GKModel &model, const QString &path)
 
void setPath (const QString &path)
 
bool toRelativePath ()
 
void toAbsolutePath ()
 
bool mkpath (bool isFile) const
 

Public Attributes

 else
 

Constructor & Destructor Documentation

◆ GKFilePath() [1/2]

GKFilePath::GKFilePath ( )

◆ GKFilePath() [2/2]

GKFilePath::GKFilePath ( const GKModel model,
const QString &  path 
)

Member Function Documentation

◆ exists()

bool GKFilePath::exists ( ) const

Returns true if the file path exists.

◆ fileName()

const QString GKFilePath::fileName ( ) const

Returns the name of the file, excluding the path.

◆ getAbsolutePath()

End QString GKFilePath::getAbsolutePath ( ) const

Returns the path as an absolute path.

Remarks
If the path is relative, it will be interpreted as relative to the Project folder.

◆ getModel()

const GKModel * GKFilePath::getModel ( ) const

Returns the model.

◆ getProjectPath()

QString GKFilePath::getProjectPath ( ) const

Return the path of the Project folder.

◆ getRelativePath()

QString GKFilePath::getRelativePath ( ) const

Returns the path as a relative path if it's inside the Project folder.

◆ if()

MethodCode GKFilePath::if ( const auto  relPath = sipCpp->getRelativePath())
inline

◆ isAbsolute()

bool GKFilePath::isAbsolute ( ) const

Returns true if the path is absolute.

◆ isEmpty()

bool GKFilePath::isEmpty ( ) const

Check if the path is empty.

◆ isInsideProject()

bool GKFilePath::isInsideProject ( ) const

Returns true if the path is inside the Project folder or if it's relative.

◆ isRelative()

bool GKFilePath::isRelative ( ) const

Returns true if the path is relative.

◆ mkpath()

bool GKFilePath::mkpath ( bool  isFile) const

Creates the directory and all parent directories.

  • isFile true to interpret the text after the last separator (/) as the name of a file, not a folder.
    Returns
    true if the directory path exists at the end of the call, false otherwise.

◆ path()

const QString GKFilePath::path ( ) const

Returns the file's path. This doesn't include the file name.

◆ setPath() [1/2]

void GKFilePath::setPath ( const GKModel model,
const QString &  path 
)

Set the model and path.

◆ setPath() [2/2]

void GKFilePath::setPath ( const QString &  path)

Set the model and path.

Remarks
The model needs to have been set before.

◆ string()

const QString & GKFilePath::string ( ) const

Returns the file name, including the path (which may be absolute or relative).

◆ toAbsolutePath()

void GKFilePath::toAbsolutePath ( )

Changes the path to an absolute path.

◆ toRelativePath()

bool GKFilePath::toRelativePath ( )

Changes the path to a relative path if it's inside the Project folder.

Returns
true if successful, false otherwise.

Member Data Documentation

◆ else

GKFilePath::else
Initial value:
{
sipRes = new QString{}

© Aimsun SLU
Aimsun ®