Represents the GAMS path to a specific file. More...

#include <gamspath.h>

Inherits QFileInfo.

Public Member Functions

 GAMSPath ()
 Standard constructor. More...
 
 GAMSPath (const char *file)
 
 GAMSPath (const std::string &file)
 
 GAMSPath (const QString &file)
 
 GAMSPath (const QFile &file)
 
 GAMSPath (const QDir &dir, const QString &file)
 
 GAMSPath (const QFileInfo &fileinfo)
 
 GAMSPath (const GAMSPath &gpath)
 
GAMSPathoperator= (const GAMSPath &other)
 
GAMSPathoperator<< (const QString &append)
 
GAMSPathoperator+= (const QString &append)
 
GAMSPath operator+ (const QString &append)
 
GAMSPath operator+ (const std::string &append)
 
GAMSPath operator+ (const char *append)
 
GAMSPath operator/ (const GAMSPath &append)
 
GAMSPath operator/ (const QString &append)
 
GAMSPath operator/ (const std::string &append)
 
GAMSPath operator/ (const char *append)
 
 operator std::string ()
 Converts a std::string to GAMSPath. More...
 
 operator QString ()
 Converts a QString to GAMSPath. More...
 
std::string toStdString ()
 Get the path or file as std::string. More...
 
const char * c_str ()
 Get the path or file as character string. More...
 
GAMSPath tempDir (const QString &templatePath=QString())
 
GAMSPath tempFile (const QString &templateName="XXXXXX.tmp")
 
GAMSPath tempFile (const std::string &templateName="XXXXXX.tmp")
 
GAMSPath tempFile (const char *templateName="XXXXXX.tmp")
 
void setSuffix (const char *suffix)
 
void setSuffix (const QString &suffix)
 
void setSuffix (const std::string &suffix)
 
GAMSPath suffix (const QString &suffix) const
 
GAMSPath suffix (const std::string &suffix) const
 
GAMSPath suffix (const char *suffix) const
 
GAMSPath up () const
 
QString suffix () const
 Path suffix. More...
 
GAMSPath path () const
 Get the GAMSPath. More...
 
bool mkDir ()
 Create the directory. More...
 
bool rmDirRecurse ()
 
void pack ()
 Optimize the path length, i.e. full path to relative path. More...
 
bool remove ()
 
bool rename (const QString &newFileName)
 
bool rename (const std::string &newFileName)
 
bool rename (const char *newFileName)
 
bool exists () const
 

Static Public Member Functions

static bool exists (const QString &file)
 
static bool exists (const std::string &file)
 
static bool exists (const char *file)
 

Detailed Description

Represents the GAMS path to a specific file.

Definition at line 34 of file gamspath.h.

Constructor & Destructor Documentation

◆ GAMSPath() [1/8]

gams::GAMSPath::GAMSPath ( )
inline

Standard constructor.

Definition at line 38 of file gamspath.h.

◆ GAMSPath() [2/8]

gams::GAMSPath::GAMSPath ( const char *  file)
inline

Constructs a GAMSPath based on a path or file.

Parameters
filePath or file.

Definition at line 42 of file gamspath.h.

◆ GAMSPath() [3/8]

gams::GAMSPath::GAMSPath ( const std::string &  file)
inline

Constructs a GAMSPath based on a path or file.

Parameters
filePath or file.

Definition at line 46 of file gamspath.h.

◆ GAMSPath() [4/8]

gams::GAMSPath::GAMSPath ( const QString &  file)
inline

Constructs a GAMSPath based on a path or file.

Parameters
filePath or file.

Definition at line 50 of file gamspath.h.

◆ GAMSPath() [5/8]

gams::GAMSPath::GAMSPath ( const QFile &  file)
inline

Constructs a GAMSPath based on a path or file.

Parameters
fileFile.

Definition at line 54 of file gamspath.h.

◆ GAMSPath() [6/8]

gams::GAMSPath::GAMSPath ( const QDir &  dir,
const QString &  file 
)
inline

Constructs a GAMSPath based on a path or file.

Parameters
dirPath.
fileFile.

Definition at line 59 of file gamspath.h.

◆ GAMSPath() [7/8]

gams::GAMSPath::GAMSPath ( const QFileInfo &  fileinfo)
inline

Constructs a GAMSPath based on a path or file.

Parameters
fileinfoQFileInfo.

Definition at line 63 of file gamspath.h.

◆ GAMSPath() [8/8]

gams::GAMSPath::GAMSPath ( const GAMSPath gpath)
inline

Constructs a GAMSPath based on a path or file.

Parameters
gpathAnother GAMSPath used as data source.

Definition at line 67 of file gamspath.h.

Member Function Documentation

◆ c_str()

const char* gams::GAMSPath::c_str ( )

Get the path or file as character string.

◆ exists() [1/4]

bool gams::GAMSPath::exists ( ) const

Checks if the path exists.

Returns
Returns true if the path exists; otherwise false.

◆ exists() [2/4]

static bool gams::GAMSPath::exists ( const QString &  file)
static

Checks if the file exists.

Parameters
fileThe file name.
Returns
Returns true if the file exists; otherwise false.

◆ exists() [3/4]

static bool gams::GAMSPath::exists ( const std::string &  file)
static

Checks if the file exists.

Parameters
fileThe file name.
Returns
Returns true if the file exists; otherwise false.

◆ exists() [4/4]

static bool gams::GAMSPath::exists ( const char *  file)
static

Checks if the file exists.

Parameters
fileThe file name.
Returns
Returns true if the file exists; otherwise false.

◆ mkDir()

bool gams::GAMSPath::mkDir ( )

Create the directory.

◆ operator QString()

gams::GAMSPath::operator QString ( )

Converts a QString to GAMSPath.

◆ operator std::string()

gams::GAMSPath::operator std::string ( )

Converts a std::string to GAMSPath.

◆ operator+() [1/3]

GAMSPath gams::GAMSPath::operator+ ( const QString &  append)

Appends the string to the GAMSPath.

Parameters
appendThe string to append.
Returns
Returns the GAMSPath with the string appended.

◆ operator+() [2/3]

GAMSPath gams::GAMSPath::operator+ ( const std::string &  append)

Appends the string to the GAMSPath.

Parameters
appendThe string to append.
Returns
Returns the GAMSPath with the string appended.

◆ operator+() [3/3]

GAMSPath gams::GAMSPath::operator+ ( const char *  append)

Appends the string to the GAMSPath.

Parameters
appendThe string to append.
Returns
Returns the GAMSPath with the string appended.

◆ operator+=()

GAMSPath& gams::GAMSPath::operator+= ( const QString &  append)

Appends the string to the GAMSPath.

Parameters
appendThe string to append.
Returns
Returns the GAMSPath with the string appended.

◆ operator/() [1/4]

GAMSPath gams::GAMSPath::operator/ ( const GAMSPath append)

Appends a path to the GAMSPath.

Parameters
appendThe path to append.
Returns
Returns the GAMSPath with the path appended.

◆ operator/() [2/4]

GAMSPath gams::GAMSPath::operator/ ( const QString &  append)

Appends a path to the GAMSPath.

Parameters
appendThe path to append.
Returns
Returns the GAMSPath with the path appended.

◆ operator/() [3/4]

GAMSPath gams::GAMSPath::operator/ ( const std::string &  append)

Appends a path to the GAMSPath.

Parameters
appendThe path to append.
Returns
Returns the GAMSPath with the path appended.

◆ operator/() [4/4]

GAMSPath gams::GAMSPath::operator/ ( const char *  append)

Appends a path to the GAMSPath.

Parameters
appendThe path to append.
Returns
Returns the GAMSPath with the path appended.

◆ operator<<()

GAMSPath& gams::GAMSPath::operator<< ( const QString &  append)

Appends the string to the GAMSPath.

Parameters
appendThe string to append.
Returns
Returns the GAMSPath with the string appended.

◆ operator=()

GAMSPath& gams::GAMSPath::operator= ( const GAMSPath other)

Assigns a GAMSPath.

Parameters
otherAnother GAMSPath used as data source.
Returns
Returns the assigned GAMSPath (*this).

◆ pack()

void gams::GAMSPath::pack ( )

Optimize the path length, i.e. full path to relative path.

◆ path()

GAMSPath gams::GAMSPath::path ( ) const

Get the GAMSPath.

◆ remove()

bool gams::GAMSPath::remove ( )

Remmoves the file.

Returns
Returns true if the removal was successfull; otherwise false.

◆ rename() [1/3]

bool gams::GAMSPath::rename ( const QString &  newFileName)

Rename the already set file.

Parameters
newFileNameThe new file name.
Returns
Returns true if the rename was successfull; otherwise false.

◆ rename() [2/3]

bool gams::GAMSPath::rename ( const std::string &  newFileName)

Rename the already set file.

Parameters
newFileNameThe new file name.
Returns
Returns true if the rename was successfull; otherwise false.

◆ rename() [3/3]

bool gams::GAMSPath::rename ( const char *  newFileName)

Rename the already set file.

Parameters
newFileNameThe new file name.
Returns
Returns true if the rename was successfull; otherwise false.

◆ rmDirRecurse()

bool gams::GAMSPath::rmDirRecurse ( )

Removes the direcotry recursively.

Returns
Returns true if the removal was successfull; otherwise false.

◆ setSuffix() [1/3]

void gams::GAMSPath::setSuffix ( const char *  suffix)

Add a suffix to the GAMSPath.

Parameters
suffixThe suffix to add.

◆ setSuffix() [2/3]

void gams::GAMSPath::setSuffix ( const QString &  suffix)

Add a suffix to the GAMSPath.

Parameters
suffixThe suffix to add.

◆ setSuffix() [3/3]

void gams::GAMSPath::setSuffix ( const std::string &  suffix)

Add a suffix to the GAMSPath.

Parameters
suffixThe suffix to add.

◆ suffix() [1/4]

GAMSPath gams::GAMSPath::suffix ( const QString &  suffix) const

Add a suffix.

Parameters
suffixThe suffix to add.
Returns
Returns the GAMSPath with suffix.

◆ suffix() [2/4]

GAMSPath gams::GAMSPath::suffix ( const std::string &  suffix) const

Add a suffix.

Parameters
suffixThe suffix to add.
Returns
Returns the GAMSPath with suffix.

◆ suffix() [3/4]

GAMSPath gams::GAMSPath::suffix ( const char *  suffix) const

Add a suffix.

Parameters
suffixThe suffix to add.
Returns
Returns the GAMSPath with suffix.

◆ suffix() [4/4]

QString gams::GAMSPath::suffix ( ) const

Path suffix.

◆ tempDir()

GAMSPath gams::GAMSPath::tempDir ( const QString &  templatePath = QString())

Create a GAMSPath to a temporary directory.

Parameters
templatePathTemplate temporary directory.
Returns
Returns a GAMSPath to the temporary directory.

◆ tempFile() [1/3]

GAMSPath gams::GAMSPath::tempFile ( const QString &  templateName = "XXXXXX.tmp")

Create a GAMSPath to a temporary file.

Parameters
templateNameTemplate for temporary file name.
Returns
Returns a GAMSPath to the temporary file.

◆ tempFile() [2/3]

GAMSPath gams::GAMSPath::tempFile ( const std::string &  templateName = "XXXXXX.tmp")

Create a GAMSPath to a temporary file.

Parameters
templateNameTemplate for temporary file name.
Returns
Returns a GAMSPath to the temporary file.

◆ tempFile() [3/3]

GAMSPath gams::GAMSPath::tempFile ( const char *  templateName = "XXXXXX.tmp")

Create a GAMSPath to a temporary file.

Parameters
templateNameTemplate for temporary file name.
Returns
Returns a GAMSPath to the temporary file.

◆ toStdString()

std::string gams::GAMSPath::toStdString ( )

Get the path or file as std::string.

◆ up()

GAMSPath gams::GAMSPath::up ( ) const

Get the GAMS path as optimized path.

Returns
Returns a new GAMSPath object.