5 using std::wostringstream
;
28 virtual ~CRealTextParser(void);
32 Tag(): m_bOpen(false), m_bClose(false), m_bComment(false), m_bText(false) {}
42 map
<wstring
, wstring
> m_mapAttributes
;
47 Subtitles(): m_WindowTag(), m_FontTag(), m_bCenter(false) {}
54 map
<pair
<int, int>, wstring
> m_mapLines
;
57 bool ParseRealText(wstring p_szFile
);
59 const Subtitles
& GetParsedSubtitles();
61 bool OutputSRT(wostream
& p_rOutput
);
64 bool ExtractTag(wstring
& p_rszLine
, Tag
& p_rTag
);
65 bool ExtractTextTag(wstring
& p_rszLine
, Tag
& p_rTag
);
66 bool ExtractString(wstring
& p_rszLine
, wstring
& p_rszString
);
67 bool SkipSpaces(wstring
& p_rszLine
, unsigned int& p_riPos
);
68 bool GetString(wstring
& p_rszLine
, unsigned int& p_riPos
, wstring
& p_rszString
, const wstring
& p_crszEndChars
);
69 bool GetAttributes(wstring
& p_rszLine
, unsigned int& p_riPos
, map
<wstring
, wstring
>& p_rmapAttributes
);
71 int GetTimecode(const wstring
& p_crszTimecode
);
72 wstring
FormatTimecode(int iTimecode
,
73 int iMillisecondPrecision
= 3,
74 bool p_bPadZeroes
= true,
75 const wstring
& p_crszSeparator
= L
":",
76 const wstring
& p_crszMillisecondSeparator
= L
".");
78 wstring
StringToLower(const wstring
& p_crszString
);
80 wstring
RenderTags(const list
<Tag
>& p_crlTags
);
82 void PopTag(list
<Tag
>& p_rlistTags
, const wstring
& p_crszTagName
);
84 // Filter out for example multiple font tags opened previously (font tags are not always terminated properly in realtext and can build up)
85 void FilterReduntantTags(list
<Tag
>& p_rlistTags
);
91 bool m_bIgnoreFontSize
;
92 bool m_bIgnoreFontColor
;
93 bool m_bIgnoreFontWeight
;
94 bool m_bIgnoreFontFace
;
99 int m_iDefaultSubtitleDurationInMillisecs
;
101 bool m_bTryToIgnoreErrors
;