kodi
DVDSubtitleTagSami.h
1 /*
2  * Copyright (C) 2005-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include <stdio.h>
12 #include <string>
13 #include <vector>
14 
15 #define FLAG_BOLD 0
16 #define FLAG_ITALIC 1
17 #define FLAG_UNDERLINE 2
18 #define FLAG_STRIKETHROUGH 3
19 #define FLAG_COLOR 4
20 #define FLAG_LANGUAGE 5
21 
22 class CDVDSubtitleStream;
23 class CRegExp;
24 
26 {
27 public:
29  {
30  m_tags = NULL;
31  m_tagOptions = NULL;
32  m_flag[FLAG_BOLD] = false;
33  m_flag[FLAG_ITALIC] = false;
34  m_flag[FLAG_UNDERLINE] = false;
35  m_flag[FLAG_STRIKETHROUGH] = false;
36  m_flag[FLAG_COLOR] = false;
37  m_flag[FLAG_LANGUAGE] = false; //set to true when classID != lang
38  }
39  virtual ~CDVDSubtitleTagSami();
40  bool Init();
47  void ConvertLine(std::string& strUTF8, const char* langClassID = NULL);
48  void CloseTag(std::string& text);
49  void LoadHead(CDVDSubtitleStream* samiStream);
50 
51  typedef struct
52  {
53  std::string ID;
54  std::string Name;
55  std::string Lang;
56  std::string SAMIType;
57  } SLangclass;
58 
59  std::vector<SLangclass> m_Langclass;
60 
61 private:
62  CRegExp* m_tags;
63  CRegExp* m_tagOptions;
64  bool m_flag[6];
65 };
Definition: DVDSubtitleStream.h:21
Definition: DVDSubtitleTagSami.h:25
Definition: RegExp.h:27
Definition: DVDSubtitleTagSami.h:51
void ConvertLine(std::string &strUTF8, const char *langClassID=NULL)
Convert a subtitle text line.
Definition: DVDSubtitleTagSami.cpp:82