xbmc
DVDSubtitleStream.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 "utils/CharArrayParser.h"
12 
13 #include <sstream>
14 #include <string>
15 #include <vector>
16 
17 class CDVDInputStream;
18 
19 // buffered class for subtitle reading
20 
22 {
23 public:
25  virtual ~CDVDSubtitleStream();
26 
27  bool Open(const std::string& strFile);
28 
33  bool IsIncompatible(CDVDInputStream* pInputStream, std::vector<uint8_t>& buf, size_t* bytesRead);
34 
40  std::string Read(int length);
41 
47  bool Seek(int offset);
48 
54  bool ReadLine(std::string& line);
55 
60  const std::string& GetData() { return m_subtitleData; }
61 
62 private:
63  std::string m_subtitleData;
64  CCharArrayParser m_arrayParser;
65 };
Wraps a char array, providing a set of methods for parsing data from it.
Definition: CharArrayParser.h:17
Definition: DVDSubtitleStream.h:21
Definition: DVDInputStream.h:50
bool ReadLine(std::string &line)
Read a line of data.
Definition: DVDSubtitleStream.cpp:135
bool Seek(int offset)
Change the current data position to the specified offset.
Definition: DVDSubtitleStream.cpp:130
const std::string & GetData()
Get the full data.
Definition: DVDSubtitleStream.h:60
bool IsIncompatible(CDVDInputStream *pInputStream, std::vector< uint8_t > &buf, size_t *bytesRead)
Checks if the subtitle associated with the pInputStream is known to be incompatible, e.g., vob sub files.
Definition: DVDSubtitleStream.cpp:96
std::string Read(int length)
Read some data of specified length, from the current position.
Definition: DVDSubtitleStream.cpp:125