#include <Libs/PluginFramework/service/datalocation/ctkLocation.h>
A ctkLocation represents a QUrl which may have a default value, may be read only, may or may not have a current value and may be cascaded on to a parent location.
Definition at line 35 of file ctkLocation.h.
◆ ~ctkLocation()
virtual ctkLocation::~ctkLocation |
( |
| ) |
|
|
inlinevirtual |
◆ allowsDefault()
virtual bool ctkLocation::allowsDefault |
( |
| ) |
const |
|
pure virtual |
Returns true
if this location allows a default value to be assigned and false
otherwise.
- Returns
- whether or not this location can have a default value assigned
◆ createLocation()
virtual ctkLocation* ctkLocation::createLocation |
( |
ctkLocation * |
parent, |
|
|
const QUrl & |
defaultValue, |
|
|
bool |
readonly |
|
) |
| |
|
pure virtual |
Constructs a new location.
- Parameters
-
parent | the parent location. A null value is allowed. |
defaultValue | the default value of the location. A null value is allowed. |
readonly | true if the location is read-only. |
- Returns
- a new location.
◆ getDataArea()
virtual QUrl ctkLocation::getDataArea |
( |
const QString & |
path | ) |
const |
|
pure virtual |
Returns a URL to the specified path within this location. The path of the returned URL may not exist yet. It is the responsibility of the client to create the content of the data area returned if it does not exist.
This method can be used to obtain a private area within the given location. For example use the symbolic name of a plugin to obtain a data area specific to that plugin.
Clients should check if the location is read only before writing anything to the returned data area. An ctkRuntimeException
will be thrown if this method is called and the location URL has not been set and there is no default value for this location.
- Parameters
-
path | the name of the path to get from this location |
- Returns
- the URL to the data area with the specified path.
- Exceptions
-
◆ getDefault()
virtual QUrl ctkLocation::getDefault |
( |
| ) |
const |
|
pure virtual |
Returns the default value of this location if any. If no default is available then null
is returned. Note that even locations which allow defaults may still return null
.
- Returns
- the default value for this location or
null
◆ getParentLocation()
virtual ctkLocation* ctkLocation::getParentLocation |
( |
| ) |
const |
|
pure virtual |
Returns the parent of this location or null
if none is available.
- Returns
- the parent of this location or
null
◆ getUrl()
virtual QUrl ctkLocation::getUrl |
( |
| ) |
const |
|
pure virtual |
Returns the actual QUrl of this location. If the location's value has been set, that value is returned. If the value is not set and the location allows defaults, the value is set to the default and returned. In all other cases null
is returned.
- Returns
- the URL for this location or
null
if none
◆ isLocked()
virtual bool ctkLocation::isLocked |
( |
| ) |
const |
|
pure virtual |
Returns true
if this location is locked and false
otherwise.
- Returns
- boolean value indicating whether or not this location is locked
- Exceptions
-
◆ isReadOnly()
virtual bool ctkLocation::isReadOnly |
( |
| ) |
const |
|
pure virtual |
Returns true
if this location represents a read only location and false
otherwise. The read only character of a location is not in enforced in any way but rather expresses the intention of the location's creator.
- Returns
- boolean value indicating whether the location is read only
◆ isSet()
virtual bool ctkLocation::isSet |
( |
| ) |
const |
|
pure virtual |
Returns true
if this location has a value and false
otherwise.
- Returns
- boolean value indicating whether or not the value is set
◆ lock()
virtual bool ctkLocation::lock |
( |
| ) |
|
|
pure virtual |
Attempts to lock this location with a canonical locking mechanism and return true
if the lock could be acquired. Not all locations can be locked.
Locking a location is advisory only. That is, it does not prevent other applications from modifying the same location
- Returns
- true if the lock could be acquired; otherwise false is returned
- Exceptions
-
◆ release()
virtual void ctkLocation::release |
( |
| ) |
|
|
pure virtual |
Releases the lock on this location. If the location is not already locked, no action is taken.
◆ set() [1/2]
virtual bool ctkLocation::set |
( |
const QUrl & |
value, |
|
|
bool |
lock |
|
) |
| |
|
pure virtual |
Sets and optionally locks the location's value to the given QUrl. If the location already has a value an exception is thrown. If locking is requested and fails, false
is returned and the QUrl of this location is not set.
- Parameters
-
value | the value of this location |
lock | whether or not to lock this location |
- Returns
- whether or not the location was successfully set and, if requested, locked.
- Exceptions
-
◆ set() [2/2]
virtual bool ctkLocation::set |
( |
const QUrl & |
value, |
|
|
bool |
lock, |
|
|
const QString & |
lockFilePath |
|
) |
| |
|
pure virtual |
Sets and optionally locks the location's value to the given QUrl using the given lock file. If the location already has a value an exception is thrown. If locking is requested and fails, false
is returned and the QUrl of this location is not set.
- Parameters
-
value | the value of this location |
lock | whether or not to lock this location |
lockFilePath | the path to the lock file. This path will be used to establish locks on this location. The path may be an absolute path or it may be relative to the given URL. If a null value is used then a default lock path will be used for this location. |
- Returns
- whether or not the location was successfully set and, if requested, locked.
- Exceptions
-
◆ CONFIGURATION_FILTER
const QString ctkLocation::CONFIGURATION_FILTER |
|
static |
Constant which defines the filter string for acquiring the service which specifies the configuration location.
Definition at line 54 of file ctkLocation.h.
◆ CTK_HOME_FILTER
const QString ctkLocation::CTK_HOME_FILTER |
|
static |
Constant which defines the filter string for acquiring the service which specifies the eclipse home location.
Definition at line 66 of file ctkLocation.h.
◆ INSTALL_FILTER
const QString ctkLocation::INSTALL_FILTER |
|
static |
Constant which defines the filter string for acquiring the service which specifies the install location.
Definition at line 48 of file ctkLocation.h.
◆ INSTANCE_FILTER
const QString ctkLocation::INSTANCE_FILTER |
|
static |
Constant which defines the filter string for acquiring the service which specifies the instance location.
Definition at line 42 of file ctkLocation.h.
◆ USER_FILTER
const QString ctkLocation::USER_FILTER |
|
static |
Constant which defines the filter string for acquiring the service which specifies the user location.
Definition at line 60 of file ctkLocation.h.
The documentation for this struct was generated from the following file: