Creates an object for each input file and parses file and folder names. More...
#include <parser.hpp>
Public Member Functions | |
| Parser () | |
| Default constructor, yields default values. More... | |
| ~Parser () | |
| Default destructor. More... | |
| void | parseShow (string, ConfigOpts *) |
| Parses the filename. More... | |
| string | getOldDir () const |
| string | getOldFile () const |
| string | getDir () const |
| string | getShow () const |
| int | getShowNameIndex () const |
| int | getSeason () const |
| int | getEpisode () const |
| int | getXEpisode () const |
| string | getPEpisode () const |
| string | getTitle () const |
| string | getExtension () const |
| bool | getOverRideDir () const |
| bool | getError () const |
| ConfigOpts::errorType | getErrorData () const |
Private Member Functions | |
| bool | findShow (string &, ConfigOpts *) |
| Determines if the given filename contains a show name. More... | |
| void | newName (ConfigOpts *) |
| Generates the new filename from parsed data complete with extension. More... | |
| void | newDir (ConfigOpts *) |
| Generates the new directory in which the file will be located. More... | |
Static Private Member Functions | |
| static void | matchPattern (string &, int *, int &, int &, int &, string &) |
| Finds a season and episode number in a given string (filename). More... | |
| static void | cleanUp (string &, ConfigOpts *) |
| Removes filler characters and extra white spaces from a string. More... | |
| static void | removeTag (string &, ConfigOpts *) |
| Removes release group tags as defined in the blacklist file. More... | |
| static void | titleCase (string &, ConfigOpts *) |
| Standardizes capitalization of titles. More... | |
Private Attributes | |
| string | oldDir |
| Holds the show's original directory. More... | |
| string | oldFile |
| Holds the show's original filename. More... | |
| string | dir |
| Holds the show's new directory. More... | |
| string | show |
| Holds the show's new filename. More... | |
| int | showNameIndex |
| Holds the index of the showname. More... | |
| int | season |
| Holds the show's season number. More... | |
| int | episode |
| Holds the show's episode number. More... | |
| int | xepisode |
| Holds the show's multi-episode number. More... | |
| string | pepisode |
| Holds the show's episode part. More... | |
| string | title |
| Holds the show's new title. More... | |
| string | extension |
| Holds the show's new extension. More... | |
| bool | overrideDir |
| Override directory flag - (WTF?) More... | |
| bool | error |
| Error flag - True if an error occured. More... | |
| ConfigOpts::errorType | errorData |
| Stores the error type code. More... | |
| int | weight |
| Holds the value used for duplicate selection - (WTF?) More... | |
Creates an object for each input file and parses file and folder names.
Matches filename with a showname in the showlist file. Removes all extra info, release tags, non-blank space characters. Corrects capitalization, and formats season and episode data.
Definition at line 23 of file parser.hpp.
| Parser::Parser | ( | ) |
Default constructor, yields default values.
Definition at line 32 of file showParser.cpp.
| Parser::~Parser | ( | ) |
Default destructor.
Definition at line 53 of file showParser.cpp.
|
staticprivate |
Removes filler characters and extra white spaces from a string.
| fillStr | - the string to be cleaned up. |
| confOpt | - contains the showlist, blacklist, and list of filenames to be parsed. |
Definition at line 77 of file parseFilter.cpp.


|
private |
Determines if the given filename contains a show name.
This function utilizes the contents of the showlist file (previously parsed into confOpt) to determine if given string contains a tv show name and returns true if a show name is matched.
| p_showName | - the original filename passed by reference to be searched for a pattern. |
| confOpt | - contains the showlist, blacklist, and list of filenames to be parsed. |
Definition at line 31 of file parseFilter.cpp.


| string Parser::getDir | ( | ) | const |
Definition at line 351 of file showParser.cpp.

| int Parser::getEpisode | ( | ) | const |
Definition at line 379 of file showParser.cpp.

| bool Parser::getError | ( | ) | const |
Definition at line 421 of file showParser.cpp.

| ConfigOpts::errorType Parser::getErrorData | ( | ) | const |
Definition at line 428 of file showParser.cpp.

| string Parser::getExtension | ( | ) | const |
Definition at line 407 of file showParser.cpp.
| string Parser::getOldDir | ( | ) | const |
Definition at line 337 of file showParser.cpp.

| string Parser::getOldFile | ( | ) | const |
Definition at line 344 of file showParser.cpp.

| bool Parser::getOverRideDir | ( | ) | const |
Definition at line 414 of file showParser.cpp.
| string Parser::getPEpisode | ( | ) | const |
Definition at line 393 of file showParser.cpp.

| int Parser::getSeason | ( | ) | const |
Definition at line 372 of file showParser.cpp.

| string Parser::getShow | ( | ) | const |
Definition at line 358 of file showParser.cpp.

| int Parser::getShowNameIndex | ( | ) | const |
Definition at line 365 of file showParser.cpp.

| string Parser::getTitle | ( | ) | const |
Definition at line 400 of file showParser.cpp.

| int Parser::getXEpisode | ( | ) | const |
Definition at line 386 of file showParser.cpp.

|
staticprivate |
Finds a season and episode number in a given string (filename).
| t_oldFile | - the original filename passed by reference to be searched for a pattern. |
| coordofSnE | - an integer array passed by reference with the first and last indices of the detected pattern. |
| season | - an integer passed by reference to store the found season number. |
| episode | - an integer passed by reference to store the found episode number. |
| xepisode | - an integer passed by reference to store the found extra episode number. |
| pepisode | - an integer passed by reference to store the found partial episode number. |
Definition at line 17 of file matchPattern.cpp.

|
private |
Generates the new directory in which the file will be located.
The directory is constructed from the show name, season, and the desired root directory for the output.
| confOpt | - contains the showlist, blacklist, and list of filenames to be parsed. |
Definition at line 303 of file parseFilter.cpp.


|
private |
Generates the new filename from parsed data complete with extension.
| confOpt | - contains the showlist, blacklist, and list of filenames to be parsed. |
Definition at line 228 of file parseFilter.cpp.


| void Parser::parseShow | ( | string | fileName, |
| ConfigOpts * | confOpt | ||
| ) |
Parses the filename.
This function does the majority of the real 'work' of clerk. It accesses numerous other functions to complete the job of breaking a filename into its useful parts and storing that data in preparation for the output functions.
| fileName | - the name of the file to be parsed including directory information and the extension. |
| confOpt | - contains the showlist, blacklist, and list of filenames to be parsed. |
Definition at line 66 of file showParser.cpp.


|
staticprivate |
Removes release group tags as defined in the blacklist file.
This function is used to 'pretty up' a string by removing extraneous tags that are often added to an episode name by the group that initially created the file.
| tagStr | - the string to be cleaned up. |
| confOpt | - contains the showlist, blacklist, and list of filenames to be parsed. |
Definition at line 142 of file parseFilter.cpp.

|
staticprivate |
Standardizes capitalization of titles.
| capStr | - the string to be cleaned up. |
| confOpt | - contains the showlist, blacklist, and list of filenames to be parsed. |
Definition at line 163 of file parseFilter.cpp.


|
private |
Holds the show's new directory.
Definition at line 65 of file parser.hpp.
|
private |
Holds the show's episode number.
Definition at line 69 of file parser.hpp.
|
private |
Error flag - True if an error occured.
Definition at line 75 of file parser.hpp.
|
private |
Stores the error type code.
SeasonEpisodeError - A Season or Episode pattern match failure occured ShowNameMatchError - A Show name match failure occured DuplicateEpisodeError - A duplicate Episode failure occured SortFailureError - A sort failure occured NoError - No errors occured
Definition at line 76 of file parser.hpp.
|
private |
Holds the show's new extension.
Definition at line 73 of file parser.hpp.
|
private |
Holds the show's original directory.
Definition at line 63 of file parser.hpp.
|
private |
Holds the show's original filename.
Definition at line 64 of file parser.hpp.
|
private |
Override directory flag - (WTF?)
Definition at line 74 of file parser.hpp.
|
private |
Holds the show's episode part.
Definition at line 71 of file parser.hpp.
|
private |
Holds the show's season number.
Definition at line 68 of file parser.hpp.
|
private |
Holds the show's new filename.
Definition at line 66 of file parser.hpp.
|
private |
Holds the index of the showname.
Definition at line 67 of file parser.hpp.
|
private |
Holds the show's new title.
Definition at line 72 of file parser.hpp.
|
private |
Holds the value used for duplicate selection - (WTF?)
weight = 28 // "S##E##" weight = 27 // "S##E##-##" weight = 26 // "S## E##" OR "S##XE##" weight = 25 // "S## E##-##" OR "S##XE##-##" weight = 24 // "S# E##" weight = 23 // "S# E##-##" weight = 22 // "S#E##" weight = 21 // "S#E##-##" weight = 20 // "S#E#" weight = 19 // "S#E#-##" weight = 18 // "####" weight = 17 // "####-##" weight = 16 // "###" weight = 15 // "###-##" weight = 14 // "##X##" weight = 13 // "##X##-##" weight = 12 // "#X## OR #/##" weight = 11 // "#X##-## OR #/##-##" weight = 10 // "S##" weight = 09 // "S#" weight = 08 // "##" weight = 07 // "#"
Definition at line 89 of file parser.hpp.
|
private |
Holds the show's multi-episode number.
Definition at line 70 of file parser.hpp.
1.8.6