Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
10d215bc
Commit
10d215bc
authored
10 years ago
by
Ruud Overeem
Browse files
Options
Downloads
Patches
Plain Diff
Task #7342; Fixed bug in XML parser.
parent
7cca2ac3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
LCS/MessageBus/src/Message.cc
+12
-12
12 additions, 12 deletions
LCS/MessageBus/src/Message.cc
with
12 additions
and
12 deletions
LCS/MessageBus/src/Message.cc
+
12
−
12
View file @
10d215bc
...
@@ -69,8 +69,6 @@ Message::Message(const std::string &from,
...
@@ -69,8 +69,6 @@ Message::Message(const std::string &from,
itsQpidMsg
.
setContent
(
formatString
(
LOFAR_MSG_TEMPLATE
.
c_str
(),
protocol
.
c_str
(),
protocolVersion
.
c_str
(),
itsQpidMsg
.
setContent
(
formatString
(
LOFAR_MSG_TEMPLATE
.
c_str
(),
protocol
.
c_str
(),
protocolVersion
.
c_str
(),
from
.
c_str
(),
forUser
.
c_str
(),
""
,
""
,
summary
.
c_str
(),
from
.
c_str
(),
forUser
.
c_str
(),
""
,
""
,
summary
.
c_str
(),
momid
.
c_str
(),
sasid
.
c_str
(),
"%s"
));
momid
.
c_str
(),
sasid
.
c_str
(),
"%s"
));
cout
<<
itsQpidMsg
.
getContent
()
<<
endl
;
}
}
// Read a message from disk (header + payload)
// Read a message from disk (header + payload)
...
@@ -84,12 +82,12 @@ Message::~Message()
...
@@ -84,12 +82,12 @@ Message::~Message()
void
Message
::
setXMLPayload
(
const
std
::
string
&
payload
)
void
Message
::
setXMLPayload
(
const
std
::
string
&
payload
)
{
{
itsQpidMsg
.
setContent
(
formatString
(
itsQpidMsg
.
getContent
().
c_str
(),
payload
.
c_str
()));
itsQpidMsg
.
setContent
(
format
l
String
(
itsQpidMsg
.
getContent
().
c_str
(),
payload
.
c_str
()));
}
}
void
Message
::
setTXTPayload
(
const
std
::
string
&
payload
)
void
Message
::
setTXTPayload
(
const
std
::
string
&
payload
)
{
{
itsQpidMsg
.
setContent
(
formatString
(
itsQpidMsg
.
getContent
().
c_str
(),
payload
.
c_str
()));
itsQpidMsg
.
setContent
(
format
l
String
(
itsQpidMsg
.
getContent
().
c_str
(),
payload
.
c_str
()));
}
}
void
Message
::
setMapPayload
(
const
qpid
::
types
::
Variant
::
Map
&
payload
)
void
Message
::
setMapPayload
(
const
qpid
::
types
::
Variant
::
Map
&
payload
)
...
@@ -135,21 +133,23 @@ string Message::getXMLvalue(const string& key) const
...
@@ -135,21 +133,23 @@ string Message::getXMLvalue(const string& key) const
string
::
size_type
offset
=
0
;
string
::
size_type
offset
=
0
;
string
::
size_type
begin
;
string
::
size_type
begin
;
string
::
size_type
end
;
string
::
size_type
end
;
string
startTag
;
for
(
size_t
i
=
0
;
i
<
labels
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
labels
.
size
();
++
i
)
{
// define tags to find
// define tags to find
string
startTag
(
"<"
+
labels
[
i
]
+
">"
);
startTag
=
string
(
"<"
+
labels
[
i
]
+
">"
);
string
stopTag
(
"</"
+
labels
[
i
]
+
">"
);
// search begin tag
// search begin tag
begin
=
content
.
find
(
startTag
,
offset
);
begin
=
content
.
find
(
startTag
,
offset
);
if
(
begin
==
string
::
npos
)
{
if
(
begin
==
string
::
npos
)
{
return
(
"???"
);
return
(
"???"
);
}
}
// search end tag
offset
=
begin
;
begin
+=
startTag
.
size
();
}
end
=
content
.
find
(
stopTag
,
begin
);
// search end tag
if
(
end
==
string
::
npos
)
{
string
stopTag
(
"</"
+
labels
[
labels
.
size
()
-
1
]
+
">"
);
return
(
"???"
);
begin
+=
startTag
.
size
();
}
end
=
content
.
find
(
stopTag
,
begin
);
if
(
end
==
string
::
npos
)
{
return
(
"???"
);
}
}
return
(
content
.
substr
(
begin
,
end
-
begin
));
return
(
content
.
substr
(
begin
,
end
-
begin
));
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment