MPD 0.20.6

- Main Page
- Namespaces
- Data Structures
- Files

- File List
- Globals

CueParser.hxx
Go to the documentation of this file.
1 /*
2 * Copyright 2003-2017 The Music Player Daemon Project
3 * http://www.musicpd.org
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #ifndef MPD_CUE_PARSER_HXX
21 #define MPD_CUE_PARSER_HXX
22
23 #include "check.h"
24 #include "DetachedSong.hxx"
25 #include "tag/TagBuilder.hxx"
26 #include "Compiler.h"
27
28 #include <string>
29 #include <memory>
30
31 class CueParser {
32 enum {
36 HEADER,
37
41 WAVE,
42
46 IGNORE_FILE,
47
51 TRACK,
52
56 IGNORE_TRACK,
57 } state = HEADER;
58
62 TagBuilder header_tag;
63
69 TagBuilder song_tag;
70
71 std::string filename;
72
76 std::unique_ptr<DetachedSong> current;
77
82 std::unique_ptr<DetachedSong> previous;
83
88 std::unique_ptr<DetachedSong> finished;
89
94 bool end = false;
95
96 public:
101 void Feed(const char *line);
102
108 void Finish();
109
117 std::unique_ptr<DetachedSong> Get();
118
119 private:
120 gcc_pure
121 TagBuilder *GetCurrentTag();
122
128 void Commit();
129
130 void Feed2(char *p);
131 };
132
133 #endif
check.h
TagBuilder.hxx
CueParser
Definition: CueParser.hxx:31
CueParser::Feed
void Feed(const char *line)
Feed a text line from the CUE file into the parser.
TagBuilder
A class that constructs Tag objects.
Definition: TagBuilder.hxx:36
DetachedSong.hxx
CueParser::Finish
void Finish()
Tell the parser that the end of the file has been reached.
Compiler.h
CueParser::Get
std::unique_ptr< DetachedSong > Get()
Check if a song was finished by the last Feed() or Finish() call.
gcc_pure
#define gcc_pure
Definition: Compiler.h:116