LibreOffice Module framework (master) 1
|
can be used to parse, validate and work with job URL's @descr Job URLs are specified by the following syntax: vnd.sun.star.job:{[event=<name>]|[alias=<name>]|[service=<name>]} This class can analyze this structure and separate it into his different parts. More...
#include <joburl.hxx>
Public Member Functions | |
JobURL (const OUString &sURL) | |
special ctor @descr It initialize this new instance with a (hopefully) valid job URL. More... | |
bool | isValid () const |
knows, if this job URL object hold a valid URL inside More... | |
bool | getEvent (OUString &sEvent) const |
get the event item of this job URL @descr Because the three possible parts of such URL (event, alias, service) can't be combined, this method can(!) return a valid value - but it's not a must. More... | |
bool | getAlias (OUString &sAlias) const |
get the alias item of this job URL @descr Because the three possible parts of such URL (event, alias, service) can't be combined, this method can(!) return a valid value - but it's not a must. More... | |
bool | getService (OUString &sService) const |
get the service item of this job URL @descr Because the three possible parts of such URL (event, service, service) can't be combined, this method can(!) return a valid value - but it's not a must. More... | |
Private Types | |
enum | ERequest { E_UNKNOWN = 0 , E_EVENT = 1 , E_ALIAS = 2 , E_SERVICE = 4 } |
possible states of a job URL Note: These values are used in combination. More... | |
Static Private Member Functions | |
static bool | implst_split (std::u16string_view sPart, const char *pPartIdentifier, sal_Int32 nPartLength, OUString &rPartValue, OUString &rPartArguments) |
searches for a special identifier in the given string and split it @descr If the given identifier could be found at the beginning of the given string, this method split it into different parts and return it. More... | |
Private Attributes | |
sal_uInt32 | m_eRequest |
knows the state of this URL instance More... | |
OUString | m_sEvent |
holds the event part of a job URL More... | |
OUString | m_sAlias |
holds the alias part of a job URL More... | |
OUString | m_sService |
holds the service part of a job URL More... | |
can be used to parse, validate and work with job URL's @descr Job URLs are specified by the following syntax: vnd.sun.star.job:{[event=<name>]|[alias=<name>]|[service=<name>]} This class can analyze this structure and separate it into his different parts.
After doing that these parts are accessible by the methods of this class.
Definition at line 45 of file joburl.hxx.
|
private |
possible states of a job URL Note: These values are used in combination.
So they must be values in form 2^n.
Enumerator | |
---|---|
E_UNKNOWN | mark a job URL as not valid |
E_EVENT | it's an event |
E_ALIAS | it's an alias |
E_SERVICE | it's a service |
Definition at line 57 of file joburl.hxx.
framework::JobURL::JobURL | ( | const OUString & | sURL | ) |
special ctor @descr It initialize this new instance with a (hopefully) valid job URL.
This URL will be parsed. After that we set our members right, so other interface methods of this class can be used to get all items of this URL. Of course it will be possible to know, if this URL was valid too.
sURL | the job URL for parsing |
Definition at line 42 of file joburl.cxx.
References E_ALIAS, E_EVENT, E_SERVICE, E_UNKNOWN, implst_split(), JOBURL_ALIAS_LEN, JOBURL_ALIAS_STR, JOBURL_EVENT_LEN, JOBURL_EVENT_STR, JOBURL_PART_SEPARATOR, JOBURL_SERVICE_LEN, JOBURL_SERVICE_STR, m_eRequest, m_sAlias, m_sEvent, m_sService, and t.
bool framework::JobURL::getAlias | ( | OUString & | sAlias | ) | const |
get the alias item of this job URL @descr Because the three possible parts of such URL (event, alias, service) can't be combined, this method can(!) return a valid value - but it's not a must.
that's why the return value must be used too, to detect a missing alias value.
sAlias | returns the possible existing alias value e.g. "vnd.sun.star.job:alias=myAlias" returns "myAlias" |
Definition at line 148 of file joburl.cxx.
References E_ALIAS, m_eRequest, and m_sAlias.
bool framework::JobURL::getEvent | ( | OUString & | sEvent | ) | const |
get the event item of this job URL @descr Because the three possible parts of such URL (event, alias, service) can't be combined, this method can(!) return a valid value - but it's not a must.
That's why the return value must be used too, to detect a missing event value.
sEvent | returns the possible existing event value e.g. "vnd.sun.star.job:event=myEvent" returns "myEvent" |
Definition at line 122 of file joburl.cxx.
References E_EVENT, m_eRequest, and m_sEvent.
bool framework::JobURL::getService | ( | OUString & | sService | ) | const |
get the service item of this job URL @descr Because the three possible parts of such URL (event, service, service) can't be combined, this method can(!) return a valid value - but it's not a must.
That's why the return value must be used too, to detect a missing service value.
sAlias | returns the possible existing service value e.g. "vnd.sun.star.job:service=com.sun.star.Service" returns "com.sun.star.Service" |
Definition at line 174 of file joburl.cxx.
References E_SERVICE, m_eRequest, and m_sService.
|
staticprivate |
searches for a special identifier in the given string and split it @descr If the given identifier could be found at the beginning of the given string, this method split it into different parts and return it.
Following schema is used: <partidentifier>=<partvalue>[?<partarguments>]
sPart | the string, which should be analyzed |
pPartIdentifier | the part identifier value, which must be found at the beginning of the parameter sPart |
nPartLength | the length of the ascii value pPartIdentifier |
rPartValue | returns the part value if sPart was split successfully |
rPartArguments | returns the part arguments if sPart was split successfully |
Definition at line 209 of file joburl.cxx.
References o3tl::matchIgnoreAsciiCase().
Referenced by JobURL().
bool framework::JobURL::isValid | ( | ) | const |
knows, if this job URL object hold a valid URL inside
Definition at line 101 of file joburl.cxx.
References E_UNKNOWN, and m_eRequest.
|
private |
knows the state of this URL instance
Definition at line 74 of file joburl.hxx.
Referenced by getAlias(), getEvent(), getService(), isValid(), and JobURL().
|
private |
holds the alias part of a job URL
Definition at line 80 of file joburl.hxx.
Referenced by getAlias(), and JobURL().
|
private |
holds the event part of a job URL
Definition at line 77 of file joburl.hxx.
Referenced by getEvent(), and JobURL().
|
private |
holds the service part of a job URL
Definition at line 83 of file joburl.hxx.
Referenced by getService(), and JobURL().