Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
8a5209ad
Commit
8a5209ad
authored
Dec 03, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tag: remove method AddItem()
Use class TagBuilder instead.
parent
308fdf6e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
63 deletions
+8
-63
Tag.cxx
src/tag/Tag.cxx
+0
-40
Tag.hxx
src/tag/Tag.hxx
+0
-21
test_vorbis_encoder.cxx
test/test_vorbis_encoder.cxx
+8
-2
No files found.
src/tag/Tag.cxx
View file @
8a5209ad
...
...
@@ -147,43 +147,3 @@ Tag::HasType(TagType type) const
{
return
GetValue
(
type
)
!=
nullptr
;
}
void
Tag
::
AddItemInternal
(
TagType
type
,
const
char
*
value
,
size_t
len
)
{
unsigned
int
i
=
num_items
;
char
*
p
=
FixTagString
(
value
,
len
);
if
(
p
!=
nullptr
)
{
value
=
p
;
len
=
strlen
(
value
);
}
num_items
++
;
items
=
(
TagItem
**
)
g_realloc
(
items
,
items_size
(
*
this
));
tag_pool_lock
.
lock
();
items
[
i
]
=
tag_pool_get_item
(
type
,
value
,
len
);
tag_pool_lock
.
unlock
();
g_free
(
p
);
}
void
Tag
::
AddItem
(
TagType
type
,
const
char
*
value
,
size_t
len
)
{
if
(
ignore_tag_items
[
type
])
return
;
if
(
value
==
nullptr
||
len
==
0
)
return
;
AddItemInternal
(
type
,
value
,
len
);
}
void
Tag
::
AddItem
(
TagType
type
,
const
char
*
value
)
{
AddItem
(
type
,
value
,
strlen
(
value
));
}
src/tag/Tag.hxx
View file @
8a5209ad
...
...
@@ -104,24 +104,6 @@ struct Tag {
void
Clear
();
/**
* Appends a new tag item.
*
* @param type the type of the new tag item
* @param value the value of the tag item (not null-terminated)
* @param len the length of #value
*/
void
AddItem
(
TagType
type
,
const
char
*
value
,
size_t
len
);
/**
* Appends a new tag item.
*
* @param tag the #tag object
* @param type the type of the new tag item
* @param value the value of the tag item (null-terminated)
*/
void
AddItem
(
TagType
type
,
const
char
*
value
);
/**
* Merges the data from two tags. If both tags share data for the
* same TagType, only data from "add" is used.
*
...
...
@@ -152,9 +134,6 @@ struct Tag {
*/
gcc_pure
bool
HasType
(
TagType
type
)
const
;
private
:
void
AddItemInternal
(
TagType
type
,
const
char
*
value
,
size_t
len
);
};
/**
...
...
test/test_vorbis_encoder.cxx
View file @
8a5209ad
...
...
@@ -24,6 +24,7 @@
#include "ConfigData.hxx"
#include "stdbin.h"
#include "tag/Tag.hxx"
#include "tag/TagBuilder.hxx"
#include "util/Error.hxx"
#include <stddef.h>
...
...
@@ -81,8 +82,13 @@ main(gcc_unused int argc, gcc_unused char **argv)
encoder_to_stdout
(
*
encoder
);
Tag
tag
;
tag
.
AddItem
(
TAG_ARTIST
,
"Foo"
);
tag
.
AddItem
(
TAG_TITLE
,
"Bar"
);
{
TagBuilder
tag_builder
;
tag_builder
.
AddItem
(
TAG_ARTIST
,
"Foo"
);
tag_builder
.
AddItem
(
TAG_TITLE
,
"Bar"
);
tag_builder
.
Commit
(
tag
);
}
success
=
encoder_tag
(
encoder
,
&
tag
,
IgnoreError
());
assert
(
success
);
...
...
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