SiftSRT is a single header, simple and complete SRT parsing and editing library. It allows easy handling, processing and modifying subtitle files in SRT format. It is fast and efficient. It is an extension of a simple subtitle-parser by Oleksii Maryshchenko which was modified as simple-yet-powerful-subtitle-parser by Saurabh Shrivastava.
demo directory contains usage examples. Check it out.
- Download the header file
SiftSRT.hfrom SiftSRT. - As any other header file,
includeit in your program.
Create a SubtitleParserFactory object using the subtitle file to be edited.
SubtitleParserFactory* spf = new SubtitleParserFactory("inputFile.srt");
Use the SubtitleParserFactory object get a SubtitleParser object. Use this to get the subtitles.
SubtitleParser* sub;
sub = spf->getParser();
std::vector<SubtitleItem*> sub;
sub = parser->getSubtitles();
Using the SubtitleParser object create a co_oCCurEditor object.
co_oCCurEditor* edit;
edit = new co_oCCurEditor(sub);
Using the SubtitleParser object create a co_oCCurParser object.
co_oCCurParser* parse;
parse = new co_oCCurParser(sub);
The objects sub, edit and parse can be used to sift the given SRT file and are to be used for Subtitle Parsing and Editing.
An extensive list of all the methods can be found @ sypai.github.io/SiftSRT.
Contributions of any kind, suggestions, feedback, bug reports/fixes are will be highly appreciated!