Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
451
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
cf3b1cf5
Commit
cf3b1cf5
authored
9 years ago
by
François Cartegnie
Browse files
Options
Downloads
Patches
Plain Diff
demux: adaptative: add tokenizer helper
parent
20375e97
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/demux/adaptative/tools/Helper.cpp
+16
-0
16 additions, 0 deletions
modules/demux/adaptative/tools/Helper.cpp
modules/demux/adaptative/tools/Helper.h
+2
-0
2 additions, 0 deletions
modules/demux/adaptative/tools/Helper.h
with
18 additions
and
0 deletions
modules/demux/adaptative/tools/Helper.cpp
+
16
−
0
View file @
cf3b1cf5
...
...
@@ -60,3 +60,19 @@ bool Helper::ifind(std::string haystack, std::string needle)
transform
(
needle
.
begin
(),
needle
.
end
(),
needle
.
begin
(),
toupper
);
return
haystack
.
find
(
needle
)
!=
std
::
string
::
npos
;
}
std
::
list
<
std
::
string
>
Helper
::
tokenize
(
const
std
::
string
&
str
,
char
c
)
{
std
::
list
<
std
::
string
>
ret
;
std
::
size_t
prev
=
0
;
std
::
size_t
cur
=
str
.
find_first_of
(
c
,
0
);
while
(
cur
!=
std
::
string
::
npos
)
{
ret
.
push_back
(
str
.
substr
(
prev
,
cur
-
prev
));
prev
=
cur
+
1
;
cur
=
str
.
find_first_of
(
c
,
cur
+
1
);
}
ret
.
push_back
(
str
.
substr
(
prev
));
return
ret
;
}
This diff is collapsed.
Click to expand it.
modules/demux/adaptative/tools/Helper.h
+
2
−
0
View file @
cf3b1cf5
...
...
@@ -26,6 +26,7 @@
#define HELPER_H_
#include
<string>
#include
<list>
namespace
adaptative
{
...
...
@@ -35,6 +36,7 @@ namespace adaptative
static
std
::
string
combinePaths
(
const
std
::
string
&
path1
,
const
std
::
string
&
path2
);
static
std
::
string
getDirectoryPath
(
const
std
::
string
&
path
);
static
bool
ifind
(
std
::
string
haystack
,
std
::
string
needle
);
static
std
::
list
<
std
::
string
>
tokenize
(
const
std
::
string
&
,
char
);
};
}
...
...
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