Home · Overviews · Reference · Classes codeless banner

Solution Class Reference

The Solution class represents a solution. More...

    #include <Solution>

Public Types

Public Functions

Static Public Members


Detailed Description

The Solution class represents a solution.

See also Solution Filesystem.


Member Type Documentation

enum Solution::FileType

This enum is used to locate files in one of three specific locations.

ConstantValue
Solution::Generated1
Solution::Project0
Solution::Existing2

enum Solution::Type

ConstantValue
Solution::None0x0000
Solution::_Project0x0001
Solution::Absolute0x0008
Solution::Wildcard0x0010
Solution::All0x0019


Member Function Documentation

void Solution::addPath ( const QString & solutionPath, const QString & filesystemPath )

Map filesystemPath to solutionPath.

QList<SolutionFile> Solution::blankIncludes () const

Returns the blank.pri file for each solution.

SolutionFile Solution::buildFile ( const QString & _name, const SolutionFile & relative ) const

Returns a SolutionFile for the build file given by _name. This file may not exist. If name is relative, it will be taken as relative to the relative file. If no relative file is provided and name is relative, a null SolutionFile will be returned.

QList<SolutionFile> Solution::commonIncludes () const

Returns the common.pri file for each solution.

bool Solution::createDefaultSolution ()   [static]

Create the default solution. Returns true.

QList<SolutionFile> Solution::defaultIncludes () const

Returns the default.pri file for each solution.

Solution * Solution::defaultSolution ()   [static]

Returns the default solution.

See also setDefaultSolution().

QList<SolutionFile> Solution::disabledIncludes () const

Returns the disabled.pri file for each solution.

SolutionFile Solution::file ( const QString & name, Type type, const SolutionFile & relative ) const

Returns the first solution file instance that maps to name with the given type. If name is relative, it will be taken as relative to the relative file. If no relative file is provided and name is relative, a null SolutionFile will be returned.

FIXME type

SolutionFiles Solution::files ( const QString & _name, Type type, const SolutionFile & relative ) const

The same as file(), except that it returns a list of all files, in case more than one exists.

FIXME _name type relative.

QStringList Solution::files ( const QString & id ) const

This is an overloaded member function, provided for convenience.

Return a list of solution files that match id. id must be an absolute path, and may contain the "*" wild card in the file section. For example:

/services/Date.service /services/D*.service /services/D*.* /services/

are valid and

services/Date.service /s*s/Date.service

are not.

QString Solution::filesystemBuildPath ( const QString & _name, const SolutionFile & relative ) const

Returns the filesystem path of the build directory given by _name. This path may not exist. If name is relative, it will be taken as relative to the relative file. If no relative file is provided and name is relative, an empty string will be returned.

QStringList Solution::filesystemPaths ( const QString & _name, Type type, const SolutionFile & relative ) const

Returns a list of fully qualified filesystem paths that map to _name. If name is relative, it will be taken as relative to the relative file. If no relative file is provided and name is relative, an empty string will be returned.

FIXME type

SolutionFile Solution::findFile ( const QString & id, FileType type = Project, const SolutionFile & file = SolutionFile() ) const

Takes a solution path id and returns a SolutionFile instance.

If type is Solution::Project, all project directories (including the build directory) is searched. The first directory containing the file is returned, or the build directory if the file doesn't exist.

if type is Solution::Generated, the file is returned relative to the build directory.

If type is Solution::Existing, the same directories as Solution::Project are searched, with the additional constraint that if the file does not exist (even in the build directory) a null SolutionFile is returned.

The solution path id has the following form:

    [<Solution Name>:]<Request Path>

The request path must not contain ':' characters before the first separator character '/' to prevent an ambiguous reference. If necessary, the special solution name "current" can be used to work around this.

If file is provided (an a non-"current" solution name is not provided), id may be specified relative to it.

SolutionFile Solution::fuzzyRealToSolution ( const QString & realPath )

Takes the true (absolute) realPath and returns it as a SolutionFile. This version uses fuzzy logic so that paths like <build>/devices/greenphone/src are mapped to /src.

QString Solution::name () const

Return the name of the solution.

QStringList Solution::pathMappings ( const QString & id )

Returns a list of file system paths that map to the solution path id.

QStringList Solution::paths ( const QString & _name, Type type, const SolutionFile & relative ) const

Returns a list of fully qualified paths that match _name. This is generally only useful if Wildcard is specified.

FIXME type relative

QStringList Solution::paths ( const QString & id, const SolutionFile & unused = SolutionFile() ) const

This is an overloaded member function, provided for convenience.

Returns a list of the file system paths that map to the solution path id.

FIXME unused

SolutionFile Solution::realToSolution ( const QString & realPath )

Takes the true (absolute) realPath and returns it as a SolutionFile. Thanks to the "!" mechanism (absolute fs paths), this will *always* return a valid SolutionFile unless a non-absolute path is passed in which case a null SolutionFile is returned.

void Solution::setDefaultSolution ( Solution * solution )   [static]

Set the default solution to solution.

See also defaultSolution().

Solution * Solution::solution ( const QString & name )   [static]

Returns the solution with name name.

QStringList Solution::solutions ()   [static]

Returns the names of the solutions.

QStringList Solution::subPaths ( const QString & name, Type type, const SolutionFile & relative ) const

Returns a list of fully qualified sub-paths of name. If name is relative is is evaluated as relative to the relative file. If it is relative and the file is not provided, an empty list is returned.

FIXME type


Copyright © 2009 Nokia
Qt Extended - QBuild Maintainer Guide