Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@users.sourceforge.net>2010-04-09 18:12:59 +0400
committerXhmikosR <xhmikosr@users.sourceforge.net>2010-04-09 18:12:59 +0400
commitefbc9d9043ff8ff92716ddd00a5f61412d535593 (patch)
tree8f3e621f756cf1f5b4d64d97964c7e7abd8aaf08 /src/subtitles/RealTextParser.h
parentdf6b139a6d9027156f614b68687e039e3a5854db (diff)
revert r1783
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1785 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/subtitles/RealTextParser.h')
-rw-r--r--src/subtitles/RealTextParser.h102
1 files changed, 51 insertions, 51 deletions
diff --git a/src/subtitles/RealTextParser.h b/src/subtitles/RealTextParser.h
index a297914f5..06247e430 100644
--- a/src/subtitles/RealTextParser.h
+++ b/src/subtitles/RealTextParser.h
@@ -24,79 +24,79 @@ using std::towlower;
class CRealTextParser
{
public:
- CRealTextParser();
- virtual ~CRealTextParser(void);
+ CRealTextParser();
+ virtual ~CRealTextParser(void);
- struct Tag
- {
- Tag(): m_bOpen(false), m_bClose(false), m_bComment(false), m_bText(false) {}
+ struct Tag
+ {
+ Tag(): m_bOpen(false), m_bClose(false), m_bComment(false), m_bText(false) {}
- wstring m_szName;
+ wstring m_szName;
- bool m_bOpen;
- bool m_bClose;
+ bool m_bOpen;
+ bool m_bClose;
- bool m_bComment;
- bool m_bText;
+ bool m_bComment;
+ bool m_bText;
- map<wstring, wstring> m_mapAttributes;
- };
+ map<wstring, wstring> m_mapAttributes;
+ };
- struct Subtitles
- {
- Subtitles(): m_WindowTag(), m_FontTag(), m_bCenter(false) {}
+ struct Subtitles
+ {
+ Subtitles(): m_WindowTag(), m_FontTag(), m_bCenter(false) {}
- Tag m_WindowTag;
- Tag m_FontTag;
+ Tag m_WindowTag;
+ Tag m_FontTag;
- bool m_bCenter;
+ bool m_bCenter;
- map<pair<int, int>, wstring> m_mapLines;
- };
+ map<pair<int, int>, wstring> m_mapLines;
+ };
- bool ParseRealText(wstring p_szFile);
+ bool ParseRealText(wstring p_szFile);
- const Subtitles& GetParsedSubtitles();
+ const Subtitles& GetParsedSubtitles();
- bool OutputSRT(wostream& p_rOutput);
+ bool OutputSRT(wostream& p_rOutput);
private:
- bool ExtractTag(wstring& p_rszLine, Tag& p_rTag);
- bool ExtractTextTag(wstring& p_rszLine, Tag& p_rTag);
- bool ExtractString(wstring& p_rszLine, wstring& p_rszString);
- bool SkipSpaces(wstring& p_rszLine, unsigned int& p_riPos);
- bool GetString(wstring& p_rszLine, unsigned int& p_riPos, wstring& p_rszString, const wstring& p_crszEndChars);
- bool GetAttributes(wstring& p_rszLine, unsigned int& p_riPos, map<wstring, wstring>& p_rmapAttributes);
+ bool ExtractTag(wstring& p_rszLine, Tag& p_rTag);
+ bool ExtractTextTag(wstring& p_rszLine, Tag& p_rTag);
+ bool ExtractString(wstring& p_rszLine, wstring& p_rszString);
+ bool SkipSpaces(wstring& p_rszLine, unsigned int& p_riPos);
+ bool GetString(wstring& p_rszLine, unsigned int& p_riPos, wstring& p_rszString, const wstring& p_crszEndChars);
+ bool GetAttributes(wstring& p_rszLine, unsigned int& p_riPos, map<wstring, wstring>& p_rmapAttributes);
- int GetTimecode(const wstring& p_crszTimecode);
- wstring FormatTimecode(int iTimecode,
- int iMillisecondPrecision = 3,
- bool p_bPadZeroes = true,
- const wstring& p_crszSeparator = L":",
- const wstring& p_crszMillisecondSeparator = L".");
+ int GetTimecode(const wstring& p_crszTimecode);
+ wstring FormatTimecode(int iTimecode,
+ int iMillisecondPrecision = 3,
+ bool p_bPadZeroes = true,
+ const wstring& p_crszSeparator = L":",
+ const wstring& p_crszMillisecondSeparator = L".");
- wstring StringToLower(const wstring& p_crszString);
+ wstring StringToLower(const wstring& p_crszString);
- wstring RenderTags(const list<Tag>& p_crlTags);
+ wstring RenderTags(const list<Tag>& p_crlTags);
- void PopTag(list<Tag>& p_rlistTags, const wstring& p_crszTagName);
+ void PopTag(list<Tag>& p_rlistTags, const wstring& p_crszTagName);
- // Filter out for example multiple font tags opened previously (font tags are not always terminated properly in realtext and can build up)
- void FilterReduntantTags(list<Tag>& p_rlistTags);
+ // Filter out for example multiple font tags opened previously (font tags are not always terminated properly in realtext and can build up)
+ void FilterReduntantTags(list<Tag>& p_rlistTags);
+
+ Subtitles m_RealText;
- Subtitles m_RealText;
+ bool m_bIgnoreFont;
+ bool m_bIgnoreFontSize;
+ bool m_bIgnoreFontColor;
+ bool m_bIgnoreFontWeight;
+ bool m_bIgnoreFontFace;
- bool m_bIgnoreFont;
- bool m_bIgnoreFontSize;
- bool m_bIgnoreFontColor;
- bool m_bIgnoreFontWeight;
- bool m_bIgnoreFontFace;
+ int m_iMinFontSize;
+ int m_iMaxFontSize;
- int m_iMinFontSize;
- int m_iMaxFontSize;
+ int m_iDefaultSubtitleDurationInMillisecs;
- int m_iDefaultSubtitleDurationInMillisecs;
-
- bool m_bTryToIgnoreErrors;
+ bool m_bTryToIgnoreErrors;
};