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
a3e28c2d
Commit
a3e28c2d
authored
Feb 08, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag/Tag: move tag_name_parse() to ParseName.cxx
parent
03a97d87
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
110 additions
and
58 deletions
+110
-58
Makefile.am
Makefile.am
+1
-0
SongFilter.cxx
src/SongFilter.cxx
+1
-1
SongSave.cxx
src/SongSave.cxx
+1
-0
DatabaseCommands.cxx
src/command/DatabaseCommands.cxx
+1
-1
TagCommands.cxx
src/command/TagCommands.cxx
+1
-1
DatabaseSave.cxx
src/db/plugins/simple/DatabaseSave.cxx
+1
-1
OpusTags.cxx
src/decoder/plugins/OpusTags.cxx
+1
-1
CueParser.cxx
src/playlist/cue/CueParser.cxx
+1
-1
ApeTag.cxx
src/tag/ApeTag.cxx
+1
-1
Config.cxx
src/tag/Config.cxx
+1
-1
Format.cxx
src/tag/Format.cxx
+1
-0
ParseName.cxx
src/tag/ParseName.cxx
+55
-0
ParseName.hxx
src/tag/ParseName.hxx
+44
-0
Tag.cxx
src/tag/Tag.cxx
+0
-32
Tag.hxx
src/tag/Tag.hxx
+0
-18
No files found.
Makefile.am
View file @
a3e28c2d
...
...
@@ -913,6 +913,7 @@ libtag_a_SOURCES =\
src/tag/Mask.hxx
\
src/tag/Settings.cxx src/tag/Settings.hxx
\
src/tag/Config.cxx src/tag/Config.hxx
\
src/tag/ParseName.cxx src/tag/ParseName.hxx
\
src/tag/Names.c
\
src/tag/FixString.cxx src/tag/FixString.hxx
\
src/tag/Pool.cxx src/tag/Pool.hxx
\
...
...
src/SongFilter.cxx
View file @
a3e28c2d
...
...
@@ -21,7 +21,7 @@
#include "SongFilter.hxx"
#include "db/LightSong.hxx"
#include "DetachedSong.hxx"
#include "tag/
Tag
.hxx"
#include "tag/
ParseName
.hxx"
#include "util/ConstBuffer.hxx"
#include "util/StringAPI.hxx"
#include "util/ASCII.hxx"
...
...
src/SongSave.cxx
View file @
a3e28c2d
...
...
@@ -24,6 +24,7 @@
#include "TagSave.hxx"
#include "fs/io/TextFile.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "tag/ParseName.hxx"
#include "tag/Tag.hxx"
#include "tag/Builder.hxx"
#include "util/StringUtil.hxx"
...
...
src/command/DatabaseCommands.cxx
View file @
a3e28c2d
...
...
@@ -28,7 +28,7 @@
#include "CommandError.hxx"
#include "client/Client.hxx"
#include "client/Response.hxx"
#include "tag/
Tag
.hxx"
#include "tag/
ParseName
.hxx"
#include "util/ConstBuffer.hxx"
#include "util/StringAPI.hxx"
#include "SongFilter.hxx"
...
...
src/command/TagCommands.cxx
View file @
a3e28c2d
...
...
@@ -22,7 +22,7 @@
#include "Request.hxx"
#include "client/Client.hxx"
#include "client/Response.hxx"
#include "tag/
Tag
.hxx"
#include "tag/
ParseName
.hxx"
#include "Partition.hxx"
#include "util/ConstBuffer.hxx"
...
...
src/db/plugins/simple/DatabaseSave.cxx
View file @
a3e28c2d
...
...
@@ -24,7 +24,7 @@
#include "DirectorySave.hxx"
#include "fs/io/BufferedOutputStream.hxx"
#include "fs/io/TextFile.hxx"
#include "tag/
Tag
.hxx"
#include "tag/
ParseName
.hxx"
#include "tag/Settings.hxx"
#include "fs/Charset.hxx"
#include "util/StringCompare.hxx"
...
...
src/decoder/plugins/OpusTags.cxx
View file @
a3e28c2d
...
...
@@ -22,7 +22,7 @@
#include "OpusReader.hxx"
#include "lib/xiph/XiphTags.hxx"
#include "tag/Handler.hxx"
#include "tag/
Tag
.hxx"
#include "tag/
ParseName
.hxx"
#include "ReplayGainInfo.hxx"
#include <stdint.h>
...
...
src/playlist/cue/CueParser.cxx
View file @
a3e28c2d
...
...
@@ -19,10 +19,10 @@
#include "config.h"
#include "CueParser.hxx"
#include "tag/ParseName.hxx"
#include "util/Alloc.hxx"
#include "util/StringUtil.hxx"
#include "util/CharUtil.hxx"
#include "tag/Tag.hxx"
#include <assert.h>
#include <string.h>
...
...
src/tag/ApeTag.cxx
View file @
a3e28c2d
...
...
@@ -20,7 +20,7 @@
#include "config.h"
#include "ApeTag.hxx"
#include "ApeLoader.hxx"
#include "
Tag
.hxx"
#include "
ParseName
.hxx"
#include "Table.hxx"
#include "Handler.hxx"
#include "util/StringView.hxx"
...
...
src/tag/Config.cxx
View file @
a3e28c2d
...
...
@@ -20,7 +20,7 @@
#include "config.h"
#include "Config.hxx"
#include "Settings.hxx"
#include "
Tag
.hxx"
#include "
ParseName
.hxx"
#include "config/ConfigGlobal.hxx"
#include "config/ConfigOption.hxx"
#include "system/FatalError.hxx"
...
...
src/tag/Format.cxx
View file @
a3e28c2d
...
...
@@ -20,6 +20,7 @@
#include "config.h"
#include "Format.hxx"
#include "Tag.hxx"
#include "ParseName.hxx"
#include "util/format.h"
#include "util/StringUtil.hxx"
...
...
src/tag/ParseName.cxx
0 → 100644
View file @
a3e28c2d
/*
* Copyright 2003-2017 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "ParseName.hxx"
#include "util/ASCII.hxx"
#include <assert.h>
#include <string.h>
TagType
tag_name_parse
(
const
char
*
name
)
{
assert
(
name
!=
nullptr
);
for
(
unsigned
i
=
0
;
i
<
TAG_NUM_OF_ITEM_TYPES
;
++
i
)
{
assert
(
tag_item_names
[
i
]
!=
nullptr
);
if
(
strcmp
(
name
,
tag_item_names
[
i
])
==
0
)
return
(
TagType
)
i
;
}
return
TAG_NUM_OF_ITEM_TYPES
;
}
TagType
tag_name_parse_i
(
const
char
*
name
)
{
assert
(
name
!=
nullptr
);
for
(
unsigned
i
=
0
;
i
<
TAG_NUM_OF_ITEM_TYPES
;
++
i
)
{
assert
(
tag_item_names
[
i
]
!=
nullptr
);
if
(
StringEqualsCaseASCII
(
name
,
tag_item_names
[
i
]))
return
(
TagType
)
i
;
}
return
TAG_NUM_OF_ITEM_TYPES
;
}
src/tag/ParseName.hxx
0 → 100644
View file @
a3e28c2d
/*
* Copyright 2003-2017 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_TAG_PARSE_NAME_HXX
#define MPD_TAG_PARSE_NAME_HXX
#include "Type.h"
#include "Compiler.h"
/**
* Parse the string, and convert it into a #TagType. Returns
* #TAG_NUM_OF_ITEM_TYPES if the string could not be recognized.
*/
gcc_pure
TagType
tag_name_parse
(
const
char
*
name
);
/**
* Parse the string, and convert it into a #TagType. Returns
* #TAG_NUM_OF_ITEM_TYPES if the string could not be recognized.
*
* Case does not matter.
*/
gcc_pure
TagType
tag_name_parse_i
(
const
char
*
name
);
#endif
src/tag/Tag.cxx
View file @
a3e28c2d
...
...
@@ -21,40 +21,8 @@
#include "Tag.hxx"
#include "Pool.hxx"
#include "Builder.hxx"
#include "util/ASCII.hxx"
#include <assert.h>
#include <string.h>
TagType
tag_name_parse
(
const
char
*
name
)
{
assert
(
name
!=
nullptr
);
for
(
unsigned
i
=
0
;
i
<
TAG_NUM_OF_ITEM_TYPES
;
++
i
)
{
assert
(
tag_item_names
[
i
]
!=
nullptr
);
if
(
strcmp
(
name
,
tag_item_names
[
i
])
==
0
)
return
(
TagType
)
i
;
}
return
TAG_NUM_OF_ITEM_TYPES
;
}
TagType
tag_name_parse_i
(
const
char
*
name
)
{
assert
(
name
!=
nullptr
);
for
(
unsigned
i
=
0
;
i
<
TAG_NUM_OF_ITEM_TYPES
;
++
i
)
{
assert
(
tag_item_names
[
i
]
!=
nullptr
);
if
(
StringEqualsCaseASCII
(
name
,
tag_item_names
[
i
]))
return
(
TagType
)
i
;
}
return
TAG_NUM_OF_ITEM_TYPES
;
}
void
Tag
::
Clear
()
...
...
src/tag/Tag.hxx
View file @
a3e28c2d
...
...
@@ -196,22 +196,4 @@ struct Tag {
}
};
/**
* Parse the string, and convert it into a #TagType. Returns
* #TAG_NUM_OF_ITEM_TYPES if the string could not be recognized.
*/
gcc_pure
TagType
tag_name_parse
(
const
char
*
name
);
/**
* Parse the string, and convert it into a #TagType. Returns
* #TAG_NUM_OF_ITEM_TYPES if the string could not be recognized.
*
* Case does not matter.
*/
gcc_pure
TagType
tag_name_parse_i
(
const
char
*
name
);
#endif
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