PUri.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015-2018 Digital Barriers plc. All rights reserved.
3  * Contact: http://www.digitalbarriers.com/
4  *
5  * This file is part of the Papillon SDK.
6  *
7  * You can't use, modify or distribute any part of this file without
8  * the explicit written agreements of Digital Barriers.
9  */
10 
15 #pragma once
16 #include <PObject.h>
17 
18 PAPILLON_BEGIN_NAMESPACE
19 
20 class PStringList;
21 
43 class PAPILLON_API_CORE PUri : public PObject
44 {
45 public:
51  explicit PUri(const char* uri = "");
52 
58  explicit PUri(const PString& uri);
59 
63  PUri(const PUri& other);
64 
68  virtual ~PUri();
69 
73  PUri& operator=(const PUri& other);
74 
78  bool operator==(const PUri& other) const;
79 
83  bool operator!=(const PUri& other) const;
84 
89  bool IsFile() const;
90 
95  bool IsNetwork() const;
96 
104  PResult CheckScheme(const PStringList& validSchemeList) const;
105 
116  PString GetScheme() const;
117 
127  PString GetUsername() const;
128 
138  PString GetPassword() const;
139 
148  PString GetHost() const;
149 
158  int32 GetPort() const;
159 
168  PString GetAuthority() const;
169 
179  PString GetPath() const;
180 
184  bool HasQuery() const;
185 
189  bool HasQueryItem(const PString& key) const;
190 
199  PString GetQueryString() const;
200 
211  bool GetQueryValue(const PString& key, PString& value) const;
212 
225  bool GetQueryValue(const PString& key, papillon::int32& value) const;
226 
239  bool GetQueryValue(const PString& key, double& value) const;
240 
251  bool RemoveQueryItem(const PString& key);
252 
261  PString GetFragment() const;
262 
273  PResult Encode();
274 
281  PResult Decode();
282 
286  bool IsEncoded() const;
287 
292  bool IsEmpty() const;
293 
298  bool IsValid() const;
299 
303  PString ToStringRemovedUserInfo() const;
304 };
305 
306 PAPILLON_END_NAMESPACE
The PUri class represents an Unified Resource Identifier (URI), this class can also be used to handle...
Definition: PUri.h:43
The PString class provides an Unicode character strings.
Definition: PString.h:37
The PResult class represents the result returned by most of Papillon functions; this class is used to...
Definition: PResult.h:159
The PObject class is the root class of all Papillon classes; all PObject behaves like shared referenc...
Definition: PObject.h:27
The PStringList class represents a list of PString; NOT thread-safe.
Definition: PStringList.h:26
Class PObject: the root class of all Papillon classes.
PObject & operator=(const PObject &obj)
Performs a shared copy of other to this object.
Definition: PObject.h:45