Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
34fabb83
Commit
34fabb83
authored
Dec 25, 2011
by
Hugo Beauzée-Luyssen
Committed by
Jean-Baptiste Kempf
Dec 30, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dash: XML: handle text nodes.
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
8ceecb11
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
13 deletions
+50
-13
modules/stream_filter/dash/xml/DOMParser.cpp
modules/stream_filter/dash/xml/DOMParser.cpp
+16
-11
modules/stream_filter/dash/xml/Node.cpp
modules/stream_filter/dash/xml/Node.cpp
+29
-2
modules/stream_filter/dash/xml/Node.h
modules/stream_filter/dash/xml/Node.h
+5
-0
No files found.
modules/stream_filter/dash/xml/DOMParser.cpp
View file @
34fabb83
...
...
@@ -74,24 +74,29 @@ Node* DOMParser::processNode ()
{
const
char
*
data
;
int
type
=
xml_ReaderNextNode
(
this
->
vlc_reader
,
&
data
);
if
(
type
!=
-
1
&&
type
!=
XML_READER_
TEXT
&&
type
!=
XML_READER_
NONE
&&
type
!=
XML_READER_ENDELEM
)
if
(
type
!=
-
1
&&
type
!=
XML_READER_NONE
&&
type
!=
XML_READER_ENDELEM
)
{
Node
*
node
=
new
Node
();
node
->
setType
(
type
);
std
::
string
name
=
data
;
bool
isEmpty
=
xml_ReaderIsEmptyElement
(
this
->
vlc_reader
);
node
->
setName
(
name
);
if
(
type
!=
XML_READER_TEXT
)
{
std
::
string
name
=
data
;
bool
isEmpty
=
xml_ReaderIsEmptyElement
(
this
->
vlc_reader
);
node
->
setName
(
name
);
this
->
addAttributesToNode
(
node
);
this
->
addAttributesToNode
(
node
);
if
(
isEmpty
)
return
node
;
if
(
isEmpty
)
return
node
;
Node
*
subnode
=
NULL
;
while
((
subnode
=
this
->
processNode
())
!=
NULL
)
node
->
addSubNode
(
subnode
);
Node
*
subnode
=
NULL
;
while
((
subnode
=
this
->
processNode
())
!=
NULL
)
node
->
addSubNode
(
subnode
);
}
else
node
->
setText
(
data
);
return
node
;
}
return
NULL
;
...
...
modules/stream_filter/dash/xml/Node.cpp
View file @
34fabb83
...
...
@@ -27,11 +27,16 @@
#include "Node.h"
#include <cassert>
#include <vlc_common.h>
#include <vlc_xml.h>
using
namespace
dash
::
xml
;
const
std
::
string
Node
::
EmptyString
=
""
;
Node
::
Node
()
Node
::
Node
()
:
type
(
-
1
)
{
}
Node
::~
Node
()
...
...
@@ -89,9 +94,31 @@ bool Node::hasText () const
const
std
::
string
&
Node
::
getText
()
const
{
return
EmptyString
;
if
(
this
->
type
==
XML_READER_TEXT
)
return
this
->
text
;
else
{
assert
(
this
->
subNodes
.
size
()
==
1
);
return
this
->
subNodes
[
0
]
->
getText
();
}
}
void
Node
::
setText
(
const
std
::
string
&
text
)
{
this
->
text
=
text
;
}
const
std
::
map
<
std
::
string
,
std
::
string
>&
Node
::
getAttributes
()
const
{
return
this
->
attributes
;
}
int
Node
::
getType
()
const
{
return
this
->
type
;
}
void
Node
::
setType
(
int
type
)
{
this
->
type
=
type
;
}
modules/stream_filter/dash/xml/Node.h
View file @
34fabb83
...
...
@@ -49,13 +49,18 @@ namespace dash
std
::
vector
<
std
::
string
>
getAttributeKeys
()
const
;
bool
hasText
()
const
;
const
std
::
string
&
getText
()
const
;
void
setText
(
const
std
::
string
&
text
);
const
std
::
map
<
std
::
string
,
std
::
string
>&
getAttributes
()
const
;
int
getType
()
const
;
void
setType
(
int
type
);
private:
static
const
std
::
string
EmptyString
;
std
::
vector
<
Node
*>
subNodes
;
std
::
map
<
std
::
string
,
std
::
string
>
attributes
;
std
::
string
name
;
std
::
string
text
;
int
type
;
};
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment