LibreOffice Module framework (master) 1
joburl.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include <rtl/ustring.hxx>
23
24namespace framework{
25
26#define JOBURL_EVENT_STR "event="
27#define JOBURL_EVENT_LEN 6
28
29#define JOBURL_ALIAS_STR "alias="
30#define JOBURL_ALIAS_LEN 6
31
32#define JOBURL_SERVICE_STR "service="
33#define JOBURL_SERVICE_LEN 8
34
35#define JOBURL_PART_SEPARATOR ';'
36#define JOBURL_PARTARGS_SEPARATOR ','
37
45class JobURL
46{
47
48 // types
49
50 private:
51
58 {
66 E_SERVICE = 4
67 };
68
69 // types
70
71 private:
72
74 sal_uInt32 m_eRequest;
75
77 OUString m_sEvent;
78
80 OUString m_sAlias;
81
83 OUString m_sService;
84
85 // native interface
86
87 public:
88
89 JobURL ( const OUString& sURL );
90 bool isValid ( ) const;
91 bool getEvent ( OUString& sEvent ) const;
92 bool getAlias ( OUString& sAlias ) const;
93 bool getService ( OUString& sService ) const;
94
95 // private helper
96
97 private:
98
99 static bool implst_split( std::u16string_view sPart ,
100 const char* pPartIdentifier ,
101 sal_Int32 nPartLength ,
102 OUString& rPartValue ,
103 OUString& rPartArguments );
104};
105
106} // namespace framework
107
108/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
can be used to parse, validate and work with job URL's @descr Job URLs are specified by the following...
Definition: joburl.hxx:46
bool getService(OUString &sService) const
get the service item of this job URL @descr Because the three possible parts of such URL (event,...
Definition: joburl.cxx:174
bool isValid() const
knows, if this job URL object hold a valid URL inside
Definition: joburl.cxx:101
bool getEvent(OUString &sEvent) const
get the event item of this job URL @descr Because the three possible parts of such URL (event,...
Definition: joburl.cxx:122
OUString m_sAlias
holds the alias part of a job URL
Definition: joburl.hxx:80
ERequest
possible states of a job URL Note: These values are used in combination.
Definition: joburl.hxx:58
@ E_ALIAS
it's an alias
Definition: joburl.hxx:64
@ E_EVENT
it's an event
Definition: joburl.hxx:62
@ E_SERVICE
it's a service
Definition: joburl.hxx:66
@ E_UNKNOWN
mark a job URL as not valid
Definition: joburl.hxx:60
bool getAlias(OUString &sAlias) const
get the alias item of this job URL @descr Because the three possible parts of such URL (event,...
Definition: joburl.cxx:148
OUString m_sEvent
holds the event part of a job URL
Definition: joburl.hxx:77
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 cou...
Definition: joburl.cxx:209
JobURL(const OUString &sURL)
special ctor @descr It initialize this new instance with a (hopefully) valid job URL.
Definition: joburl.cxx:42
OUString m_sService
holds the service part of a job URL
Definition: joburl.hxx:83
sal_uInt32 m_eRequest
knows the state of this URL instance
Definition: joburl.hxx:74