Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
d6576e6a
Commit
d6576e6a
authored
Nov 24, 2011
by
Hugo Beauzée-Luyssen
Committed by
Rémi Denis-Courmont
Nov 24, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dash: Node: Avoiding lots of copies
Signed-off-by:
Rémi Denis-Courmont
<
remi@remlab.net
>
parent
1086074c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
20 deletions
+31
-20
modules/stream_filter/dash/xml/Node.cpp
modules/stream_filter/dash/xml/Node.cpp
+21
-11
modules/stream_filter/dash/xml/Node.h
modules/stream_filter/dash/xml/Node.h
+10
-9
No files found.
modules/stream_filter/dash/xml/Node.cpp
View file @
d6576e6a
...
...
@@ -29,6 +29,8 @@
using
namespace
dash
::
xml
;
const
std
::
string
Node
::
EmptyString
=
""
;
Node
::
Node
()
{
}
...
...
@@ -38,7 +40,7 @@ Node::~Node ()
delete
(
this
->
subNodes
.
at
(
i
));
}
std
::
vector
<
Node
*>
Node
::
getSubNodes
()
const
std
::
vector
<
Node
*>&
Node
::
getSubNodes
()
const
{
return
this
->
subNodes
;
}
...
...
@@ -46,23 +48,29 @@ void Node::addSubNode (Node *node)
{
this
->
subNodes
.
push_back
(
node
);
}
std
::
string
Node
::
getName
()
const
std
::
string
&
Node
::
getName
()
const
{
return
this
->
name
;
}
void
Node
::
setName
(
std
::
string
name
)
void
Node
::
setName
(
const
std
::
string
&
name
)
{
this
->
name
=
name
;
}
std
::
string
Node
::
getAttributeValue
(
std
::
string
key
)
const
std
::
string
&
Node
::
getAttributeValue
(
const
std
::
string
&
key
)
const
{
return
this
->
attributes
[
key
];
std
::
map
<
std
::
string
,
std
::
string
>::
const_iterator
it
=
this
->
attributes
.
find
(
key
);
if
(
it
!=
this
->
attributes
.
end
()
)
return
it
->
second
;
return
EmptyString
;
}
void
Node
::
addAttribute
(
std
::
string
key
,
std
::
string
value
)
void
Node
::
addAttribute
(
const
std
::
string
&
key
,
const
std
::
string
&
value
)
{
this
->
attributes
[
key
]
=
value
;
}
std
::
vector
<
std
::
string
>
Node
::
getAttributeKeys
()
std
::
vector
<
std
::
string
>
Node
::
getAttributeKeys
()
const
{
std
::
vector
<
std
::
string
>
keys
;
std
::
map
<
std
::
string
,
std
::
string
>::
const_iterator
it
;
...
...
@@ -73,15 +81,17 @@ std::vector<std::string> Node::getAttributeKeys ()
}
return
keys
;
}
bool
Node
::
hasText
()
bool
Node
::
hasText
()
const
{
return
false
;
}
std
::
string
Node
::
getText
()
const
std
::
string
&
Node
::
getText
()
const
{
return
""
;
return
EmptyString
;
}
std
::
map
<
std
::
string
,
std
::
string
>
Node
::
getAttributes
()
const
std
::
map
<
std
::
string
,
std
::
string
>&
Node
::
getAttributes
()
const
{
return
this
->
attributes
;
}
modules/stream_filter/dash/xml/Node.h
View file @
d6576e6a
...
...
@@ -40,18 +40,19 @@ namespace dash
Node
();
virtual
~
Node
();
std
::
vector
<
Node
*>
getSubNodes
()
;
const
std
::
vector
<
Node
*>&
getSubNodes
()
const
;
void
addSubNode
(
Node
*
node
);
std
::
string
getName
()
;
void
setName
(
std
::
string
name
);
void
addAttribute
(
std
::
string
key
,
std
::
string
value
);
std
::
string
getAttributeValue
(
std
::
string
key
)
;
std
::
vector
<
std
::
string
>
getAttributeKeys
();
bool
hasText
();
std
::
string
getText
()
;
std
::
map
<
std
::
string
,
std
::
string
>
getAttributes
()
;
const
std
::
string
&
getName
()
const
;
void
setName
(
const
std
::
string
&
name
);
void
addAttribute
(
const
std
::
string
&
key
,
const
std
::
string
&
value
);
const
std
::
string
&
getAttributeValue
(
const
std
::
string
&
key
)
const
;
std
::
vector
<
std
::
string
>
getAttributeKeys
()
const
;
bool
hasText
()
const
;
const
std
::
string
&
getText
()
const
;
const
std
::
map
<
std
::
string
,
std
::
string
>&
getAttributes
()
const
;
private:
static
const
std
::
string
EmptyString
;
std
::
vector
<
Node
*>
subNodes
;
std
::
map
<
std
::
string
,
std
::
string
>
attributes
;
std
::
string
name
;
...
...
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