~ubuntu-branches/ubuntu/feisty/kid3/feisty

« back to all changes in this revision

Viewing changes to kid3/importparser.h

  • Committer: Bazaar Package Importer
  • Author(s): Aurelien Jarno
  • Date: 2004-04-29 02:11:57 UTC
  • Revision ID: james.westby@ubuntu.com-20040429021157-omrdcw8270prqiun
Tags: upstream-0.4
ImportĀ upstreamĀ versionĀ 0.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * \file importparser.h
 
3
 * Import parser.
 
4
 *
 
5
 * \b Project: Kid3
 
6
 * \author Urs Fleisch
 
7
 * \date 17 Sep 2003
 
8
 */
 
9
 
 
10
#ifndef IMPORTPARSER_H
 
11
#define IMPORTPARSER_H
 
12
 
 
13
#include <qstring.h>
 
14
#include <qregexp.h>
 
15
 
 
16
class StandardTags;
 
17
 
 
18
/**
 
19
 * Import parser.
 
20
 */
 
21
class ImportParser {
 
22
public:
 
23
        /**
 
24
         * Set import format.
 
25
         *
 
26
         * @param fmt format regexp
 
27
         * @param enableTrackIncr enable automatic track increment if no %t is found
 
28
         */
 
29
        void setFormat(const QString &fmt, bool enableTrackIncr = false);
 
30
        /**
 
31
         * Get next tags in text buffer.
 
32
         *
 
33
         * @param text text buffer containing data from file or clipboard
 
34
         * @param st   standard tags for output
 
35
         * @param pos  current position in buffer, will be updated to point
 
36
         *             behind current match (to be used for next call)
 
37
         * @return true if tags found (pos is index behind match).
 
38
         */
 
39
        bool getNextTags(const QString &text, StandardTags &st, int &pos);
 
40
 
 
41
private:
 
42
        /** track regexp pattern */
 
43
        QString pattern;
 
44
        /** regexp object */
 
45
        QRegExp re;
 
46
        /** true if automatic track number incrementing is used */
 
47
        bool trackIncrEnabled;
 
48
        /** automatically incremented track number */
 
49
        int trackIncrNr;
 
50
        /** numbers of fields within regexp captures, -1 if not in pattern */
 
51
        int titlePos;
 
52
        int albumPos;
 
53
        int artistPos;
 
54
        int commentPos;
 
55
        int yearPos;
 
56
        int trackPos;
 
57
        int genrePos;
 
58
};
 
59
 
 
60
#endif