LibreOffice Module framework (master) 1
Public Member Functions | Private Types | Static Private Member Functions | Private Attributes | List of all members
framework::JobURL Class Reference

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...
 

Detailed Description

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.

Member Enumeration Documentation

◆ ERequest

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.

Constructor & Destructor Documentation

◆ JobURL()

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.

Parameters
sURLthe 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.

Member Function Documentation

◆ getAlias()

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.

Parameters
sAliasreturns the possible existing alias value e.g. "vnd.sun.star.job:alias=myAlias" returns "myAlias"
Returns
<TRUE> if an alias part of the job URL exist and the out parameter sAlias was filled.
Attention: \n The out parameter will be reset every time. Don't use it if method returns !

Definition at line 148 of file joburl.cxx.

References E_ALIAS, m_eRequest, and m_sAlias.

◆ getEvent()

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.

Parameters
sEventreturns the possible existing event value e.g. "vnd.sun.star.job:event=myEvent" returns "myEvent"
Returns
<TRUE> if an event part of the job URL exist and the out parameter sEvent was filled.
Attention: \n The out parameter will be reset every time. Don't use it if method returns !

Definition at line 122 of file joburl.cxx.

References E_EVENT, m_eRequest, and m_sEvent.

◆ getService()

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.

Parameters
sAliasreturns the possible existing service value e.g. "vnd.sun.star.job:service=com.sun.star.Service" returns "com.sun.star.Service"
Returns
<TRUE> if a service part of the job URL exist and the out parameter sService was filled.
Attention: \n The out parameter will be reset every time. Don't use it if method returns !

Definition at line 174 of file joburl.cxx.

References E_SERVICE, m_eRequest, and m_sService.

◆ implst_split()

bool framework::JobURL::implst_split ( std::u16string_view  sPart,
const char *  pPartIdentifier,
sal_Int32  nPartLength,
OUString &  rPartValue,
OUString &  rPartArguments 
)
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>]

Parameters
sPartthe string, which should be analyzed
pPartIdentifierthe part identifier value, which must be found at the beginning of the parameter sPart
nPartLengththe length of the ascii value pPartIdentifier
rPartValuereturns the part value if sPart was split successfully
rPartArgumentsreturns the part arguments if sPart was split successfully
Returns
<TRUE> if the identifier could be found and the string was split. <FALSE> otherwise.

Definition at line 209 of file joburl.cxx.

References o3tl::matchIgnoreAsciiCase().

Referenced by JobURL().

◆ isValid()

bool framework::JobURL::isValid ( ) const

knows, if this job URL object hold a valid URL inside

Returns
<TRUE> if it represent a valid job URL.

Definition at line 101 of file joburl.cxx.

References E_UNKNOWN, and m_eRequest.

Member Data Documentation

◆ m_eRequest

sal_uInt32 framework::JobURL::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().

◆ m_sAlias

OUString framework::JobURL::m_sAlias
private

holds the alias part of a job URL

Definition at line 80 of file joburl.hxx.

Referenced by getAlias(), and JobURL().

◆ m_sEvent

OUString framework::JobURL::m_sEvent
private

holds the event part of a job URL

Definition at line 77 of file joburl.hxx.

Referenced by getEvent(), and JobURL().

◆ m_sService

OUString framework::JobURL::m_sService
private

holds the service part of a job URL

Definition at line 83 of file joburl.hxx.

Referenced by getService(), and JobURL().


The documentation for this class was generated from the following files: