Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
freeopcua
src
core
common
uri_facade_lin_noregex.cpp
Go to the documentation of this file.
1
11
#include <
opc/common/uri_facade.h
>
12
13
#include <
opc/common/exception.h
>
14
15
#include <libxml/uri.h>
16
17
namespace
Common
18
{
19
20
void
Uri::Initialize
(
const
std::string
& uriString)
21
{
22
xmlURIPtr
uri
= xmlParseURI(uriString.c_str());
23
if
(!uri)
24
{
25
THROW_ERROR1
(
CannotParseUri
, uriString);
26
}
27
28
if
(uri->scheme)
29
{
30
SchemeStr
= uri->scheme;
31
}
32
33
if
(uri->user)
34
{
35
UserStr
= uri->user;
36
int
ix =
UserStr
.find(
':'
);
37
38
if
(ix > 0)
39
{
40
PasswordStr
=
UserStr
.substr(ix + 1);
41
UserStr
=
UserStr
.substr(0, ix);
42
}
43
}
44
45
if
(uri->server)
46
{
47
HostStr
= uri->server;
48
}
49
50
PortNum
= uri->port;
51
xmlFreeURI(uri);
52
53
if
(
SchemeStr
.empty() ||
HostStr
.empty())
54
{
55
THROW_ERROR1
(
CannotParseUri
, uriString);
56
}
57
}
58
59
}
// namespace Common
Common
Addon interface definition GNU LGPL.
Definition:
common/addons_core/addon.h:19
testing::internal::string
::std::string string
Definition:
gmock/fused-src/gtest/gtest.h:2070
Common::Uri::Initialize
void Initialize(const std::string &uriString)
Definition:
uri_facade_lin.cpp:21
Common::Uri::PasswordStr
std::string PasswordStr
Definition:
uri_facade.h:57
exception.h
Common::Uri::SchemeStr
std::string SchemeStr
Definition:
uri_facade.h:55
Common::Uri::PortNum
unsigned PortNum
Definition:
uri_facade.h:59
client.uri
string uri
Definition:
client.py:31
Common::Uri::UserStr
std::string UserStr
Definition:
uri_facade.h:56
THROW_ERROR1
#define THROW_ERROR1(data, param1)
Definition:
exception.h:212
Common::Uri::HostStr
std::string HostStr
Definition:
uri_facade.h:58
CannotParseUri
Common::ErrorData CannotParseUri
uri_facade.h
ros_opcua_impl_freeopcua
Author(s): Denis Štogl
autogenerated on Tue Jan 19 2021 03:12:08